Set the Target IP Address to the `$ip` system variable
Find the location of a file
Search through directories in the `$PATH` environment variable
Find a search for a file that contains a specific string in it’s name
Show active internet connections
Verify a service is running and listening
netstat -antp | grep apache
Boot, Start, Stop a service
systemctl enable ssh # Boot
systemctl start ssh # Start
systemctl start apache2 # Start
systemctl stop ssh # Stop
Unzip a gz and tar.gz file
gunzip access.log.gz
tar -xzvf file.tar.gz
Print all files content in a directory
Count number of lines in file
Decode Base64 Encoded Values
echo -n " QWxhZGRpbjpvcGVuIHNlc2FtZQ==" | base64 --decode
Manage Network Interfaces
vi /etc/network/interfaces
> tcpdump -r passwordz.pcap
Display ips and filter and sort
> tcpdump -n -r passwordz.pcap | awk -F" " ' {print $3}' | sort -u | head
Grab a packet capture on port 80
> tcpdump tcp port 80 -w output.pcap -i eth0
Check for ACK or PSH flag set in a TCP packet
> tcpdump -A -n ' tcp[13] = 24' -r passwordz.pcap
Deny traffic to ports except for Local Loopback
> iptables -A INPUT -p tcp --destination-port 13327 ! -d $ip -j DROP
> iptables -A INPUT -p tcp --destination-port 9991 ! -d $ip -j DROP
Clear ALL IPTables firewall rules
> iptables -P INPUT ACCEPT
> iptables -P FORWARD ACCEPT
> iptables -P OUTPUT ACCEPT
> iptables -t nat -F
> iptables -t mangle -F
> iptables -F
> iptables -X
> iptables -t raw -F iptables -t raw -X
Adding a User to the sudoers Files
> adduser < user name> sudo