Skip to content

Instantly share code, notes, and snippets.

@aryelgois
Created May 3, 2024 22:05
Show Gist options
  • Save aryelgois/07b99e50abe7587d2c6410a09ae1cbe2 to your computer and use it in GitHub Desktop.
Save aryelgois/07b99e50abe7587d2c6410a09ae1cbe2 to your computer and use it in GitHub Desktop.
nmap local: LAN / WLAN
#!/bin/sh
set -eu
inet=$(ip -br -4 address | grep ' UP ' | awk 'NR==1{print $3}')
if [ -n "$inet" ]
then echo "Scanning $inet"
else >&2 echo "inet not found"; exit 1
fi
nmap "$@" "$inet" | GREP_COLORS='ms=1;97' grep --color=always -e ^ -e '^Nmap scan.*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment