SlideShare a Scribd company logo
Windows Management
instrumentation – A Front Door for
malwares
Santhosh Kumar
Whoami
• Love to Break things apart.
• Hobby Hacker.
• Spoke at Various conferences including
DEFCON las Vegas, OWASP Appsec
USA 2014, Bsides Las Vegas.
• Second time here.
Outline
• WM … What?
• WMI malwares Timeline.
• WMI Architecture
• WQL
• WMI providers.
• WMI Eventing
• Demo
• Defenses
WM…what?
• System Management both remote and locally.
• Deployed way back in NT4 and Windows 98/95.
• Used to access registry,File System,network etc.
• Eventing,Remoting and Remote Code execution
• Endless possibilities.
• Various tools support.
• Own Query language.
Why Should i care?
WMI malware Timeline
• MS10-061 – Windows printer spooler
• Attackers Dropped a MOF file to gain RCE.
• Microsoft patched it in KB2347290 Update
http://poppopret.blogspot.in/2011/09/playing-with-mof-f
Hammertoss APT (2015)
• Heavy reliance upon WMI and PowerShell
ƒ
• Custom WMI class creation ƒ
• WMI repository used to store payloads of
arbitrary size ƒ
• Results of commands added to WMI
object properties
• https://www2.fireeye.com/rs/848-DID-242/imag
Syndicasec (2013-2015)
• 2 stage infection.
• creates a TimerInstruction to raise a
custom event
• Eventfilter is created to link to the
timerinstruction and EvilProviders
• Everytime it is linked the consumer is
executed leaving to RCE
http://www.welivesecurity.com/2013/05/23/syndi
WMI architecture
• https://msdn.microsoft.com/en-us/library/aa394553(v=vs.85).aspx
Interaction with WMI
Interaction with wmi
Interaction with wmi
winrm
Interaction with wmi
• .net
• Vbscript
• Jscript
• C/C++ via IWbem COM API
• More utilities
• http://passing-the-hash.blogspot.in/2013/04/m
WQL
• Similar like SQL.Query for WMI objects,classes and
Namespaces.
• Three types of query
• Data Query
• Event Query
• Schema Query
• Useful for RECON
• https://msdn.microsoft.com/en-us/library/aa392902(v=vs.85).a
WMI Recon
• Find installed Antivirus
WMI recon
• Find the Security Updates installed on the
system
• Find if it is a VM
WMI providers
• Form the core working of WMI
• Contains a DLL & MOF file for each
provider
• Have the own listing of GUID for each
provider
• %windir%System32Wbem
• Sometimes there can be a custom wmi
providers
Malicous WMI providers
• EvilWMIProvider by Casey Smith (@subTee) –
https://github.com/subTee/EvilWMIProvider
• Invoke-WmiMethod -Class Win32_Evil -Name
ExecShellcode -ArgumentList @(0x90, 0x90, 0x90),
$null
• EvilNetConnectionWMIProvider by Jared Atkinson
(@jaredcatkinson) –
https://github.com/jaredcatkinson/EvilNetConnectionWMI
• Invoke-WmiMethod -Class Win32_NetworkConnection -
Name RunPs -ArgumentList 'whoami' , $null – Get-
WmiObject -Class Win32_NetworkConnection
WMI eventing
• Wmi can be used to monitor any type of Operating
system events.
• Classified as two types
• Intrinsic events
• Extrinsic events
• 3 requirement to define a event filter
• Filter,consumer and binding
• http://blogs.technet.com/b/heyscriptingguy/archive/2012/06/08/an-insider-s-guide-to-using-wmi-events-an
Intrinsic Events
• Intrinsic events are system classes
included in every namespace
• Monitor any changes to the class or
namespace
• Should be executed within the polling
interval
• https://technet.microsoft.com/en-us/library/ee1
Extrinsic Events
• Use to monitor resources which is not
included in CIM repository
ROOTCIMV2:Win32_ComputerShutdownEvent
ROOTCIMV2:Win32_IP4RouteTableEvent
ROOTCIMV2:Win32_ProcessStartTrace
ROOTCIMV2:Win32_ModuleLoadTrace
ROOTCIMV2:Win32_ThreadStartTrace
ROOTCIMV2:Win32_VolumeChangeEvent
ROOTCIMV2:Msft_WmiProvider*
ROOTDEFAULT:RegistryKeyChangeEvent
ROOTDEFAULT:RegistryValueChangeEvent
Event Filter
• Define which event to trigger
• WMI query
• Intrinsic Query
• SELECT * FROM __InstanceOperationEvent WITHIN 30
WHERE ((__CLASS = "__InstanceCreationEvent" OR
__CLASS = "__InstanceModificationEvent") AND
TargetInstance ISA "CIM_DataFile") AND
(TargetInstance.Extension = "doc") OR
(TargetInstance.Extension = "docx")
• Extrinsic Query
• SELECT * FROM Win32_VolumeChangeEvent WHERE
EventType = 2
Event Consumer
• Define what to do when event is called.
• These are the standard event consumers:
LogFileEventConsumer
ActiveScriptEventConsumer
NTEventLogEventConsumer
SMTPEventConsumer
CommandLineEventConsumer
WMIGHOST apt
• Targeting indian Users mainly military, energy and government
policy.
• Infection via spear phishing attempt
• Drops a unclassified government file like this
WMIGHOST (2014-2015)
• India US strategic dialouge press
release.doc”
(000150415302D7898F56D89C610DE4A
9).
• Then drops if successful dw20.exe and
gupdate.exe
https://github.com/ytisf/theZoo/tree/master/ma
Password:infected
ShadowNet APT
• This was detected this year during the tibetian uprising
day.
• Group modified the toolchain to add WMI script for
gathering information and exfiltration.
• Multi Layer C&C server and identifies victim using
encoded strings
Registrant Name: Kasong Dolma
Registrant Street: New York
Registrant City:New York
Registrant State/Province:guangdong
Registrant Postal Code:10001
Registrant Country:CN
Registrant Phone:+1.9175608889
Registrant Email: mike.fly@email.com
WMI OFFENSIVE TOOLS
DEMO
• Acts like a Shell using WMI as C&C.
• Uses Namespaces for Storing the data.
• Uses Base64 encoding to store the data in
the namespace to avoid firewall and
endpoints
• Decodes Base64 data on attacker
machine
Defenses
• Don’t enable WMI Remoting?
• More strict Firewall Rules
• permanent WMI event subscriptions
• Custom Event logs.
Books
References
• http://www.trendmicro.com/cloud-content/us/pdfs/security-intelligence/white-papers
• http://www.welivesecurity.com/2013/05/23/syndicasec-in-the-sin-bin/
• https://github.com/ytisf/theZoo/tree/master/malwares/Binaries/WMIGhost
• https://www2.fireeye.com/rs/848-DID-242/images/rpt-apt29-hammertoss.pdf
• http://2014.hackitoergosum.org/slides/day1_WMI_Shell_Andrei_Dumitrescu.pdf
• https://msdn.microsoft.com/en-us/library/aa394582(v=vs.85).aspx
• https://msdn.microsoft.com/en-us/library/bg126473(v=vs.85).aspx
• https://msdn.microsoft.com/en-us/library/aa394554(v=vs.85).aspx
• http://blogs.technet.com/b/heyscriptingguy/archive/2012/06/08/an-insider-s-
guide-to-using-wmi-events-and-powershell.aspx
• http://www.codeproject.com/Articles/28226/Creating-WMI-Permanent-Event-
Subscriptions-Using-M
• http://ytisf.github.io/theZoo/
• https://dl.mandiant.com/EE/library/MIRcon2014/MIRcon_2014_IR_Track_Th
ere's_Something_About_WMI.pdf
•
WMI - A FRONT DOOR FOR MALWARES

More Related Content

What's hot

BlueHat v17 || Securing Windows Defender Application Guard
BlueHat v17 || Securing Windows Defender Application Guard BlueHat v17 || Securing Windows Defender Application Guard
BlueHat v17 || Securing Windows Defender Application Guard
BlueHat Security Conference
 
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
BlueHat Security Conference
 
Antivirus is hopeless
Antivirus is hopelessAntivirus is hopeless
Antivirus is hopeless
Sumedt Jitpukdebodin
 
CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)
Sam Bowne
 
An Inconvenient Truth: Evading the Ransomware Protection in Windows 10
An Inconvenient Truth: Evading the Ransomware Protection in Windows 10An Inconvenient Truth: Evading the Ransomware Protection in Windows 10
An Inconvenient Truth: Evading the Ransomware Protection in Windows 10
Soya Aoyama
 
EASE spectre meltdown_support
EASE spectre meltdown_supportEASE spectre meltdown_support
EASE spectre meltdown_support
Joe Slowik
 
Fundamental of malware analysis
Fundamental of malware analysisFundamental of malware analysis
Fundamental of malware analysis
Sumedt Jitpukdebodin
 
Csw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelistingCsw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelisting
CanSecWest
 
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat Security Conference
 
Dll preloading-attack
Dll preloading-attackDll preloading-attack
Dll preloading-attack
Cysinfo Cyber Security Community
 

