Windows Privilege Escalation
Here are some techniques for achieving privilege escalation on Windows systems:
Abusing SSH keys
Check if we have reading permissions on the SSH private keys of a user
Copy the keys to a file, assign permissions to the file, and use it to log in using the key
When having writing permissions on the
.ssh/
directory of a user, we can generate an SSH key with the current user and pass it to the system
Pass the public key to the authorized keys file of the root user
Use this to log in to the user using the key
Abusing .bat files with full control permissions
In the situation where a .bat file (script file for Windows) is being executed on the system and it has full-control permissions, it's possible to abuse this to modify the content of the .bat file and execute commands with privileges arbitrarily
Try spawning a PowerShell from the CMD with any user we have access
Find a .bat file, and check if it has full-control permissions. In case it has, check if it is calling any process and if any of them is still running
Download and import a Netcat executable for Windows
Set Netcat listener to catch the connection and replace the content of the .bat file with a command spawning the Netcat executable
Last updated
Was this helpful?