Ports Flashcards
FTP
TCP
21 for control
20 for file transfer
SSH
TCP
22
DNS
UDP
TCP 53 for zone transfer
UDP 53 for name resolution queries
Kerberos
88 UDP
POP3
110 TCP
IMAP4
143 TCP
POP Secure
995 TCP
Secure IMAP
993 TCP
SMTP
25 TCP
SMTP-over-TLS
587 TCP
SNMPv3
161, 162 UDP
LDAP
389 TCP
LDAPS
636 TCP
RDP
3389 TCP
NTP
123 UDP
FTPS
989, 990 TCP
SFTP
22 TCP
IPSec
Uses internet key exchange (IKE) over port 500 UDP
TFTP
69 UDP
Ipconfig
Ipconfig /all
Ipconfig /flushdns, flush dns cache
Ipconfig /displaydns, show dns cache
Ifconfig
Ifconfig -a, similar to ipconfig /all
Ifconfig eth0, show conf. eth0
Ifconfig eth0 promisc, enable promisc mode, process all traffic
Ifconfig eth0 allmulti, enable multicast mode, process all multicast traffic
Ifconfig eth0 -allmulti, disable multicase mode
Ip (tool)
Ip link show, show interfaces
Ip link set eth0 up, enable eth0
Ip -s link, show network stats
Netstat
Netstat -a, show all tcp udp ports being listened on
Netstat -r, show routing table
Netstat -e, show network stats
Netstat -s, show net stats for specific protocols
Netstat -n, show addresses and ports in numerical order
Netstat -p protocol, show stats on specific protocol
Netstat, show open TCP connections
You can combine options. E.g netstat -anp tcp
Tracert
Windows
tracert google.com, show hops between system and Google
racert -d google.com, don’t resolve IP addresses to host names, makes command faster
Traceroute
Linux
Traceroute -n google.com, don’t resolve IPs
Pathping
Sends pings to hops on routes. Computes statistics depending on responses to pings.
Pathping -n google.com
If a hop has 100% packet loss. Chances are it is just blocking icmp. If it really is bad, then all other hops from that point on in the path must also be dropping 100%.
Arp
Windows and Linux
Arp, help on windows, arp cache linux
Arp -a google.com, show arp cache entry for specified ip
Arp -a, show entire cache on windows
Journalctl
Linux
Query linux system logging utility called journald.
Journalctl – since “1 hour ago”, show logs only in journals.
Journalctl –list-boots, show boot logs
PTR Record
Pointer record
Opposite of an A record. For when client queries DNS with an IP.
Smb
Tcp
139