What's hot (10)

BlueHat v17 || Securing Windows Defender Application Guard
BlueHat v17 || Securing Windows Defender Application Guard BlueHat v17 || Securing Windows Defender Application Guard
BlueHat v17 || Securing Windows Defender Application Guard
 
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
BlueHat v17 || Don't Let Your Virtualization Fabric Become the Attack Vector
 
Antivirus is hopeless
Antivirus is hopelessAntivirus is hopeless
Antivirus is hopeless
 
CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)CNIT 128 3. Attacking iOS Applications (Part 2)
CNIT 128 3. Attacking iOS Applications (Part 2)
 
An Inconvenient Truth: Evading the Ransomware Protection in Windows 10
An Inconvenient Truth: Evading the Ransomware Protection in Windows 10An Inconvenient Truth: Evading the Ransomware Protection in Windows 10
An Inconvenient Truth: Evading the Ransomware Protection in Windows 10
 
EASE spectre meltdown_support
EASE spectre meltdown_supportEASE spectre meltdown_support
EASE spectre meltdown_support
 
Fundamental of malware analysis
Fundamental of malware analysisFundamental of malware analysis
Fundamental of malware analysis
 
Csw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelistingCsw2016 freingruber bypassing_application_whitelisting
Csw2016 freingruber bypassing_application_whitelisting
 
BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole BlueHat v17 || Down the Open Source Software Rabbit Hole
BlueHat v17 || Down the Open Source Software Rabbit Hole
 
Dll preloading-attack
Dll preloading-attackDll preloading-attack
Dll preloading-attack
 

Viewers also liked

OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
Santhosh Kumar
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesPhil Hagen
 
Windows スクリプトセミナー WMI編 VBScript&WMI
Windows スクリプトセミナー WMI編 VBScript&WMIWindows スクリプトセミナー WMI編 VBScript&WMI
Windows スクリプトセミナー WMI編 VBScript&WMI
junichi anno
 
Luncheon 2016-07-16 - Topic 2 - Advanced Threat Hunting by Justin Falck
Luncheon 2016-07-16 -  Topic 2 - Advanced Threat Hunting by Justin FalckLuncheon 2016-07-16 -  Topic 2 - Advanced Threat Hunting by Justin Falck
Luncheon 2016-07-16 - Topic 2 - Advanced Threat Hunting by Justin Falck
North Texas Chapter of the ISSA
 
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItAMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
Nikhil Mittal
 
SOC2016 - The Investigation Labyrinth
SOC2016 - The Investigation LabyrinthSOC2016 - The Investigation Labyrinth
SOC2016 - The Investigation Labyrinth
chrissanders88
 
Logs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to GrokLogs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to Grok
Phil Hagen
 
Abstract Tools for Effective Threat Hunting
Abstract Tools for Effective Threat HuntingAbstract Tools for Effective Threat Hunting
Abstract Tools for Effective Threat Hunting
chrissanders88
 

Viewers also liked (9)

OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
OWASP Appsec USA 2014 Talk "Pwning the Pawns with Wihawk" Santhosh Kumar
 
SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management Databases
 
Windows スクリプトセミナー WMI編 VBScript&WMI
Windows スクリプトセミナー WMI編 VBScript&WMIWindows スクリプトセミナー WMI編 VBScript&WMI
Windows スクリプトセミナー WMI編 VBScript&WMI
 
Luncheon 2016-07-16 - Topic 2 - Advanced Threat Hunting by Justin Falck
Luncheon 2016-07-16 -  Topic 2 - Advanced Threat Hunting by Justin FalckLuncheon 2016-07-16 -  Topic 2 - Advanced Threat Hunting by Justin Falck
Luncheon 2016-07-16 - Topic 2 - Advanced Threat Hunting by Justin Falck
 
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does ItAMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
AMSI: How Windows 10 Plans to Stop Script-Based Attacks and How Well It Does It
 
SOC2016 - The Investigation Labyrinth
SOC2016 - The Investigation LabyrinthSOC2016 - The Investigation Labyrinth
SOC2016 - The Investigation Labyrinth
 
Logs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to GrokLogs, Logs, Every Where, Nor Any Byte to Grok
Logs, Logs, Every Where, Nor Any Byte to Grok
 
Abstract Tools for Effective Threat Hunting
Abstract Tools for Effective Threat HuntingAbstract Tools for Effective Threat Hunting
Abstract Tools for Effective Threat Hunting
 
Computer forensics ppt
Computer forensics pptComputer forensics ppt
Computer forensics ppt
 

Similar to WMI - A FRONT DOOR FOR MALWARES

Advanced Pen Testing Techniques-DNS-WMI
Advanced Pen Testing Techniques-DNS-WMIAdvanced Pen Testing Techniques-DNS-WMI
Advanced Pen Testing Techniques-DNS-WMI
Core Security
 
Secure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous DeliverySecure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous Delivery
Tim Mackey
 
Secure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous DeliverySecure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous Delivery
Black Duck by Synopsys
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
Sam Bowne
 
Web & Cloud Security in the real world
Web & Cloud Security in the real worldWeb & Cloud Security in the real world
Web & Cloud Security in the real world
Madhu Akula
 
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Apostolos Giannakidis
 
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...
Soya Aoyama
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
nitinscribd
 
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne
 
Power forensics
Power forensicsPower forensics
Power forensics
nullowaspmumbai
 
Watering Hole Attacks: Detect End-User Compromise Before the Damage is Done
Watering Hole Attacks: Detect End-User Compromise Before the Damage is DoneWatering Hole Attacks: Detect End-User Compromise Before the Damage is Done
Watering Hole Attacks: Detect End-User Compromise Before the Damage is Done
AlienVault
 
Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat Hunting
GIBIN JOHN
 
How to detect side channel attacks in cloud infrastructures
How to detect side channel attacks in cloud infrastructuresHow to detect side channel attacks in cloud infrastructures
How to detect side channel attacks in cloud infrastructures
Pasquale Puzio
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
RohitGautam261127
 
WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017
Alexander Polce Leary
 
Best practices to secure Windows10 with already included features
Best practices to secure Windows10 with already included featuresBest practices to secure Windows10 with already included features
Best practices to secure Windows10 with already included features
Alexander Benoit
 
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?
Yassine Aboukir
 
Botnets Attacks.pptx
Botnets Attacks.pptxBotnets Attacks.pptx
Botnets Attacks.pptx
MuhammadRehan856177
 
Threat_Modelling.pdf
Threat_Modelling.pdfThreat_Modelling.pdf
Threat_Modelling.pdf
MarlboroAbyad
 
هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme...
 هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme... هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme...
هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme...
M Mehdi Ahmadian
 

Similar to WMI - A FRONT DOOR FOR MALWARES (20)

Advanced Pen Testing Techniques-DNS-WMI
Advanced Pen Testing Techniques-DNS-WMIAdvanced Pen Testing Techniques-DNS-WMI
Advanced Pen Testing Techniques-DNS-WMI
 
Secure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous DeliverySecure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous Delivery
 
Secure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous DeliverySecure Application Development in the Age of Continuous Delivery
Secure Application Development in the Age of Continuous Delivery
 
CNIT 152: 12b Windows Registry
CNIT 152: 12b Windows RegistryCNIT 152: 12b Windows Registry
CNIT 152: 12b Windows Registry
 
Web & Cloud Security in the real world
Web & Cloud Security in the real worldWeb & Cloud Security in the real world
Web & Cloud Security in the real world
 
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
Unsafe Deserialization Attacks In Java and A New Approach To Protect The JVM ...
 
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...
An inconvenient truth: Evading the Ransomware Protection in windows 10 @ Hack...
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
 
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 152: 12 Investigating Windows Systems (Part 2 of 3)
 
Power forensics
Power forensicsPower forensics
Power forensics
 
Watering Hole Attacks: Detect End-User Compromise Before the Damage is Done
Watering Hole Attacks: Detect End-User Compromise Before the Damage is DoneWatering Hole Attacks: Detect End-User Compromise Before the Damage is Done
Watering Hole Attacks: Detect End-User Compromise Before the Damage is Done
 
Windows Threat Hunting
Windows Threat HuntingWindows Threat Hunting
Windows Threat Hunting
 
How to detect side channel attacks in cloud infrastructures
How to detect side channel attacks in cloud infrastructuresHow to detect side channel attacks in cloud infrastructures
How to detect side channel attacks in cloud infrastructures
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
 
WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017
 
Best practices to secure Windows10 with already included features
Best practices to secure Windows10 with already included featuresBest practices to secure Windows10 with already included features
Best practices to secure Windows10 with already included features
 
Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?Hacking WebApps for fun and profit : how to approach a target?
Hacking WebApps for fun and profit : how to approach a target?
 
Botnets Attacks.pptx
Botnets Attacks.pptxBotnets Attacks.pptx
Botnets Attacks.pptx
 
Threat_Modelling.pdf
Threat_Modelling.pdfThreat_Modelling.pdf
Threat_Modelling.pdf
 
هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme...
 هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme... هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme...
هک پایگاه داده و راهکارهای مقابلهDatabases hacking, safeguards and counterme...
 

Recently uploaded

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 

Recently uploaded (20)

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 

WMI - A FRONT DOOR FOR MALWARES

  • 1. Windows Management instrumentation – A Front Door for malwares Santhosh Kumar
  • 2. Whoami • Love to Break things apart. • Hobby Hacker. • Spoke at Various conferences including DEFCON las Vegas, OWASP Appsec USA 2014, Bsides Las Vegas. • Second time here.
  • 3. Outline • WM … What? • WMI malwares Timeline. • WMI Architecture • WQL • WMI providers. • WMI Eventing • Demo • Defenses
  • 4. WM…what? • System Management both remote and locally. • Deployed way back in NT4 and Windows 98/95. • Used to access registry,File System,network etc. • Eventing,Remoting and Remote Code execution • Endless possibilities. • Various tools support. • Own Query language.
  • 5. Why Should i care?
  • 6. WMI malware Timeline • MS10-061 – Windows printer spooler • Attackers Dropped a MOF file to gain RCE. • Microsoft patched it in KB2347290 Update http://poppopret.blogspot.in/2011/09/playing-with-mof-f
  • 7. Hammertoss APT (2015) • Heavy reliance upon WMI and PowerShell ƒ • Custom WMI class creation ƒ • WMI repository used to store payloads of arbitrary size ƒ • Results of commands added to WMI object properties • https://www2.fireeye.com/rs/848-DID-242/imag
  • 8. Syndicasec (2013-2015) • 2 stage infection. • creates a TimerInstruction to raise a custom event • Eventfilter is created to link to the timerinstruction and EvilProviders • Everytime it is linked the consumer is executed leaving to RCE http://www.welivesecurity.com/2013/05/23/syndi
  • 13. winrm
  • 14. Interaction with wmi • .net • Vbscript • Jscript • C/C++ via IWbem COM API • More utilities • http://passing-the-hash.blogspot.in/2013/04/m
  • 15. WQL • Similar like SQL.Query for WMI objects,classes and Namespaces. • Three types of query • Data Query • Event Query • Schema Query • Useful for RECON • https://msdn.microsoft.com/en-us/library/aa392902(v=vs.85).a
  • 16. WMI Recon • Find installed Antivirus
  • 17. WMI recon • Find the Security Updates installed on the system • Find if it is a VM
  • 18. WMI providers • Form the core working of WMI • Contains a DLL & MOF file for each provider • Have the own listing of GUID for each provider • %windir%System32Wbem • Sometimes there can be a custom wmi providers
  • 19. Malicous WMI providers • EvilWMIProvider by Casey Smith (@subTee) – https://github.com/subTee/EvilWMIProvider • Invoke-WmiMethod -Class Win32_Evil -Name ExecShellcode -ArgumentList @(0x90, 0x90, 0x90), $null • EvilNetConnectionWMIProvider by Jared Atkinson (@jaredcatkinson) – https://github.com/jaredcatkinson/EvilNetConnectionWMI • Invoke-WmiMethod -Class Win32_NetworkConnection - Name RunPs -ArgumentList 'whoami' , $null – Get- WmiObject -Class Win32_NetworkConnection
  • 20. WMI eventing • Wmi can be used to monitor any type of Operating system events. • Classified as two types • Intrinsic events • Extrinsic events • 3 requirement to define a event filter • Filter,consumer and binding • http://blogs.technet.com/b/heyscriptingguy/archive/2012/06/08/an-insider-s-guide-to-using-wmi-events-an
  • 21. Intrinsic Events • Intrinsic events are system classes included in every namespace • Monitor any changes to the class or namespace • Should be executed within the polling interval • https://technet.microsoft.com/en-us/library/ee1
  • 22. Extrinsic Events • Use to monitor resources which is not included in CIM repository ROOTCIMV2:Win32_ComputerShutdownEvent ROOTCIMV2:Win32_IP4RouteTableEvent ROOTCIMV2:Win32_ProcessStartTrace ROOTCIMV2:Win32_ModuleLoadTrace ROOTCIMV2:Win32_ThreadStartTrace ROOTCIMV2:Win32_VolumeChangeEvent ROOTCIMV2:Msft_WmiProvider* ROOTDEFAULT:RegistryKeyChangeEvent ROOTDEFAULT:RegistryValueChangeEvent
  • 23. Event Filter • Define which event to trigger • WMI query • Intrinsic Query • SELECT * FROM __InstanceOperationEvent WITHIN 30 WHERE ((__CLASS = "__InstanceCreationEvent" OR __CLASS = "__InstanceModificationEvent") AND TargetInstance ISA "CIM_DataFile") AND (TargetInstance.Extension = "doc") OR (TargetInstance.Extension = "docx") • Extrinsic Query • SELECT * FROM Win32_VolumeChangeEvent WHERE EventType = 2
  • 24. Event Consumer • Define what to do when event is called. • These are the standard event consumers: LogFileEventConsumer ActiveScriptEventConsumer NTEventLogEventConsumer SMTPEventConsumer CommandLineEventConsumer
  • 25. WMIGHOST apt • Targeting indian Users mainly military, energy and government policy. • Infection via spear phishing attempt • Drops a unclassified government file like this
  • 26. WMIGHOST (2014-2015) • India US strategic dialouge press release.doc” (000150415302D7898F56D89C610DE4A 9). • Then drops if successful dw20.exe and gupdate.exe https://github.com/ytisf/theZoo/tree/master/ma Password:infected
  • 27. ShadowNet APT • This was detected this year during the tibetian uprising day. • Group modified the toolchain to add WMI script for gathering information and exfiltration. • Multi Layer C&C server and identifies victim using encoded strings Registrant Name: Kasong Dolma Registrant Street: New York Registrant City:New York Registrant State/Province:guangdong Registrant Postal Code:10001 Registrant Country:CN Registrant Phone:+1.9175608889 Registrant Email: mike.fly@email.com
  • 29. DEMO • Acts like a Shell using WMI as C&C. • Uses Namespaces for Storing the data. • Uses Base64 encoding to store the data in the namespace to avoid firewall and endpoints • Decodes Base64 data on attacker machine
  • 30. Defenses • Don’t enable WMI Remoting? • More strict Firewall Rules • permanent WMI event subscriptions • Custom Event logs.
  • 31. Books
  • 32.
  • 33. References • http://www.trendmicro.com/cloud-content/us/pdfs/security-intelligence/white-papers • http://www.welivesecurity.com/2013/05/23/syndicasec-in-the-sin-bin/ • https://github.com/ytisf/theZoo/tree/master/malwares/Binaries/WMIGhost • https://www2.fireeye.com/rs/848-DID-242/images/rpt-apt29-hammertoss.pdf • http://2014.hackitoergosum.org/slides/day1_WMI_Shell_Andrei_Dumitrescu.pdf • https://msdn.microsoft.com/en-us/library/aa394582(v=vs.85).aspx • https://msdn.microsoft.com/en-us/library/bg126473(v=vs.85).aspx • https://msdn.microsoft.com/en-us/library/aa394554(v=vs.85).aspx • http://blogs.technet.com/b/heyscriptingguy/archive/2012/06/08/an-insider-s- guide-to-using-wmi-events-and-powershell.aspx • http://www.codeproject.com/Articles/28226/Creating-WMI-Permanent-Event- Subscriptions-Using-M • http://ytisf.github.io/theZoo/ • https://dl.mandiant.com/EE/library/MIRcon2014/MIRcon_2014_IR_Track_Th ere's_Something_About_WMI.pdf •