SlideShare a Scribd company logo
Advanced Penetration Testing Techniques
Using Reverse DNS and WMI
“…unique, blind spots
that cybercriminals
are exploiting…”
Alberto Soliño
Technical Program Management
Ty Miller
Director, Threat Intelligence
AGENDA
Evolving DNS Channel
Agent's Persistency Using WMI Events
Windows WMI Terminology
Sneaks data in and out of an organization
within DNS packets
•  Force internal user machines to:
o  Encapsulate data within DNS packets
o  Send them out via internal DNS servers
o  Then through DMZ DNS relays, and
o  Out to a fake DNS server on the internet
o  Data is then returned in the DNS responses
WHAT IS DNS TUNNELING?
DNS Tunneling can bypass common security
controls:
•  Outbound firewall policies
•  Web Proxies
•  Authentication
•  Web Filtering
WHY DO WE NEED IT?
DNS Tunneling can bypass common security
controls:
•  Reverse Connections Blocked
o  Connect from Target
•  Bind Port Blocked
o  Connect to Target
•  HTTP(S) Tunneling Blocked
•  DNS Tunneling bypasses these controls
WHEN SHOULD WE USE IT?
FAKE DNS SERVER!
!
ATTACKER!
!
VICTIM!
!
DNS RELAY!
!
AUTHENTICATED !
PROXY SERVER WITH
WEB FILTERING!
!
INTERNAL DNS SERVER!
!
FAKE DNS SERVER!
!
AUTHENTICATED !
PROXY SERVER WITH
WEB FILTERING!
!
INTERNAL DNS SERVER!
!
AGENT!
!
ATTACKER!
!
VICTIM!
!
DNS RELAY!
!
FAKE DNS SERVER!
!
AUTHENTICATED !
PROXY SERVER WITH
WEB FILTERING!
!
INTERNAL DNS SERVER!
!
AGENT!
!
ATTACKER!
!
VICTIM!
!
DNS RELAY!
!
FAKE DNS SERVER!
!
DNS RELAY!
!
AUTHENTICATED !
PROXY SERVER WITH
WEB FILTERING!
!
INTERNAL DNS SERVER!
!
AGENT!
!
ATTACKER!
!
VICTIM!
!
WINDOWS WMI TERMINOLOGY
Windows Management Instrumentation
•  Microsoft’s enterprise management framework
•  Available since NT4, default since Windows XP
•  Allows admin to administer all server’s configuration remotely
o  protocols: DCOM and WinRM
•  Accessible programmatically or by utilities
o  wmic, powershell, etc
•  Managed components are represented as WMI objects
o  Win32_Process, Win32_Service
•  Objects are queried using a SQL like language called WQL
o  SELECT ProcessId, Name from Win32_Process
•  Actions are represented as WMI object’s methods
o  Win32_Process.Create()
WINDOWS WMI–CORE IMPACT PRO
Modules
•  WMI Shell
•  Install Agent using WMI
•  Create persisted agent using WMI
•  Remove WMI persistence
Programmatically (Python)
•  Impacket (https://github.com/CoreSecurity/impacket)
ABOUT WMI EVENTS
“They start when the computer starts, and they stop when the computer
shuts down. When the permanent event consumer is running, nothing
indicates that it is actually doing so. There is no special process visible
in Task Manager, and no graphical user interface is exposed. Permanent
event consumers are part of WMI and therefore they require no special
setup, nor do they require special installation. They are used by many
management applications and therefore you can have one or more
permanent event consumers already setup and responding to events
on your computer.” (*)
*http://blogs.technet.com/b/heyscriptingguy/archive/2010/12/06/learn-how-to-use-vbscript-to-create-permanent-wmi-events.aspx
HOW TO BUILD A PERMANMENT EVENT
Create a WMI __EventFilter or __IntervalTimerInstruction instance
(the condition):
•  Example 1: trigger this event when ‘calc.exe’ is executed
•  Example 2: trigger this event every 10 seconds
Create a WMI __EventConsumer instance (what to do)
•  Example1: ActiveScriptEventConsumer will execute VBScript that
creates a file in ‘c:’
Create a WMI __FilterToConsumerBinding instance (the bind)
•  Will bind the two created instances. Whenever the __EventFilter /
__IntervalTimerInstruction is trigged, the EventConsumer will be called
TESTING AND DETECTION
Testing
•  Core Impact Pro 2015 R1 agent’s persistency supports WMI
Detection
•  Manually using wmic.exe:
o  wmic.exe /namespace:rootsubscription PATH __EventConsumer get /format:list
o  wmic.exe /namespace:rootsubscription PATH __EventFilter get /format:list
o  wmic.exe /namespace:rootsubscription PATH __TimerInstruction get /format:list
o  wmic.exe /namespace:rootsubscription PATH __FilterToConsumerBinding get /
format:list
•  Some AVs starting to monitor these WMI objects
•  Mark Russinovich’s AutoRuns for Windows
Thank you! Now, it’s time for Q&A.
TY MILLER. @tyronmiller
@coresecurity I blog.coresecurity.com I www.coresecurity.com
ALBERTO SOLIÑO. @agsolino
ty.miller@threatintelligence.com I www.threatintelligence.com
•  Multi-Threat Surface
Investigation
•  Commercial-Grade
Framework
•  Custom Reports & Results
•  Security Awareness &
Evidence
•  Remediation Validation
WEB Test for OWASP Top 10 web application vulnerabilities
WI-FI Fake access point functionality for man-in-the-middle attacks
MOBILE Mobile device exploitation modules including Android Agent
ENDPOINT Test end-user awareness for phishing and social engineering
MULTI-VECTOR ATTACKS
NETWORK Pivot across networks using vulnerable systems

More Related Content

PPTX
Windows Operating System Archaeology
PPTX
Bridging the Gap: Lessons in Adversarial Tradecraft
PPTX
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
PPT
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
PPTX
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
PPTX
BlueHat v17 || Securing Windows Defender Application Guard
PPTX
Basics about IP address, DNS and DHCP.
PPT
Domain Name Server
Windows Operating System Archaeology
Bridging the Gap: Lessons in Adversarial Tradecraft
“_____ Is Not a Security Boundary: Things I Have Learned and Things That Have...
BlueHat v17 || Out of the Truman Show: VM Escape in VMware Gracefully
BlueHat v17 || All Your Cloud Are Belong to Us; Hunting Compromise in Azure
BlueHat v17 || Securing Windows Defender Application Guard
Basics about IP address, DNS and DHCP.
Domain Name Server

Similar to Advanced Pen Testing Techniques-DNS-WMI (20)

PPT
WMI - A FRONT DOOR FOR MALWARES
PPTX
WMI for Penetration Testers - Arcticcon 2017
PDF
Detecting WMI Exploitation v1.1
PDF
Secure Application Development in the Age of Continuous Delivery
PPTX
Secure Application Development in the Age of Continuous Delivery
PPT
Protecting Your organization from WannaCry Ransomware
PPTX
Building Better Backdoors with WMI - DerbyCon 2017
PDF
Windows Autopilot - Workplace Nijna Summmit 2020
PDF
how-to-bypass-AM-PPL
PPTX
Best practices to secure Windows10 with already included features
PDF
Cloud adoption fails - 5 ways deployments go wrong and 5 solutions
PDF
Derbycon 2017: Hunting Lateral Movement For Fun & Profit
PDF
Malware Detection With Multiple Features
PDF
SANS Threat Hunting Summit 2018 - Hunting Lateral Movement with Windows Event...
PPTX
Securing Application Deployments in CI/CD Environments (Updated slides: http:...
PDF
How to measure your security response readiness?
PPTX
Securing your Cloud Environment v2
PPTX
How to Get the​ Fastest Possible ​Citrix Logon Times​? Optimization Tips for ...
PPTX
How to detect side channel attacks in cloud infrastructures
PPT
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
WMI - A FRONT DOOR FOR MALWARES
WMI for Penetration Testers - Arcticcon 2017
Detecting WMI Exploitation v1.1
Secure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous Delivery
Protecting Your organization from WannaCry Ransomware
Building Better Backdoors with WMI - DerbyCon 2017
Windows Autopilot - Workplace Nijna Summmit 2020
how-to-bypass-AM-PPL
Best practices to secure Windows10 with already included features
Cloud adoption fails - 5 ways deployments go wrong and 5 solutions
Derbycon 2017: Hunting Lateral Movement For Fun & Profit
Malware Detection With Multiple Features
SANS Threat Hunting Summit 2018 - Hunting Lateral Movement with Windows Event...
Securing Application Deployments in CI/CD Environments (Updated slides: http:...
How to measure your security response readiness?
Securing your Cloud Environment v2
How to Get the​ Fastest Possible ​Citrix Logon Times​? Optimization Tips for ...
How to detect side channel attacks in cloud infrastructures
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
Ad

More from Core Security (20)

PDF
How to Solve the Top 3 Struggles with Identity Governance and Administration ...
PPTX
Lazy Penetration Tester Tricks
PDF
Thanks for All the Phish: Introducing Core Impact 18.1
PDF
Identity + Security: Welcome to Your New Career
PDF
Put Analytics And Automation At The Core Of Security – Joseph Blankenship – S...
PDF
No More SIlos: Connected Security - Mike Desai and Ryan Rowcliffe
PDF
Modern Authentication – Turn a Losing Battle into a Winning Strategy, Robert ...
PDF
Security Consulting Services - Which Is The Best Option For Me? - Diego Sor, ...
PDF
Threat Dissection - Alberto Soliño Testa Research Director, Core Security
PDF
How to Defeat the Vulnerability Hydra - Andy Nickel Sales Engineer, Core Secu...
PDF
Understanding Network Insight Integrations to Automate Containment and Kick S...
PDF
Product Vision - Stephen Newman – SecureAuth+Core Security
PDF
The Good, the Bad, and The Not So Bad: Tracking Threat Operators with Our Thr...
PDF
Introducing Core Role Designer - Michael Marks Product Manager - Identity, Co...
PDF
Core Connector API Demo - Michael Marks Product Manager - Identity, Core Secu...
PDF
Access Assurance Suite Tips & Tricks - Lisa Lombardo Principal Architect Iden...
PDF
The Why - Keith Graham, CTO – SecureAuth+Core Security
PDF
Vulnerability Insight Tips & Tricks - Magno Gomes SE Manager, Core Security
PDF
Network Insight: How To Assess Findings - Tier 1 SOC Triage - Mark Gilbert ,T...
PPTX
10 IT Security Trends to Watch for in 2016
How to Solve the Top 3 Struggles with Identity Governance and Administration ...
Lazy Penetration Tester Tricks
Thanks for All the Phish: Introducing Core Impact 18.1
Identity + Security: Welcome to Your New Career
Put Analytics And Automation At The Core Of Security – Joseph Blankenship – S...
No More SIlos: Connected Security - Mike Desai and Ryan Rowcliffe
Modern Authentication – Turn a Losing Battle into a Winning Strategy, Robert ...
Security Consulting Services - Which Is The Best Option For Me? - Diego Sor, ...
Threat Dissection - Alberto Soliño Testa Research Director, Core Security
How to Defeat the Vulnerability Hydra - Andy Nickel Sales Engineer, Core Secu...
Understanding Network Insight Integrations to Automate Containment and Kick S...
Product Vision - Stephen Newman – SecureAuth+Core Security
The Good, the Bad, and The Not So Bad: Tracking Threat Operators with Our Thr...
Introducing Core Role Designer - Michael Marks Product Manager - Identity, Co...
Core Connector API Demo - Michael Marks Product Manager - Identity, Core Secu...
Access Assurance Suite Tips & Tricks - Lisa Lombardo Principal Architect Iden...
The Why - Keith Graham, CTO – SecureAuth+Core Security
Vulnerability Insight Tips & Tricks - Magno Gomes SE Manager, Core Security
Network Insight: How To Assess Findings - Tier 1 SOC Triage - Mark Gilbert ,T...
10 IT Security Trends to Watch for in 2016
Ad

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
“AI and Expert System Decision Support & Business Intelligence Systems”
Dropbox Q2 2025 Financial Results & Investor Presentation
Programs and apps: productivity, graphics, security and other tools
sap open course for s4hana steps from ECC to s4
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation
20250228 LYD VKU AI Blended-Learning.pptx
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A comparative analysis of optical character recognition models for extracting...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Network Security Unit 5.pdf for BCA BBA.

Advanced Pen Testing Techniques-DNS-WMI

  • 1. Advanced Penetration Testing Techniques Using Reverse DNS and WMI
  • 2. “…unique, blind spots that cybercriminals are exploiting…” Alberto Soliño Technical Program Management Ty Miller Director, Threat Intelligence
  • 3. AGENDA Evolving DNS Channel Agent's Persistency Using WMI Events Windows WMI Terminology
  • 4. Sneaks data in and out of an organization within DNS packets •  Force internal user machines to: o  Encapsulate data within DNS packets o  Send them out via internal DNS servers o  Then through DMZ DNS relays, and o  Out to a fake DNS server on the internet o  Data is then returned in the DNS responses WHAT IS DNS TUNNELING?
  • 5. DNS Tunneling can bypass common security controls: •  Outbound firewall policies •  Web Proxies •  Authentication •  Web Filtering WHY DO WE NEED IT?
  • 6. DNS Tunneling can bypass common security controls: •  Reverse Connections Blocked o  Connect from Target •  Bind Port Blocked o  Connect to Target •  HTTP(S) Tunneling Blocked •  DNS Tunneling bypasses these controls WHEN SHOULD WE USE IT?
  • 7. FAKE DNS SERVER! ! ATTACKER! ! VICTIM! ! DNS RELAY! ! AUTHENTICATED ! PROXY SERVER WITH WEB FILTERING! ! INTERNAL DNS SERVER! !
  • 8. FAKE DNS SERVER! ! AUTHENTICATED ! PROXY SERVER WITH WEB FILTERING! ! INTERNAL DNS SERVER! ! AGENT! ! ATTACKER! ! VICTIM! ! DNS RELAY! !
  • 9. FAKE DNS SERVER! ! AUTHENTICATED ! PROXY SERVER WITH WEB FILTERING! ! INTERNAL DNS SERVER! ! AGENT! ! ATTACKER! ! VICTIM! ! DNS RELAY! !
  • 10. FAKE DNS SERVER! ! DNS RELAY! ! AUTHENTICATED ! PROXY SERVER WITH WEB FILTERING! ! INTERNAL DNS SERVER! ! AGENT! ! ATTACKER! ! VICTIM! !
  • 11. WINDOWS WMI TERMINOLOGY Windows Management Instrumentation •  Microsoft’s enterprise management framework •  Available since NT4, default since Windows XP •  Allows admin to administer all server’s configuration remotely o  protocols: DCOM and WinRM •  Accessible programmatically or by utilities o  wmic, powershell, etc •  Managed components are represented as WMI objects o  Win32_Process, Win32_Service •  Objects are queried using a SQL like language called WQL o  SELECT ProcessId, Name from Win32_Process •  Actions are represented as WMI object’s methods o  Win32_Process.Create()
  • 12. WINDOWS WMI–CORE IMPACT PRO Modules •  WMI Shell •  Install Agent using WMI •  Create persisted agent using WMI •  Remove WMI persistence Programmatically (Python) •  Impacket (https://github.com/CoreSecurity/impacket)
  • 13. ABOUT WMI EVENTS “They start when the computer starts, and they stop when the computer shuts down. When the permanent event consumer is running, nothing indicates that it is actually doing so. There is no special process visible in Task Manager, and no graphical user interface is exposed. Permanent event consumers are part of WMI and therefore they require no special setup, nor do they require special installation. They are used by many management applications and therefore you can have one or more permanent event consumers already setup and responding to events on your computer.” (*) *http://blogs.technet.com/b/heyscriptingguy/archive/2010/12/06/learn-how-to-use-vbscript-to-create-permanent-wmi-events.aspx
  • 14. HOW TO BUILD A PERMANMENT EVENT Create a WMI __EventFilter or __IntervalTimerInstruction instance (the condition): •  Example 1: trigger this event when ‘calc.exe’ is executed •  Example 2: trigger this event every 10 seconds Create a WMI __EventConsumer instance (what to do) •  Example1: ActiveScriptEventConsumer will execute VBScript that creates a file in ‘c:’ Create a WMI __FilterToConsumerBinding instance (the bind) •  Will bind the two created instances. Whenever the __EventFilter / __IntervalTimerInstruction is trigged, the EventConsumer will be called
  • 15. TESTING AND DETECTION Testing •  Core Impact Pro 2015 R1 agent’s persistency supports WMI Detection •  Manually using wmic.exe: o  wmic.exe /namespace:rootsubscription PATH __EventConsumer get /format:list o  wmic.exe /namespace:rootsubscription PATH __EventFilter get /format:list o  wmic.exe /namespace:rootsubscription PATH __TimerInstruction get /format:list o  wmic.exe /namespace:rootsubscription PATH __FilterToConsumerBinding get / format:list •  Some AVs starting to monitor these WMI objects •  Mark Russinovich’s AutoRuns for Windows
  • 16. Thank you! Now, it’s time for Q&A.
  • 17. TY MILLER. @tyronmiller @coresecurity I blog.coresecurity.com I www.coresecurity.com ALBERTO SOLIÑO. @agsolino ty.miller@threatintelligence.com I www.threatintelligence.com
  • 18. •  Multi-Threat Surface Investigation •  Commercial-Grade Framework •  Custom Reports & Results •  Security Awareness & Evidence •  Remediation Validation
  • 19. WEB Test for OWASP Top 10 web application vulnerabilities WI-FI Fake access point functionality for man-in-the-middle attacks MOBILE Mobile device exploitation modules including Android Agent ENDPOINT Test end-user awareness for phishing and social engineering MULTI-VECTOR ATTACKS NETWORK Pivot across networks using vulnerable systems