Username / Password attacks

Identify the hash

You can identify the hash with tools such as:

hash-identifier
hashid <hash>

Get hash type

hashcat --help | grep -i "<INPUT>"

Password list generation

If you have part of password you can generate it's variations using crunch.

You have to specify minimum length, maximum length and pattern.

% = additional generated letter

crunch 6 6 -t <any_word>%%% > wordlist

Regular Brute-Force

You can calculate time needed for cracking the hash using the following method:

  1. Count the total number of possible characters.

  2. Multiple the count from step 1 with password length.

  3. Divide the result by the number of MD5 GPUs, and then by 60 to find how many minutes it will take. (use hashcat -b to benchmark)

After choosing the wordlist we can move on to the Hydra tool which will help us in performing the attack.

SSH

Password Brute Force:

RDP

Username Brute-Force:

HTTP

FAILED_LOGIN_IDENTYFIER is text which shows up on page only when login failed.

Password Brute-Force [POST]:

Password Managers

Search for password managers in windows apps. Once you will identify password manager on the system search for password's manager database file.

KeePass example:

Also look for configuration files:

Transforming the hash into a format our cracking tool can use

Since KeePass uses a master password without any kind of username, we need to remove the "Database:" string with a text editor.

Then we can run hashcat

SSH Private Key

You can bruteforce private keys for ssh using John the Ripper.

Create rule:

Add rule to john config:

Transform id_rsa into hash

Attack:

Rule based attack (Hashcat)

You can find the rules on the Hashcat Wiki: https://hashcat.net/wiki/doku.php?id=rule_based_attack

Add rule to the file with rules:

Show attack preview in hashcat debug mode:

After debug hashcat can be run:

Hashcat mode id: https://hashcat.net/wiki/doku.php?id=example_hashes

NTLM

You can calculate NTLM form user's password: https://www.browserling.com/tools/ntlm-hash

You can dump the NTLM hashes using mimikatz as Administrator when you have SeDebugPrivilege access enabled:

We can also become the SYSTEM with SeImpersonatePrivilege access in order to get access to the hashes.

First we check for SeDebugPrivilege:

We are able to elevate with the following command:

We can extract passwords using the following:

Cracking

Passing

Scan with NetExec / SMBExec [Pass the hash]:

Connecting to the server [Connection]:

Useful commands

NTLMv2

You can get NTLMv2 hashes with responder when the target server reaches to us:

Grab it with this command:

Or using file upload:

Cracking

Relaying

MD5

Also use https://crackstation.net.

Last updated