SlideShare a Scribd company logo
Unquoted Service Path exploitation
By Dhruv Sharma
Introduction
• This exploitation technique is used to perform Privilege Escalation from non admin / non Root
user to System / Admin user. We will exploit unquoted service path for the services.
• Used with Windows Operating System.
• Services running on the server can be:
• Unquoted
• Quoted
Introduction
Are all unquoted service path are vulnerable ?
• A: No. If there are no spaces in the name of the directory i.e.
ProgramFiles [non vulnerable] || Program Files [vulnerable]
Service Path: C:Program FilesA SubfolderB SubfolderC SubfolderSomeExecutable.exe
In order to run SomeExecutable.exe, the system will interpret this path in the following order from
1 to 5.
Step 1: C:Program.exe
Step 2: C:Program FilesA.exe
Step 3: C:Program FilesA SubfolderB.exe
Step 4: C:Program FilesA SubfolderB SubfolderC.exe
Step 5: C:Program FilesA SubfolderB SubfolderC SubfolderSomeExecutable.exe
If C:Program.exe is not found, then C:Program FilesA.exe would be executed. If C:Program
FilesA.exe is not found, then C:Program FilesA SubfolderB.exe would be executed and so on.
Tips
• Use below script to search for vulnerable services:
wmic service get name,pathname,displayname,startmode | findstr /i auto | findstr /i /v
"C:Windows" | findstr /i /v ""“
• Service name = Some Vulnerable Service.
• Path name = C:Program FilesA SubfolderB SubfolderC SubfolderSomeExecutable.exe
• Display name = Some Vulnerable Service
• Start mode = Auto
Lab Demo
• Step 1: We ran our command to find out any possible vulnerable services. Only
last 3 services are not quoted – Some Vulnerable services, Babi Service & myBabi
Service.
Lab Demo
• Check the services. This service is configured for Auto Start, which
means it will try to automatically started after reboot.
Lab Demo
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/set-service?view=powershell-7
Lab Demo
• Step 2: In this case we will try to exploit it. Let’s check if our user has
privileges. The folder has Write privileges, which is inherited from the
parent folder.
Lab Demo
• Step 3: We analyzed the directory and placed babi.exe (reverse shell
payload) as shown below.
Lab Demo
• Finally we start to run the application. It is not important for us to run
the service, but going through the path is important.
Create your own vulnerable Service
• Create your own service for dhruv.exe
• Provide write access to Dhruv Sharma directory
icacls "C:Program FilesA Subfolder" /grant "BUILTINUsers":(F) /t [full access]
icacls "C:Program FilesA Subfolder" /grant "BUILTINUsers":W [write access]
References
• https://medium.com/@SumitVerma101/windows-privilege-
escalation-part-1-unquoted-service-path-c7a011a8d8ae
Unquoted service path exploitation

More Related Content

PPTX
Introduce anypoint studio
PPTX
Anypoint mq acknowledgement mode
PPTX
Running mule as worker role on azure
PPTX
Troubleshooting mule
PPTX
Mule tcat server - common problems and solutions
PPTX
Using maven with mule
PPTX
Konstantinos Sidiropoulos - Testing microservices a real example
PPTX
Configuring Anypoint Studio MQ connector
Introduce anypoint studio
Anypoint mq acknowledgement mode
Running mule as worker role on azure
Troubleshooting mule
Mule tcat server - common problems and solutions
Using maven with mule
Konstantinos Sidiropoulos - Testing microservices a real example
Configuring Anypoint Studio MQ connector

What's hot (20)

ODP
Webservice performance testing with SoapUI
PPT
Less02 2 e_testermodule_1
PPTX
Invoke component demo in mule
PPTX
PPTX
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
PPT
ALP. Short facts
PPTX
Logger
PPTX
Hybrid automation framework
PDF
POST/CON 2019 Workshop: Experts
PPTX
Python component in mule
ODP
Accelerate Quality with Postman Advance
PPTX
Programming and the web for beginners
PPTX
Mule
PDF
Deployment automation framework with selenium
PPT
Used Java Component To Access Flow and Session Vars
PDF
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
PPT
Ppt of soap ui
PPT
Selenium
ODP
Apache JMeter Introduction
PPTX
Solution about automating end to end server test
Webservice performance testing with SoapUI
Less02 2 e_testermodule_1
Invoke component demo in mule
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
ALP. Short facts
Logger
Hybrid automation framework
POST/CON 2019 Workshop: Experts
Python component in mule
Accelerate Quality with Postman Advance
Programming and the web for beginners
Mule
Deployment automation framework with selenium
Used Java Component To Access Flow and Session Vars
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
Ppt of soap ui
Selenium
Apache JMeter Introduction
Solution about automating end to end server test
Ad

Similar to Unquoted service path exploitation (20)

PPTX
SE-Unit 4_software testing stretagy.pptx
PDF
Si fa presto a dire serverless
PPTX
sst ppt.pptx
DOC
Components lab
PPT
Software Testing
PPTX
mini proj_batch1.pptx online secure file transfer system
PDF
Testing - How Vital and How Easy to use
PPT
Software testing & its technology
DOC
Components lab
PPTX
SOFTWARE TESTINg ghhhhhhhgggggfdhnhhjjju
PDF
Performancetestingjmeter 121109061704-phpapp02
PPTX
Selenium Training in Chennai
PDF
Manual testing by reddy
PPTX
ST Unit-3.pptx
PPTX
Windows privilege escalation
PPTX
Windows privilege escalation by Dhruv Shah
PDF
Laravel Load Testing: Strategies and Tools
SE-Unit 4_software testing stretagy.pptx
Si fa presto a dire serverless
sst ppt.pptx
Components lab
Software Testing
mini proj_batch1.pptx online secure file transfer system
Testing - How Vital and How Easy to use
Software testing & its technology
Components lab
SOFTWARE TESTINg ghhhhhhhgggggfdhnhhjjju
Performancetestingjmeter 121109061704-phpapp02
Selenium Training in Chennai
Manual testing by reddy
ST Unit-3.pptx
Windows privilege escalation
Windows privilege escalation by Dhruv Shah
Laravel Load Testing: Strategies and Tools
Ad

More from Dhruv Sharma (18)

PPTX
RAVPN EAP-IKEv2 VPN.pptx
PPTX
Load Balance with NSX-T.pptx
PPTX
NSX_Troubleshooting.pptx
PPTX
ASA VPN_Certificate authentication_ISE Authorization.pptx
PPTX
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...
PPTX
Routebased-Policybased VPN.pptx
PPTX
Ansible Network Automation session1
PPTX
Setting up Cisco WSA Proxy in Transparent and Explicit Mode
PPTX
Factory setup wsa_9.2_v1.0
PPTX
Tacacs+ with ise 2.4_ CCIE
PPTX
Get vpn multicast for CCIE Security
PPTX
Route tags with OSPF
PPTX
Aci vmware integration_youtube
PPTX
Introduction to nexux from zero to Hero
PPTX
Cisco umbrella youtube
PPTX
GTM vs AWS Route 53 with Cisco umbrella
PPTX
Setting up VPN between F5 LTM & ASA
PPTX
Getting started kali linux
RAVPN EAP-IKEv2 VPN.pptx
Load Balance with NSX-T.pptx
NSX_Troubleshooting.pptx
ASA VPN_Certificate authentication_ISE Authorization.pptx
Setting up CDP (Cisco Discovery Protocol) between Cisco IOS and VMware Virtua...
Routebased-Policybased VPN.pptx
Ansible Network Automation session1
Setting up Cisco WSA Proxy in Transparent and Explicit Mode
Factory setup wsa_9.2_v1.0
Tacacs+ with ise 2.4_ CCIE
Get vpn multicast for CCIE Security
Route tags with OSPF
Aci vmware integration_youtube
Introduction to nexux from zero to Hero
Cisco umbrella youtube
GTM vs AWS Route 53 with Cisco umbrella
Setting up VPN between F5 LTM & ASA
Getting started kali linux

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Approach and Philosophy of On baking technology
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Modernizing your data center with Dell and AMD
PDF
Machine learning based COVID-19 study performance prediction
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Cloud computing and distributed systems.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Approach and Philosophy of On baking technology
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Review of recent advances in non-invasive hemoglobin estimation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Cloud computing and distributed systems.
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...

Unquoted service path exploitation

  • 1. Unquoted Service Path exploitation By Dhruv Sharma
  • 2. Introduction • This exploitation technique is used to perform Privilege Escalation from non admin / non Root user to System / Admin user. We will exploit unquoted service path for the services. • Used with Windows Operating System. • Services running on the server can be: • Unquoted • Quoted
  • 3. Introduction Are all unquoted service path are vulnerable ? • A: No. If there are no spaces in the name of the directory i.e. ProgramFiles [non vulnerable] || Program Files [vulnerable] Service Path: C:Program FilesA SubfolderB SubfolderC SubfolderSomeExecutable.exe In order to run SomeExecutable.exe, the system will interpret this path in the following order from 1 to 5. Step 1: C:Program.exe Step 2: C:Program FilesA.exe Step 3: C:Program FilesA SubfolderB.exe Step 4: C:Program FilesA SubfolderB SubfolderC.exe Step 5: C:Program FilesA SubfolderB SubfolderC SubfolderSomeExecutable.exe If C:Program.exe is not found, then C:Program FilesA.exe would be executed. If C:Program FilesA.exe is not found, then C:Program FilesA SubfolderB.exe would be executed and so on.
  • 4. Tips • Use below script to search for vulnerable services: wmic service get name,pathname,displayname,startmode | findstr /i auto | findstr /i /v "C:Windows" | findstr /i /v ""“ • Service name = Some Vulnerable Service. • Path name = C:Program FilesA SubfolderB SubfolderC SubfolderSomeExecutable.exe • Display name = Some Vulnerable Service • Start mode = Auto
  • 5. Lab Demo • Step 1: We ran our command to find out any possible vulnerable services. Only last 3 services are not quoted – Some Vulnerable services, Babi Service & myBabi Service.
  • 6. Lab Demo • Check the services. This service is configured for Auto Start, which means it will try to automatically started after reboot.
  • 8. Lab Demo • Step 2: In this case we will try to exploit it. Let’s check if our user has privileges. The folder has Write privileges, which is inherited from the parent folder.
  • 9. Lab Demo • Step 3: We analyzed the directory and placed babi.exe (reverse shell payload) as shown below.
  • 10. Lab Demo • Finally we start to run the application. It is not important for us to run the service, but going through the path is important.
  • 11. Create your own vulnerable Service • Create your own service for dhruv.exe • Provide write access to Dhruv Sharma directory icacls "C:Program FilesA Subfolder" /grant "BUILTINUsers":(F) /t [full access] icacls "C:Program FilesA Subfolder" /grant "BUILTINUsers":W [write access]