BNAT Scanner - Metasploit
This page contains detailed information about how to use the auxiliary/bnat/bnat_scan metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: BNAT Scanner
Module: auxiliary/bnat/bnat_scan
Source code: modules/auxiliary/bnat/bnat_scan.rb
Disclosure date: -
Last modification time: 2019-03-05 03:38:51 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: -
This module is a scanner which can detect Broken NAT (network address translation) implementations, which could result in an inability to reach ports on remote machines. Typically, these ports will appear in nmap scans as 'filtered'/'closed'.
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
This module is a scanner module, and is capable of testing against multiple hosts.
msf > use auxiliary/bnat/bnat_scan
msf auxiliary(bnat_scan) > show options
... show and set options ...
msf auxiliary(bnat_scan) > set RHOSTS ip-range
msf auxiliary(bnat_scan) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(bnat_scan) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(bnat_scan) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(bnat_scan) > set RHOSTS file:/tmp/ip_list.txt
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Go back to menu.
Msfconsole Usage
Here is how the bnat/bnat_scan auxiliary module looks in the msfconsole:
msf6 > use auxiliary/bnat/bnat_scan
msf6 auxiliary(bnat/bnat_scan) > show info
Name: BNAT Scanner
Module: auxiliary/bnat/bnat_scan
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
bannedit <[email protected]>
Jonathan Claudius <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
INTERFACE eth0 yes The name of the interface
PORTS 21,22,23,80,443 yes Ports to scan (e.g. 22-25,80,110-900)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
THREADS 1 yes The number of concurrent threads (max one per host)
TIMEOUT 500 yes The reply read timeout in milliseconds
Description:
This module is a scanner which can detect Broken NAT (network
address translation) implementations, which could result in an
inability to reach ports on remote machines. Typically, these ports
will appear in nmap scans as 'filtered'/'closed'.
References:
https://github.com/claudijd/bnat
http://www.slideshare.net/claudijd/dc-skytalk-bnat-hijacking-repairing-broken-communication-channels
Module Options
This is a complete list of options available in the bnat/bnat_scan auxiliary module:
msf6 auxiliary(bnat/bnat_scan) > show options
Module options (auxiliary/bnat/bnat_scan):
Name Current Setting Required Description
---- --------------- -------- -----------
INTERFACE eth0 yes The name of the interface
PORTS 21,22,23,80,443 yes Ports to scan (e.g. 22-25,80,110-900)
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
THREADS 1 yes The number of concurrent threads (max one per host)
TIMEOUT 500 yes The reply read timeout in milliseconds
Advanced Options
Here is a complete list of advanced options supported by the bnat/bnat_scan auxiliary module:
msf6 auxiliary(bnat/bnat_scan) > show advanced
Module advanced options (auxiliary/bnat/bnat_scan):
Name Current Setting Required Description
---- --------------- -------- -----------
GATEWAY_PROBE_HOST 8.8.8.8 yes Send a TTL=1 random UDP datagram to this host to discover the default gateway's MAC
GATEWAY_PROBE_PORT no The port on GATEWAY_PROBE_HOST to send a random UDP probe to (random if 0 or unset)
SECRET 1297303073 yes A 32-bit cookie for probe requests.
ShowProgress true yes Display progress messages during a scan
ShowProgressPercent 10 yes The interval in percent that progress should be shown
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 bnat/bnat_scan module can do:
msf6 auxiliary(bnat/bnat_scan) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the bnat/bnat_scan auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(bnat/bnat_scan) > 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.
PORTS
Here is a relevant code snippet related to the "PORTS" error message:
74: pcap = self.capture
75:
76: ports = Rex::Socket.portspec_crack(datastore['PORTS'])
77:
78: if ports.empty?
79: raise Msf::OptionValidateError.new(['PORTS'])
80: end
81:
82: ports.each_with_index do |port,i|
83: p.tcp_dst = port
84: p.tcp_src = rand(64511)+1024
Go back to menu.
Related Pull Requests
- #11523 Merged Pull Request: MSF5: Remove unneeded RHOST deregister in scanners
- #8888 Merged Pull Request: spelling/grammar fixes part 1
- #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
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #6139 Merged Pull Request: Remove bad references (dead links)
- #6010 Merged Pull Request: Fix #6008, incorrect usage of capture_sendto
- #2779 Merged Pull Request: Raise Msf::OptionValidateError when the PORTS option is invalid
- #2525 Merged Pull Request: Change module boilerplate
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
- #452 Merged Pull Request: Whitespace cleanup
- #138 Merged Pull Request: Added Sequence Filters and MSF Exploit Capture to BNAT Scan
References
- CVE: Not available
- https://github.com/claudijd/bnat
- http://www.slideshare.net/claudijd/dc-skytalk-bnat-hijacking-repairing-broken-communication-channels
See Also
Check also the following modules related to this module:
- auxiliary/scanner/discovery/ipv6_neighbor_router_advertisement
- auxiliary/scanner/sap/sap_router_info_request
- auxiliary/scanner/sap/sap_router_portscanner
- exploit/unix/http/ctek_skyrouter
- exploit/windows/misc/avaya_winpmd_unihostrouter
- auxiliary/bnat/bnat_router
- auxiliary/gather/ssllabs_scan
- auxiliary/scanner/scada/digi_realport_serialport_scan
Authors
- bannedit
- Jonathan Claudius <jclaudius[at]trustwave.com>
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.