netstat
,ss
Last active
June 21, 2019 11:51
-
-
Save masdeseiscaracteres/64ee182aa8f18beee7cf225bed081f1b to your computer and use it in GitHub Desktop.
UNIX tricks
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
#!/usr/bin/env bash | |
# DNS lookup in Bash without "host", "dig" or "nslookup" | |
[[ $# -ne 1 ]] && echo "Please provide host name" && return 1 | |
HOST="$1" | |
getent hosts $HOST |
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
#!/usr/bin/env bash | |
# Port scan in Bash (without sudo, nmap or nc) | |
[[ $# -ne 2 ]] && echo "Please provide server name and port" && return 1 | |
SERVER="$1" | |
PORT="$2" | |
(echo > /dev/tcp/$SERVER/$PORT) >& /dev/null && echo "Port $PORT seems to be open in server $SERVER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment