Kali Network Reconnaissance Scripts — Ping Sweeps, Port Scans & Web Recon
Reconnaissance scripts — ping sweeps, port scans, banner grabbing, DNS enumeration, HTTP header analysis, subdomain testing and SSL certificate checks. Use them only against networks you own or have explicit written permission to test.
Kali · Network Recon — script list
| Script | Category | What it does |
|---|---|---|
nmap_subprocess_wrapper.py | Network Recon | Runs and parses basic Nmap scans via `subprocess`. |
socket_banner_grabber.py | Network Recon | Low-level socket connection to grab service banners. |
ping_sweep_threaded.py | Network Recon | Multi-threaded ping sweep for subnet host discovery. |
mac_address_vendor.py | Network Recon | OUI-based MAC address vendor lookup (mock dataset). |
local_network_mapper.py | Network Recon | Simulates mapping the devices on a local subnet. |
ping_sweeper.py | Network Recon | Uses `subprocess` to find live hosts across a /24 subnet. |
basic_port_scanner.py | Network Recon | Socket-based TCP scan of common ports. |
banner_grabber.py | Network Recon | Connects to ports and retrieves service banners. |
nmap_xml_parser.py | Network Recon | Extracts open ports and services from Nmap XML output. |
mac_address_vendor_lookup.py | Network Recon | Resolves device vendors from MAC addresses via lookup APIs. |
requests_fuzzer.py | Web Recon | Basic directory fuzzing with the `requests` library. |
subdomain_bruteforce.py | Web Recon | Tests a subdomain wordlist against a target domain. |
http_header_analyzer.py | Web Recon | Extracts server info and security headers. |
robots_txt_parser.py | Web Recon | Fetches and parses disallowed paths from `robots.txt`. |
web_crawler_basic.py | Web Recon | Extracts all `href` links from a webpage. |
http_header_inspector.py | Web Recon | Pulls HTTP headers to fingerprint server versions. |
robots_txt_scraper.py | Web Recon | Downloads and parses `robots.txt` to surface hidden paths. |
subdomain_bruteforcer_mock.py | Web Recon | Wordlist-driven subdomain testing (mock resolver). |
ssl_cert_checker.py | Web Recon | Reads an SSL/TLS certificate's details and expiry date. |
directory_fuzzer_lite.py | Web Recon | Probes common admin/login paths for `200 OK` responses. |
netstat_active_ports.sh | Network Recon | Filters `netstat` output for `LISTEN`-state services. |
ss_monitor.sh | Network Recon | Socket statistics via the `ss` command. |
nmap_fast_scan.sh | Network Recon | Automates a fast-mode Nmap scan against a target. |
route_tracer.sh | Network Recon | Path discovery using `traceroute`. |
arp_table_reader.sh | Network Recon | Formats and displays the local ARP cache. |
quick_nmap_scan.sh | Network Recon | Fast scan of the top 100 common ports. |
full_tcp_syn_scan.sh | Network Recon | Stealthy SYN scan across all 65,535 ports. |
dns_enumeration.sh | Network Recon | Forward and reverse DNS lookup automation. |
arp_discovery.sh | Network Recon | Identifies local devices using ARP requests. |
ssl_cert_checker.sh | Network Recon | Checks SSL certificate expiry and details. |
nmap_quick_scan_wrapper.sh | Enumeration | Automates an Nmap fast scan and writes clean results to a file. |
dns_enum_tool.sh | Enumeration | Extracts A, MX, and TXT records with `host` and `dig`. |
whois_ip_lookup.sh | Enumeration | Runs `whois` across a list of IPs for organisational data. |
ping_sweep_subnet.sh | Enumeration | Simple loop to ping every host in a /24 subnet. |
banner_grabber_netcat.sh | Enumeration | Uses `nc` to connect to a port and grab its banner. |
curl_header_grabber.sh | Web Recon | Fast `curl` one-liner to inspect response headers. |
gobuster_automator.sh | Web Recon | Automates a `gobuster` dir scan with standard wordlists. |
nikto_fast_scan.sh | Web Recon | Wrapper to run the Nikto web scanner. |
wget_mirror.sh | Web Recon | Downloads and mirrors a basic website. |
whois_dns_lookup.sh | Web Recon | Combines `whois`, `dig`, and `nslookup` for full target info. |
Code samples
nmap_fast_scan.sh — automate a fast Nmap scan
#!/bin/bash
# nmap_fast_scan.sh
# Concept: Automating a fast Nmap scan via Bash
TARGET=$1
if [ -z "$TARGET" ]; then
echo "Usage: $0 <target_ip>"
exit 0
fi
echo "[*] Initializing fast scan on $TARGET..."
echo "[*] Command: nmap -F $TARGET"
# -F scans top 100 ports
nmap -F "$TARGET"
echo "[+] Fast scan finalized."
ping_sweep_threaded.py — threaded ping sweep
#!/usr/bin/env python3
import subprocess
import threading
from queue import Queue
# ping_sweep_threaded.py
# Concept: Using Multi-threading to speed up network reconnaissance
# Thread-safe queue to hold IP addresses
queue = Queue()
def pinger():
while True:
# Get an IP from the queue
ip = queue.get()
if ip is None:
break
# Run ping command (1 packet, 1 second timeout)
# On Windows it's 'ping -n 1', on Linux it's 'ping -c 1'
# We assume a Linux environment (Kali)
try:
res = subprocess.run(['ping', '-c', '1', '-W', '1', ip],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
if res.returncode == 0:
print(f"[+] {ip} is UP")
except Exception:
pass
queue.task_done()
def start_sweep(subnet):
print(f"[*] Starting threaded ping sweep on {subnet}.0/24...")
# Spawn 50 worker threads
for _ in range(50):
t = threading.Thread(target=pinger)
t.daemon = True
t.start()
# Add IPs 1-254 to the queue
for i in range(1, 255):
queue.put(f"{subnet}.{i}")
queue.join()
print("[*] Sweep complete.")
if __name__ == "__main__":
import sys
if "-h" in sys.argv or "--help" in sys.argv:
print("Usage: python3 ping_sweep_threaded.py")
print("Threaded ping sweep of a /24 subnet (interactive prompt).")
sys.exit(0)
base_ip = input("Enter first three octets (e.g., 192.168.1): ") or "192.168.1"
start_sweep(base_ip)
# Stop the threads
for _ in range(50):
queue.put(None)