Package: netscanner
NETSCANNERThis project is the product of my final year undergraduate development project for my Bachelor of Science degree in Computer Networking and Cyber Security at London Metropolitan University.This program will conduct a comprehensive scan of the local network and surrounding wireless networks using basic OS utilities, Nmap and airodump-ng.DisclaimerThis program is designed to conduct a rigorous and comprehensive scan of your local network by actively engaging network hosts using common host discovery and port scanning techniques to produce an extensive overview of the local network. This program is also designed to produce an overview of surrounding wireless networks by capturing 802.11 frames in the vicinity of the host interface.This program is a network reconnaissance tool and when executing the module you are wholly responsible and liable for any physical, mental or financial damage, complications and consequences of all operations that you execute using this utility.It is strongly recommended that you execute this program on networks you are authorised to audit. Use at your own discretion and risk.DemoScreenshots*MAC Addresses have been obscured.Running in the terminalViewing the output fileUsagepython3-mnetscanner<-h|-nP|-w|-l|-hD><--wP<seconds>><--pP<seconds>><--pR<firstport-lastport>>Requirementspython3: NETSCANNER was designed to work with Python 3.10.ifconfig: For gathering statistical data on local interfaces.ethtool: For gathering statistical data on local interfacesiwconfig: For gathering statistical data on local wireless-capable interfaces.airmon-ng: For enabling monitor mode on capable interfaces.airodump-ng: For capturing 802.11 beacon frames.Nmap: For conducting local network reconnaissance.A monitor-mode capable wireless interface is also required if you wish to use the wireless network discovery feature. Seeherefor more information on this.ExecutionUsing PyPIThe preferred method of running the program is installing the Python package from PyPI directly.pipinstallnetscannerThen running the program:python3-mnetscanner<modespecification><options>ManuallyYou can also run the module itself by downloading the__main__.pymodule from this repository and running it.python3__main__.py<modespecification><options>Avoiding sudoThe program runs shell commands with sudo privileges in the background, which may require you to provide your sudo password frequently.To avoid this, append this line to your/etc/sudoersfile usingsudo visudo# NETSCANNER PACKAGE<USERNAME>ALL=(ALL)NOPASSWD:ALLThis will allow you to run the module without being asked for your sudo password. This is wholly optional and it is recommended that you comment this line when done using the program.Attempt to run the program initially before you do this.Modes and OptionsModesMode 1This mode will execute all functions of the program. If no flags are specified this will be the mode of operation.Mode 2(-nP)This flag will execute Mode 2, NO PORT SCAN, which will execute the Host Discovery and 802.11 WLAN Discovery processes.Mode 3(-w)This flag will execute Mode 3, WIRELESS ONLY, which will execute the 802.11 WLAN Discovery process exclusively.Mode 4(-l)This flag will execute Mode 4, LOCAL SCAN ONLY, which will execute the Host Discovery and Port Scan processes.Mode 5(-hD)This flag will execute Mode 5, HOST DISCOVERY ONLY, which will execute the Host Discovery Process exclusively.OptionsWireless Scan Period(--wP <seconds>)This option allows you to specify a scan period for the 802.11 WLAN Discovery process. The default is 60. This value is ignored if the mode of operation is not Mode 1, 2 or 3. Large values will result in longer scan times but greater verbosity.Port Scan Period(--pP <seconds>)This option allows you to specify a scan period for the Port Scan process. The default is 60. This value is ignored if the mode of operation is not Mode 1 or 4. Large values will result in longer scan times but greater verbosity.Port Range(--pR <first port - last port>)This option allows you to specify a port range for the Port Scan process. The default is the 100 most common ports determined by Nmap (-F). Large values will result in longer scan times but greater verbosity. It is useful to combine this option with the--pPoption to avoid scan timeouts when scanning large ranges.ProcessesThis section provides a brief synopsis of each process used in the program. There are three processes that are used.Host DiscoveryThis process gathers characteristics about the local network and hosts on the local network using ifconfig, iwconfig, ethtool. And theARP Request PingandrDNS Query Floodin Nmap.Port ScanBy default, this process uses Nmap to determine the state of the 100 most used TCP and UDP ports(-F)on all active hosts on the local network using theTCP Half-Open Scanand theUDP Scan, port scanning techniques. The ports that are scanned can be changed using the--pRflag in the command line, to indicate a port range.This process also has a default timeout period of 60 seconds which can be changed using the--pPflag.Remote WLAN DiscoveryThis process determines the characteristics of remote wireless networks in the vicinity of the host machine if a wireless interface is present, available and capable of 802.11 monitor mode, using the802.11 packet capturetechnique in airodump-ng.The program will attempt to useairmon-ngto enable monitor mode on the interface. If this is unsuccessful you will not see an error, the table for Remote WLAN data will simply be empty.This process has a default timeout period of 60 seconds which can be changed using the--wPflag.Supported Operating SystemsThe program was designed to work with any UNIX-like operating system. It will not work on Windows.I have confirmed the following operating systems to support the program.Ubuntu 22.10Kali Linux 2022.4BlackArch Slim 2021.09.01ParrotOS Security 5.2 Electro AraUnderstanding the wireless data outputAccess PointsHeaderDescriptionBSSIDThe MAC address of a detected access point.SIGNALThe RSSI between the host machine and a detected access point.CHThe operating channel of a detected access point.RATEThe maximum speed in Mbps supported by a detected access point.ENCThe encryption algorithm in use by a detected access point.CIPHERThe cipher in use by a detected access point.AUTHThe authentication protocol in use by a detected access point.VENDORThe vendor of the NIC of a detected access point.StationsHeaderDescriptionSTATIONThe MAC address of a detected station.ASSOCIATED-BSSIDThe MAC address of the access point the station is connected to.SIGNALThe RSSI between the host machine and a detected station.VENDORThe vendor of the NIC of a detected station.Please view the airodump-ng documentationhere, for more detailed information about each header. Note:PWRandMBin airodump-ng correspond toSIGNALandRATE.FAQsThe terminal output is unreadable, now what?Sometimes the output may be format incorrectly due to the size of the terminal window or for unknown reasons. You can access all output files in thehome/<username>/Documents/NetScannerdirectory which is created when you run the program initially.All output files are in.txtformat and are timestamped with the local date and time of the scan, and a tag indicating the mode of operation that was specified.Why is there no wireless data in the output?Be sure to check your host machine has a 802.11 NIC. Thenverifythat your interface supports monitor mode.The program will attempt to enable monitor mode on the most active interface of your machine. This is determined by comparing the amount of data exchanged by all available interfaces excluding the loopback interface.If the most active interface does not support 802.11, or monitor mode - you will not see any wireless output data. If you are running the program in a virtual machine, you are also unlikely to get any wireless output data.How long should the scan take?Mode 1 will take at least two minutes to complete. Other modes will take less time. If you specify longer wireless scan, or port scan periods, and/or a large port range - the time period the scan will take will increase proportionately.What are hidden access points?These are access points that belong to a wireless network that has been configured to use SSID cloaking. This disables the broadcast of the SSID.What are stations?Stations are wireless endpoints.What are unassociated stations?These are stations that are either not connected to, or are attempting to connect to, a detected wireless network.