Created
September 1, 2023 18:44
-
-
Save YSaxon/73c54057aa3f7fe128b88bf4efe680f2 to your computer and use it in GitHub Desktop.
get hostnames currently communicating with
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
netstat -an | awk '{if ($5 ~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/) print $5}' | cut -d. -f1-4 | sort -u | while read -r line; do host $line; done | grep pointer | awk '{print $NF}' | sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment