On Windows
After we gain access to the target windows machine, we can move on to hunting for credential on system.
Key Terms to Search for
| | |
---|
Passwords | Passphrases | Keys |
Username | User account | Creds |
Users | Passkeys | Passphrases |
configuration | dbcredential | dbpassword |
pwd | Login | Credentials |
Methods
Use Windows Search to find files with keywords.
Lazagne.exe
Searches for creds on browsers or installed applications.
findstr
References
On Linux
Files to look for:
| | |
---|
Configuration files | Databases | Notes |
Scripts | Cronjobs | SSH keys |
Conf files
Search for configuration files on the system:
Search for keywords (user, password,pass) inside the found configuration files:
DB Files
Search for database files on the system:
Notes
Search for Notes on the system:
Scripts
Look for different scripts on the system:
Cronjobs
Cronjobs are located at /etc/crontab.
ls -la /etc/cron.*
SSH Keys
SSH Keys can be named arbitrarily but the format is always unique, especially the first line.
Private Keys
Public Keys
History
Files such as .bash_history
, .bashrc
, ,bash_profile
.
Logs
Log File | Description |
---|
/var/log/messages | Generic system activity logs. |
/var/log/syslog | Generic system activity logs. |
/var/log/auth.log | (Debian) All authentication related logs. |
/var/log/secure | (RedHat/CentOS) All authentication related logs. |
/var/log/boot.log | Booting information. |
/var/log/dmesg | Hardware and drivers related information and logs. |
/var/log/kern.log | Kernel related warnings, errors and logs. |
/var/log/faillog | Failed login attempts. |
/var/log/cron | Information related to cron jobs. |
/var/log/mail.log | All mail server related logs. |
/var/log/httpd | All Apache related logs. |
/var/log/mysqld.log | All MySQL server related logs. |
Memory and Cache
Many applications and processes needs creds for authentication.
We can use mimipenguinto retrieve this type of credentials.
Even more powerful tool is LaZagne.
Browsers
For Firefox, credentials are in logins.json.
We can use Firefox Decryptto decrypt firefox credentials.
We can use LaZagne as well: