|
SMB
Browsing
Since
in Unix there is no such thing as a "Network Neighborhood"
that allows you to browse the SMB enabled computers on a network, it
is necessary to be able to find this list. You can easily do this by
using the Samba package and knowing
how to use the tools. Below is an example of how to do it. This was
done on the UCSD Residental Network (ResNet),
and so the IP addresses are specific to UCSD.
1. First
we need to look up the master browsers on the network. These are the
computers that store a list of all the computers on their particular
browse network/domain/workgroup.
$nmblookup -M -B 128.54.255.255 -
128.54.232.43 __MSBROWSE__<01>
128.54.231.160 __MSBROWSE__<01>
128.54.231.30 __MSBROWSE__<01>
128.54.232.45 __MSBROWSE__<01>
128.54.231.117 __MSBROWSE__<01>
128.54.231.245 __MSBROWSE__<01>
128.54.232.93 __MSBROWSE__<01>
128.54.231.101 __MSBROWSE__<01>
The IP
addresses are the IPs of the actual master browsers.
2. Having
the IP addresses isn't enough, so we must discover the computer's name.
We have to do this for each browser that you want to look at. We'll
take a look at the 128.54.231.101 browser.
$nmblookup -A 128.54.231.101
Looking up status of 128.54.231.101
received 7 names
DAMAN <00> - B
1322 <00> - B
DAMAN <03> - B
DAMAN <20> - B
1322 <1e> - B
1322 <1d> - B
..__MSBROWSE__. <01> - B
num_good_sends=0 num_good_receives=0
This lists
all the status information about this IP address. The line that is flaged
with <20> is the actual computer name for this browser. Now we
know that this computer is named DAMAN, and has the IP address of 128.54.231.101.
3. Now
we're ready to ask this browser the list of computers that are registered
to him. This is done via
$smbclient -I 128.54.231.101 -N -L DAMAN
This will
list all the servers that are on this browser. This is the process that
Windows uses to build your list of computers for the Network Neighborhood.
You must repeat this for every master browser to get the full list of
computers on your network. Oh, and make sure that your subnet mask on
your network card is set properly! Without it, all this browsing will
fail because your computer will be addressing broadcasts incorrectly.
Good luck!
If you've got any questions, click on contact
me to ask them.
|