Skip to content
256kMagic edited this page Apr 14, 2025 · 1 revision

Install Python dependencies:

pip install colorama tqdm python-nmap Install Nmap and add it to your PATH: Windows: Download the installer from [nmap.org](https://nmap.org/download.html) and follow the setup instructions. Prepare mac_vendors.txt: Place it in the project directory. Format: IEEE OUI (e.g., 28-6F-B9 (hex) Nokia Shanghai Bell Co., Ltd.). Source: Download oui.txt from [IEEE](https://standards.ieee.org/products-programs/regauth/oui/) or use a custom list. Ensure UTF-8 encoding to avoid decoding errors (see Troubleshooting). Usage Run the script as Administrator:

python nettool-v8.py Enter a subnet in CIDR format (e.g., 192.168.1.0/24). The script will: Scan for live hosts. Retrieve MAC addresses and look up vendors. Scan ports and services. Display a table of results. Example Output:

NetTools Subnet Scanner Enter subnet (e.g., 10.0.0.0/24): 192.168.1.0/24 Loaded 4 MAC vendors from mac_vendors.txt Scanning hosts: |████████████████████| 254/254 Scanning ports/MAC: |████████████████████| 3/3 MACs to lookup: ['6E:03:74:71:86:1C',] Looking up 6E:03:74:71:86:1C (prefix 6E:03:74): Unknown Looking up 8C:49:62:AC:CB:31 (prefix 8C:49:62): VMware, Inc. Looking up EC:93:7D:CE:97:80 (prefix EC:93:7D): Unknown Live Hosts with Open Ports:


IP Address MAC Address NIC Vendor Open Ports Services
192.168.1.1 6E:03:74:71:86:1C Unknown 80, 443 http, https 192.168.1.100 8C:49:62:AC:CB:31 VMware, Inc. 445 smb 192.168.1.101 EC:93:7D:CE:97:80 Unknown 22 ssh
mac_vendors.txt The script uses mac_vendors.txt for MAC vendor lookups, expecting IEEE OUI format:

text

28-6F-B9 (hex) Nokia Shanghai Bell Co., Ltd. 08-EA-44 (hex) Extreme Networks Headquarters Source: Use IEEE’s oui.txt or create a custom file. Encoding: Save as UTF-8 to avoid decoding errors (e.g., charmap issues). Location: Place in the same directory as nettool-v8.py. If your MACs (e.g., 6E:03:74, 8C:49:62) aren’t in the file, vendors will show as Unknown. Update the file with entries like:

8C-49-62 (hex) VMware, Inc. Troubleshooting Error: mac_vendors.txt not found: Ensure the file exists in the project directory. Create it with IEEE OUI data or a custom list. Error: 'charmap' codec can't decode byte: Convert mac_vendors.txt to UTF-8: In Notepad++: Encoding > Convert to UTF-8, then save. In VS Code: Select Save with Encoding > UTF-8. Or run: python

with open("mac_vendors.txt", "r", encoding="latin1") as f:

    content = f.read()

with open("mac_vendors.txt", "w", encoding="utf-8") as f:

    f.write(content)

The script automatically tries Latin1 if UTF-8 fails. Vendors show as Unknown: Check the Looking up logs (e.g., Looking up 6E:03:74:71:86:1C (prefix 6E:03:74): Unknown). Add missing OUIs to mac_vendors.txt (e.g., 6E-03-74 (hex) Vendor Name). Nmap errors: Ensure Nmap is installed and in PATH. Run as Administrator. No live hosts: Verify the subnet is correct and reachable. Check firewall settings (ping responses may be blocked).

Clone this wiki locally