close
Skip to content

added script for getting network interfaces via NetBIOS#2201

Closed
s0i37 wants to merge 3 commits into
nmap:masterfrom
s0i37:master
Closed

added script for getting network interfaces via NetBIOS#2201
s0i37 wants to merge 3 commits into
nmap:masterfrom
s0i37:master

Conversation

@s0i37
Copy link
Copy Markdown

@s0i37 s0i37 commented Dec 10, 2020

It is not very famous trick. We can gather network interfaces through netbios as:

nmblookup -A 10.0.0.64
nmblookup -B 10.0.0.64 WIN7X64VM
querying WIN7X64VM on 10.0.0.64
10.0.0.64 WIN7X64VM<00>
12.0.0.1 WIN7X64VM<00>

Or the same with python:

from nmb.NetBIOS import NetBIOS # pip2 install pysmb
netbios_names = netbios.queryIPForName( "10.0.0.64", timeout=0.1 )
print ', '.join( (netbios.queryName( netbios_names[0], ip="10.0.0.64" ) or []) + netbios_names )

Copy link
Copy Markdown

@nnposter nnposter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for proposing this script. It is definitely useful.
Please see line-level feedback for questions and/or suggestions.

Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread scripts/netbios-interfaces.nse
Comment thread nselib/netbios.lua
Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread scripts/netbios-interfaces.nse
Comment thread scripts/netbios-interfaces.nse Outdated
@nnposter nnposter added the NSE script NSE script label Dec 23, 2020
Copy link
Copy Markdown

@nnposter nnposter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script updates are on the right track. Please review these new comments.

Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread scripts/netbios-interfaces.nse Outdated
Comment thread nselib/netbios.lua
Comment thread scripts/netbios-interfaces.nse
Comment thread scripts/netbios-interfaces.nse
Comment thread scripts/netbios-interfaces.nse Outdated
Copy link
Copy Markdown

@nnposter nnposter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that we are good to go. The PR will be committed shortly

@nnposter nnposter self-assigned this Dec 30, 2020
@nnposter
Copy link
Copy Markdown

The script has been renamed to nbns-interfaces and committed as r38170, with the following tweaks:

  • The portrule is now restricting the execution to IPv4 scans.
  • If the target does not run NetBIOS server service, function netbios.get_server_name will return status true regardless but the returned name is nil. The script is now checking for this condition, instead of crashing.

Thank you for contributing to Nmap!

@nmap-bot nmap-bot closed this in 77f764f Dec 30, 2020
@nmap nmap deleted a comment Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NSE script NSE script

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants