π Kali Linux 101
export ip=xx.xx.xx.xx
cat $iplocate filename
find / -name namefile\* 2>/dev/nullgunzip access.log.gz //gz file
unzip access.zip //zip file
tar -xzvf file.tar.gz //gz or tar fileGet 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
Last updated