Last active
July 10, 2019 16:07
-
-
Save christianromney/a02e40c30f0b93b0cb132fa3d0fd5f8d to your computer and use it in GitHub Desktop.
Who's listening on your machine?
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
#!/usr/bin/env bash | |
echo "The following programs are listening for incoming connections:" | |
lsof -i | grep LISTEN | awk '{print $1}' | sort | uniq | while read x; do | |
printf "%10s \n\t %s" "$x" (psgrep $x | sed 1d | awk '{print $11}' | sort | uniq); printf "\n\n" | |
done |
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
#!/usr/bin/env fish | |
echo "The following programs are listening for incoming connections:" | |
lsof -i | grep LISTEN | awk '{print $1}' | sort | uniq | while read x | |
printf "%10s \n\t %s" "$x" (psgrep $x | sed 1d | awk '{print $11}' | sort | uniq); printf "\n\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment