githubEdit

creds

Credentials hunting on linux

#credentialhunt

Find config files

for l in $(echo ".conf .config .cnf");do echo -e "\nFile extension: " $l; find / -name *$l 2>/dev/null |grep -v "lib\|fonts\|share\|core"; done

Find credentials in config files

for i in $(find / -name *.cnf 2>/dev/null |grep -v "doc\|lib");do echo -e "\nFile: " $i; grep "user\|password\|passwd\|pass" $i 2>/dev/null |grep -v "\#";done

Find database files

for i in $(echo ".sql .db .*db .db*");do echo -e "\nDB File extension: " $l; find / -name *$l 2>/dev/null | grep -v "doc\|lib\|headers\|share\|man";done

Find notes

find /home/* -type f -name "*.txt" -o ! -name "*.*"

Find scripts

for i in $(echo ".py .pyc .pl .go .jar .c .sh");do echo -e "\nFile extension: " $l; find / -name *$l 2>/dev/null | grep -v "doc\|lib\|headers\|share";done

Cronjobs

cat /etc/crontab
ls -la /etc/cron.*/

Find SSH keys

  • Private keys:

  • Public keys:

bash history check

Logs check

Memory and cache check for credentials

Firefox stored credentials (web credentials)

Tool:

Manual:


Hunt for protected files/data

find protected files

find ssh keys

find for encrypted ssh keys

Cracking

  • MS office documents - office2john

  • SSH - ssh2john

  • PDF - pdf2john

  • Bitlocker encryption (.vhd) - bitlocker2john

List of all file Extensions

Cracking OPENSSL archives/files

Bitlocker encryption

Last updated