Closed tmpsamsam closed 4 years ago
Summoning @asolino as he might want to take a look at this as well. Thanks for the heads up and yes I do agree CMEv3 should be deprecated. Working on porting everything to python 3 atm and will be releasing a new stable version.
Cheers
The only real difference between v3 and v4 is that CME switched to using the same function that impacket's secretdump.py
uses. Impacket still does this here:
So this might be something that Impacket might want to address as well. Although, from a developer's standpoint, robust error handling might be the easiest way to address this especially in CME's case cause of all the threads and stuff
Closing, the issue seems to be fixed as I don't see any tmp file into system32 folder :) Feel free to reopen if you as this issue again !
All versions of CME < 4.0 are buggy, leave an export of the Windows SAM/LSASecrets registry keys in the following folder: %windir%\system32****.tmp and put a weak DACL.
This security issue appears when the following options are specified : --sam, --lsa and --ntds.
It gives a local user the opportunity to obtain the LM:NT hashes of the local Administrator account (RID 500) and can be used for privilege escalation or lateral movement.
The vulnerable code is in the __retrieveHive function:
The tmpFileName is never removed.
CME 3.1.5 should be deprecated if you don't remove the tmp files. Please upgrade a CrackMapExec release 4.0.
ʕ•̫͡•ʔ ʕ•̫͡•ʔ ʕ•̫͡•ʔ -- tmpsam