NetBIOS Response "BadTunnel" Brute Force Spoof (NAT Tunnel) - Metasploit
This page contains detailed information about how to use the auxiliary/server/netbios_spoof_nat metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: NetBIOS Response "BadTunnel" Brute Force Spoof (NAT Tunnel)
Module: auxiliary/server/netbios_spoof_nat
Source code: modules/auxiliary/server/netbios_spoof_nat.rb
Disclosure date: 2016-06-14
Last modification time: 2020-05-12 22:15:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2016-3213, CVE-2016-3236
This module listens for a NetBIOS name request and then continuously spams NetBIOS responses to a target for given hostname, causing the target to cache a malicious address for this name. On high-speed 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. This module works when the target is behind a NAT gateway, since the stream of NetBIOS responses will keep the NAT mapping alive after the initial setup. To trigger the initial NetBIOS request to the Metasploit system, force the target to access a UNC link pointing to the same address (HTML, Office attachment, etc). This NAT-piercing issue was named the 'BadTunnel' vulnerability by the discoverer, Yu Yang (@tombkeeper). The Microsoft patches (MS16-063/MS16-077) impact the way that the proxy host (WPAD) host is identified, but do change the predictability of NetBIOS requests.
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/server/netbios_spoof_nat
msf auxiliary(netbios_spoof_nat) > show targets
... a list of targets ...
msf auxiliary(netbios_spoof_nat) > set TARGET target-id
msf auxiliary(netbios_spoof_nat) > show options
... show and set options ...
msf auxiliary(netbios_spoof_nat) > exploit
Go back to menu.
Msfconsole Usage
Here is how the server/netbios_spoof_nat auxiliary module looks in the msfconsole:
msf6 > use auxiliary/server/netbios_spoof_nat
msf6 auxiliary(server/netbios_spoof_nat) > show info
Name: NetBIOS Response "BadTunnel" Brute Force Spoof (NAT Tunnel)
Module: auxiliary/server/netbios_spoof_nat
License: Metasploit Framework License (BSD)
Rank: Normal
Disclosed: 2016-06-14
Provided by:
vvalien
hdm <[email protected]>
tombkeeper
Available actions:
Name Description
---- -----------
Service Run listener for NetBIOS requests and respond to them
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
SRVHOST 0.0.0.0 yes The local host to listen on.
SRVPORT 137 yes The local port to listen on.
Description:
This module listens for a NetBIOS name request and then continuously
spams NetBIOS responses to a target for given hostname, causing the
target to cache a malicious address for this name. On high-speed
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. This module works when the target is behind a NAT gateway,
since the stream of NetBIOS responses will keep the NAT mapping
alive after the initial setup. To trigger the initial NetBIOS
request to the Metasploit system, force the target to access a UNC
link pointing to the same address (HTML, Office attachment, etc).
This NAT-piercing issue was named the 'BadTunnel' vulnerability by
the discoverer, Yu Yang (@tombkeeper). The Microsoft patches
(MS16-063/MS16-077) impact the way that the proxy host (WPAD) host
is identified, but do change the predictability of NetBIOS requests.
References:
http://xlab.tencent.com/en/2016/06/17/BadTunnel-A-New-Hope/
https://nvd.nist.gov/vuln/detail/CVE-2016-3213
https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2016/MS16-063
https://nvd.nist.gov/vuln/detail/CVE-2016-3236
https://docs.microsoft.com/en-us/security-updates/SecurityBulletins/2016/MS16-077
Module Options
This is a complete list of options available in the server/netbios_spoof_nat auxiliary module:
msf6 auxiliary(server/netbios_spoof_nat) > show options
Module options (auxiliary/server/netbios_spoof_nat):
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
SRVHOST 0.0.0.0 yes The local host to listen on.
SRVPORT 137 yes The local port to listen on.
Auxiliary action:
Name Description
---- -----------
Service Run listener for NetBIOS requests and respond to them
Advanced Options
Here is a complete list of advanced options supported by the server/netbios_spoof_nat auxiliary module:
msf6 auxiliary(server/netbios_spoof_nat) > show advanced
Module advanced options (auxiliary/server/netbios_spoof_nat):
Name Current Setting Required Description
---- --------------- -------- -----------
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 server/netbios_spoof_nat module can do:
msf6 auxiliary(server/netbios_spoof_nat) > show actions
Auxiliary actions:
Name Description
---- -----------
Service Run listener for NetBIOS requests and respond to them
Evasion Options
Here is the full list of possible evasion options supported by the server/netbios_spoof_nat auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(server/netbios_spoof_nat) > 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 <E.CLASS> <E> <E.BACKTRACE>
Here is a relevant code snippet related to the "Error <E.CLASS> <E> <E.BACKTRACE>" error message:
96: netbios_spam
97:
98: rescue ::Interrupt
99: raise $!
100: rescue ::Exception => e
101: print_error("Error #{e.class} #{e} #{e.backtrace}")
102: ensure
103: @sock.close if @sock
104: end
105: end
106:
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:
139: pps = (pcnt / (Time.now.to_f - stime)).to_i
140: if pps > @targ_rate
141: sleep(0.01)
142: end
143: rescue Errno::ECONNREFUSED
144: print_error("Error: Target sent us an ICMP port unreachable, port is likely closed")
145: live = false
146: break
147: end
148: end
149: end
Go back to menu.
Related Pull Requests
- #13443 Merged Pull Request: Add descriptions to auxiliary modules Actions
- #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
References
- http://xlab.tencent.com/en/2016/06/17/BadTunnel-A-New-Hope/
- CVE-2016-3213
- MS16-063
- CVE-2016-3236
- MS16-077
See Also
Check also the following modules related to this module:
- auxiliary/admin/netbios/netbios_spoof
- auxiliary/server/dns/spoofhelper
- 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
- auxiliary/scanner/netbios/nbname
- auxiliary/admin/natpmp/natpmp_map
- auxiliary/dos/windows/nat/nat_helper
- auxiliary/gather/natpmp_external_address
- auxiliary/scanner/natpmp/natpmp_portscan
- auxiliary/server/dns/native_server
- exploit/linux/misc/mongod_native_helper
- auxiliary/admin/vmware/terminate_esx_sessions
- auxiliary/bnat/bnat_router
- auxiliary/bnat/bnat_scan
- auxiliary/gather/impersonate_ssl
- auxiliary/parser/unattend
- auxiliary/scanner/http/linknat_vos_traversal
- exploit/multi/http/phpmyadmin_null_termination_exec
- exploit/windows/browser/indusoft_issymbol_internationalseparator
- exploit/windows/local/bits_ntlm_token_impersonation
- post/windows/gather/enum_unattend
- post/windows/manage/rollback_defender_signatures
Authors
- vvalien
- hdm
- tombkeeper
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.