Skip to content

Instantly share code, notes, and snippets.

@vkroz
Last active November 8, 2016 00:37
Show Gist options
  • Save vkroz/1127ebb51cb632eae111 to your computer and use it in GitHub Desktop.
Save vkroz/1127ebb51cb632eae111 to your computer and use it in GitHub Desktop.

Collection of Linux tools to deal with network issues

# nmap - Network exploration tool and security / port scanner
# ----------------------------------------------------------------------------
# List ports in use
nmap localhost
nmap 192.168.11.22
# endless loop
watch -n1 'sudo netstat -taupn'
# Netcat is a simple Unix utility which reads and writes data across network connections
# ----------------------------------------------------------------------------
# Test if a port on a remote system is reachable
# Will output 0 if port 123 is open, and 1 if it's closed.
nc 127.0.0.1 123 < /dev/null; echo $?
# Send arbitrary string to remote connection
echo "<13>1 - - - - [b9d9a9c4-11d5-4b15-844f-c7d0e4353983@41058] `date` This is the heartbeat message" | netcat -q 1 targethost 514
echo "<13>1 - - - - [b9d9a9c4-11d5-4b15-844f-c7d0e4353983@41058] `date` ping" | nc -vv -w 4 targethost 514
# Connectting to office VPN
ssh-add ~/.ssh/id_rsa
ssh -A [email protected]
# Other useful stuff
wireshark
tcpdump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment