byt3bl33d3r / CrackMapExec

A swiss army knife for pentesting networks
BSD 2-Clause "Simplified" License
8.35k stars 1.64k forks source link

Ported reg.py from Impacket to CME #762

Closed Bebzounette closed 1 year ago

Bebzounette commented 1 year ago

Ported reg.py from Impacket to CME to add, delete, modify and query registry keys remotely. Can be useful to POC "CachedCredentialCount" on workstations or servers, for example.

Request registry key : poetry run cme smb <IP> -d <DOMAIN> -u <USER> -p <PASS> -M reg-query -o path='HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' key="CachedLogonsCount"

Modify registry key : poetry run cme smb <IP> -d <DOMAIN> -u <USER> -p <PASS> -M reg-query -o path='HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' key="CachedLogonsCount" value="5"

Delete registry key : poetry run cme smb <IP> -d <DOMAIN> -u <USER> -p <PASS> -M reg-query -o path='HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' key="CachedLogonsCount2" delete=true

cme_module
mpgn commented 1 year ago

Thanks for the PR, the pr is now merged on the last official repository of CrackMapExec

https://github.com/mpgn/CrackMapExec/commit/6c8edf2b7c35aa564aee7653a690f9518612fe24

Send me a DM on twitter to get your coin :)