githubEdit

Further Credential Theft

Further Credential Theft

Cmdkey Saved Credentials

Listing Saved Credentials

The cmdkey command can be used to create, list, and delete stored usernames and passwords. Users may wish to store credentials for a specific host or use it to store credentials for terminal services connections to connect to a remote host using Remote Desktop without needing to enter a password.

C:\htb> cmdkey /list

    Target: LegacyGeneric:target=TERMSRV/SQL01
    Type: Generic
    User: inlanefreight\bob

we found credential stored for user call bob to connect on TERMSRV/SQL01

reuse to this credential

PS C:\htb> runas /savecred /user:inlanefreight\bob "COMMAND HERE"

Browser Credentials

Retrieving Saved Credentials from Chrome

Users often store credentials in their browsers for applications that they frequently visit. We can use a tool such as SharpChromearrow-up-right to retrieve cookies and saved logins from Google Chrome.


Password Managers

Many companies provide password managers to their users. This may be in the form of a desktop application such as KeePass, a cloud-based solution such as 1Password, or an enterprise password vault such as Thycotic or CyberArk.

we can use a tool such as keepass2johnarrow-up-right to extract the password hash and run it through a password cracking tool such as Hashcatarrow-up-right or John the Ripperarrow-up-right.

Extracting KeePass Hash

First, we extract the hash in Hashcat format using the keepass2john.py script.

Cracking Hash Offline

Hash mode 13400 for KeePass.


Email

If we gain access to a domain-joined system in the context of a domain user with a Microsoft Exchange inbox, we can attempt to search the user's email for terms such as "pass," "creds," "credentials," etc. using the tool MailSniperarrow-up-right.


More Fun with Credentials

Running All LaZagne Modules

hen all else fails, we can run the LaZagnearrow-up-right tool in an attempt to retrieve credentials from a wide variety of software. Such software includes web browsers, chat clients, databases, email, memory dumps, various sysadmin tools, and internal password storage mechanisms (i.e., Autologon, Credman, DPAPI, LSA secrets, etc.

Running SessionGopher as Current User

We can use SessionGopherarrow-up-right to extract saved PuTTY, WinSCP, FileZilla, SuperPuTTY, and RDP credentials.

Run it with local Administrator


Clear-Text Password Storage in the Registry

Enumerating Autologon with reg.exe

Putty

For Putty sessions utilizing a proxy connection, when the session is saved, the credentials are stored in the registry in clear text.


Wifi Passwords

Viewing Saved Wireless Networks

Retrieving Saved Wireless Passwords