1
0
Fork 0

add a function to scan for open ports

This commit is contained in:
Pratham Patel 2024-01-26 15:34:24 +05:30
parent 1297284712
commit 01d8ab7d28
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
1 changed files with 8 additions and 0 deletions

View File

@ -52,6 +52,14 @@ path_add "${HOME}/.cargo/bin"
path_add "${HOME}/.local/bin"
export PATH
function list_open_ports() {
if [[ -n "$1" ]]; then
nc -z -v "$1" 1-65535 2>&1 | grep -v 'Connection refused'
else
echo 'Please provide an [IP] address.'
fi
}
# alias wrappers to call scripts
SCRIPTS_DIR="${HOME}/.local/scripts/other-common-scripts"
alias debextract="${SCRIPTS_DIR}/extract-deb-pkg.sh"