A comprehensive Bash-based network reconnaissance tool for security audits and penetration testing. It can scan IP ranges or individual hosts, identify open ports, detect services, and retrieve device information with optional MAC address spoofing capabilities.
- Parallel scanning – scan up to 8 hosts simultaneously for speed
- CIDR support – automatically expands network ranges (e.g.,
192.168.1.0/24) - Port detection – identifies open ports using native Bash TCP probes or nmap
- Service identification – grabs banners and extracts service versions
- Device fingerprinting – resolves MAC addresses to vendors via IEEE OUI database
- MAC spoofing – change or randomize MAC address for anonymous scanning
- Structured reports – generates both text and JSON output for easy parsing
- State management – automatically backs up and restores original MAC address
- Flexible targeting – scan all hosts from scope file or single IP addresses
The script requires the following tools:
# Core utilities
curl
jq
nc (netcat)
ipcalc
ip (iproute2)
ping
flock
openssl
# Optional (for enhanced scanning)
nmap
sudo or doas (for MAC spoofing)- Linux (Debian/Ubuntu or Arch Linux)
- Bash 4.0+
- Root or sudo privileges (for MAC address changes)
- Network connectivity to target hosts
- Clone the repository:
git clone https://github.com/rhjddjdbc/LocalNetScan.git
cd LocalNetScan- Install dependencies:
Ubuntu/Debian:
sudo apt-get install curl jq netcat-openbsd ipcalc iputils-ping util-linux openssl nmapArch Linux:
sudo pacman -S curl jq openbsd-netcat ipcalc iproute2 iputils util-linux openssl nmap- Download the OUI database (optional but recommended):
curl -o oui.txt https://standards-oui.ieee.org/oui/oui.txt- Make the script executable:
chmod +x LocalNetScan.sh./LocalNetScan.sh [MODE] [OPTIONS]| Mode | Description |
|---|---|
--all |
Scan all entries from scope.txt |
--host <IP> |
Scan a single host |
| Option | Description |
|---|---|
--interface <iface> |
Specify network interface (required for MAC spoofing) |
--mac <MAC> |
Set a specific MAC address (format: 00:1A:2B:3C:4D:5E) |
--random |
Generate and use a random locally-administered MAC address |
--restore |
Restore original MAC address and exit |
--nmap |
Use nmap for port scanning instead of Bash TCP probes |
--full |
Enable full port scanning (equivalent to --ports) |
--ports |
Scan only ports |
--help |
Display help message |
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
This tool is for educational and authorized security testing purposes only. Only scan networks you own or have explicit written authorization to test. Unauthorized network scanning is illegal in most jurisdictions. The authors are not responsible for misuse, damage, or legal consequences.