Last active
January 4, 2020 02:34
-
-
Save davidlares/f0f118c5af148f2f0b4a7f9485d7bf98 to your computer and use it in GitHub Desktop.
Simple script for checking open ports TCPv4 with Bash
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/bash | |
# this script shows the open network ports on a system | |
# -4 to limit TCP IPv4 ports | |
if [[ "${1}" = '-4' ]] | |
then | |
netstat -nutl ${1} | grep ':' | awk '{print $4}' | awk -F ':' '{print $NF}' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment