Created
March 15, 2019 01:13
-
-
Save abenson/7c33d211752cc9e241b00c9d38bd3a42 to your computer and use it in GitHub Desktop.
"expand_net" wrapper for nmap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SORT="cat" | |
if [ "$1" = "-r" ]; then | |
shift | |
SORT="sort -R" | |
fi | |
if [ -z "$1" ] || [ "$1" = "-h" ]; then | |
echo "usage: $0 <CIDR> [...]" | |
exit | |
fi | |
nmap -sL -oG - -n "$*" | grep Host: | cut -d\ -f2 | $SORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment