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

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.

scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
scripts/netbios-interfaces.nse Show resolved Hide resolved
nselib/netbios.lua Show resolved Hide resolved
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
scripts/netbios-interfaces.nse Show resolved Hide resolved
scripts/netbios-interfaces.nse Outdated Show resolved Hide resolved
@nnposter nnposter added the NSE script NSE script label Dec 23, 2020
Copy link

@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.

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

@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

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.

None yet

2 participants