diff --git a/bbot/modules/ajaxpro.py b/bbot/modules/ajaxpro.py new file mode 100644 index 000000000..924f88835 --- /dev/null +++ b/bbot/modules/ajaxpro.py @@ -0,0 +1,51 @@ +import re +from bbot.modules.base import BaseModule + + +class ajaxpro(BaseModule): + """ + Reference: https://mogwailabs.de/en/blog/2022/01/vulnerability-spotlight-rce-in-ajax.net-professional/ + """ + + ajaxpro_regex = re.compile(r' + + + + + + + """ + + async def setup_before_prep(self, module_test): + # Simulate ajaxpro URL probe positive + expect_args = {"method": "GET", "uri": "/ajaxpro/whatever.ashx"} + respond_args = {"status": 200} + module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args) + + # Simulate ajaxpro URL probe negative + expect_args = {"method": "GET", "uri": "/a/whatever.ashx"} + respond_args = {"status": 404} + module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args) + + # Simulate HTTP_RESPONSE detection + expect_args = {"method": "GET", "uri": "/"} + respond_args = {"response_data": self.http_response_data} + module_test.set_expect_requests(expect_args=expect_args, respond_args=respond_args) + + def check(self, module_test, events): + ajaxpro_url_detection = False + ajaxpro_httpresponse_detection = False + + for e in events: + if ( + e.type == "FINDING" + and "Ajaxpro Detected (Version Unconfirmed) Trigger: [http://127.0.0.1:8888/ajaxpro/whatever.ashx]" + in e.data["description"] + ): + ajaxpro_url_detection = True + continue + if ( + e.type == "FINDING" + and 'Ajaxpro Detected (Version Unconfirmed) Trigger: [