Skip to content

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.

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

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.

2 participants