Last active
November 23, 2022 09:13
-
-
Save diginfo/faac52654ee28992138c431da8383ba4 to your computer and use it in GitHub Desktop.
Do a NS Lookup on all Allow from Anywhere entries in UFW
This file contains 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/bash | |
## bash <(curl -Ls https://gist.github.com/diginfo/faac52654ee28992138c431da8383ba4/raw/) | |
## | |
IPS="$(ufw status | grep Anywhere.*ALLOW | awk '{print $3}')"; | |
while IFS= read -r line; do | |
NS="$(dig +short +nocomments -x $line | tail -1)"; | |
echo -e "$line\t\t: $NS"; | |
done <<< "$IPS"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment