Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added script for getting network interfaces via NetBIOS #2201

Closed
wants to merge 3 commits into from
Closed

added script for getting network interfaces via NetBIOS #2201

wants to merge 3 commits into from

Conversation

@s0i37
Copy link

@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

@nnposter nnposter left a comment

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

Loading

scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Show resolved Hide resolved
Loading
nselib/netbios.lua Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
Copy link

@nnposter nnposter left a comment

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

Loading

scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
nselib/netbios.lua Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Show resolved Hide resolved
Loading
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
Loading
Copy link

@nnposter nnposter left a comment

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

Loading

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

@nnposter nnposter commented Dec 30, 2020

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!

Loading

@nmap-bot nmap-bot closed this in 77f764f Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants