SMB Network Scanner - Easily find ANY shared device on your network ( Including Windows or MAC's )

Instructions on performing a task with current MX Linux versions by giving step-by-step instructions. User-generated and user-reviewed.
Message
Author
User avatar
CharlesV
Administrator
Posts: 8198
Joined: Sun Jul 07, 2019 5:11 pm

SMB Network Scanner - Easily find ANY shared device on your network ( Including Windows or MAC's )

#1 Post by CharlesV »

Frustrated by samba browsing not working in any reliable pattern, a year or so ago I decided to write something that got me browsing SMB machines, and in particular Windows machines on a Linux network!

Wanting to have this ability in both my KDE and XFCE machines, I went after a solution that uses 'clean tech' to find machines open to SMB connections... I recently added a YAD GUI to make this a little better looking, and this
SMB Network Scanner is the result.

SMB Network Scanner uses nmap to scan the local network, and then presents SMB hosts in a clickable YAD dialog.

Image

Double clicking or highlighting an entry or highlighting and then clicking the connect button, creates the connection in the default file manager, opening that network address.

Dependencies - all can be checked and installed by using the 'install' parameter when starting the script from the command line.
- nmap
- samba
- yad
- zenity

There are three protocols looked at for every device found, so it takes some time to scan the entire network. So we use a cache file which is instrumental to keep things speedy.

Scanning builds the cache file, which is then used to speed up all future runs. We can rescan, or if the cache file has been deleted, then we rescan automatically.

Image

I added some command line parameters to get some things done quickly too
- scan - Forces an immediate network scan and then shows the Available machines
- show - Displays the available machines, based on the current cache file
- simple - This was my starting ui, still kind of like it.. so I left it available.
- quick - a Dialog to just show the current network mask and you fill in the last octoid and connect.
- install - Checks and then install the dependencies.


-- Version Notes --

250826 CV v5 - Additional mods for cleanup and:
- moved to xdg_open to provide for various default FM's
- restructured main code for constancy and main logic to bottom
- cleaned up comments and restructured function templates.
250825 CV v4 - Added more notes and comments
241206 CV v3 - Restructured to put list into a text file.
240809 CV v2 - Fixes and additions:
- Fixed weird issue with not seeing some computers
- some netbios machines not 'always' showing up
240305 CV v1 Operational ! Actually works!


Yes - AI Helped me. I originally had the nmap scan setup and put all machines found into a text file, then worked up the text file to be 'linkable' and I could click on them. This worked great once I figured out to setup a cache file and save the results until I needed to scan again. Clunky... but affective. Ai helped me put this all into different GUI format, create the 'Scanning' dialog, and smooth out a few issues with default File Managers etc.

The script is here, along with a readme and I may add more features in the future, but this works well find all machines with shares on the network, in a brows-able fashion. ( Windows machines included! )

Extract the script, change the rights to be executable and your scanning! I created a custom Thunar Action that runs this script from thunar when I want to browse on my network. And with the cache file, it is nearly instantaneous to find known machines.


Note: I t has been brought to my attention that because this script does a FULL network scan, some Network Admin's on corporate networks may frown on it. My retort is that as with any tool, (A hammer, or screwdriver even), is a VERY useful tool, and in toolbox too!. However, when used in the wrong hands it can become a deadly weapon. This script is meant to help people find machines on their network - nothing more.

An update to the SMB Network Scanner !!
Version 7 Notes:
- Removed Zenity, now 100% YAD dialogs
- Added Multiple Network Interface support
- If more than one Network Interface is enabled, then a dialog to choose which network interface you have to scan is shown.
- Fixed SMB client Install
you can get the latest of SMB Network Scanner here
https://u.pcloud.link/publink/show?code ... BCH7yRRXdk
*QSI = Quick System Info from menu (Copy for Forum)
*MXPI = MX Package Installer
*Please check the solved checkbox on the post that solved it.
*Linux -This is the way!

Return to “How Tos”