[Samba] Lightweight NetBIOS host enumeration in Python

christian samba at sisyphus.ch
Sat Sep 12 02:05:03 MDT 2009


On Fri, Sep 11, 2009 at 03:58:22PM -0700, Matthew Dempsky wrote:

> Also, what's the output of "nmblookup -M -- -" on this host? (That's
> two dashes, and then one dash.)

those that DON'T work:

__cut__
querying __MSBROWSE__ on 172.16.0.255
172.16.0.254 __MSBROWSE__<01>
172.16.0.1 __MSBROWSE__<01>
__cut__

or

__cut__
added interface ip=192.168.0.253 bcast=192.168.0.255 nmask=255.255.255.0
querying __MSBROWSE__ on 192.168.0.255
Got a positive name query response from 192.168.0.3 ( 192.168.0.3 )
Got a positive name query response from 192.168.0.112 ( 192.168.0.112 )
192.168.0.3 __MSBROWSE__<01>
192.168.0.112 __MSBROWSE__<01>
__cut__

or

__cut__
querying __MSBROWSE__ on 192.168.19.255
Sending a packet of len 50 to (192.168.19.255) on port 137
Received a packet of len 62 from (192.168.19.254) port 137
nmb packet from 192.168.19.254(137) header: id=20270 opcode=Query(0) response=Yes
    header: flags: bcast=No rec_avail=Yes rec_des=Yes trunc=No auth=Yes
    header: rcode=0 qdcount=0 ancount=1 nscount=0 arcount=0
    answers: nmb_name=__MSBROWSE__<01> rr_type=32 rr_class=1 ttl=259200
    answers   0 char ......   hex E000C0A813FE
Got a positive name query response from 192.168.19.254 ( 192.168.19.254 )
192.168.19.254 __MSBROWSE__<01>
__cut__


and the ones that WORK:

__cut__
WARNING: The "printer admin" option is deprecated
added interface ip=192.168.18.253 bcast=192.168.18.255 nmask=255.255.255.0
Socket opened.
querying __MSBROWSE__ on 192.168.18.255
Got a positive name query response from 192.168.18.253 ( 192.168.18.253 )
Got a positive name query response from 192.168.18.203 ( 192.168.18.203 )
Got a positive name query response from 192.168.18.54 ( 192.168.18.54 )
192.168.18.253 __MSBROWSE__<01>
192.168.18.203 __MSBROWSE__<01>
192.168.18.54 __MSBROWSE__<01>
__cut__

or

__cut__
querying __MSBROWSE__ on 10.241.167.255
10.241.167.252 __MSBROWSE__<01>
10.241.167.18 __MSBROWSE__<01>
__cut__
                
-- 


More information about the samba mailing list