Skip to content

Instantly share code, notes, and snippets.

@fdocr
Last active December 13, 2018 01:58
Show Gist options
  • Save fdocr/a75a5d5278c90c34b144eac69ba7f408 to your computer and use it in GitHub Desktop.
Save fdocr/a75a5d5278c90c34b144eac69ba7f408 to your computer and use it in GitHub Desktop.
Misc network related terminal commands
# Resolve DNS
nslookup
# List of open internet connections established
# lsof is much more general purpose
lsof -i | grep -E "(LISTEN|ESTABLISHED)"
# Monitor network traffic & connections
nettop
# Spoof MAC Addr with random Addr
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' | xargs sudo ifconfig en0 ether
# Map all IP addresses in local network
# First ping the broadcast address found here
ifconfig | grep broadcast
# And then
arp -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment