mirror of
https://github.com/Heretic312/devsecops-wrappers.git
synced 2025-12-18 02:06:27 +00:00
pingsweep.sh scans networks.txt with nmap, tries TCP pings if ICMP fails, and produces inventory.csv with IP plus method. scan_multi_concurrent.sh Multi-Subnet Scanner that produces a CSV with ip, hostname, mac, vendor.
32 lines
760 B
Bash
32 lines
760 B
Bash
#!/bin/bash
|
|
#
|
|
# ./pingsweep.sh
|
|
#
|
|
# Author: Victor Bishop (Heretic312)
|
|
# Date: 10/31/2025
|
|
#
|
|
# About:
|
|
# This scans networks.txt with Nmap, tries TCP pings if ICMP fails, and produces inventory.csv with IP plus method.
|
|
#
|
|
# Usage:
|
|
# Make a file networks.txt listing each routed subnet you want to scan:
|
|
# 10.0.10.0/24
|
|
# 10.0.20.0/24
|
|
# 192.168.50.0/24
|
|
#
|
|
# Notes:
|
|
# Replace default .txt and .csv names as needed
|
|
nets="networks.txt"
|
|
out="inventory.csv"
|
|
echo "ip,method" > $out
|
|
|
|
# ICMP sweep
|
|
nmap -sn -iL $nets -oG - | awk '/Up$/{print $2",icmp"}' >> $out
|
|
|
|
# TCP fallback for networks with no hits (optional)
|
|
nmap -sn -PS22,80,443 -iL $nets -oG tcpfallback.gnmap
|
|
awk '/Up$/{print $2",tcp"}' tcpfallback.gnmap >> $out
|
|
|
|
# dedupe
|
|
sort -u $out -o $out
|