SlideShare une entreprise Scribd logo
1  sur  53
YOU ARE NOT HIDING
FROM ME .NET!
FOUR THINGS ABOUT MYSELF
Netflix addict
Attack detection bloggerThreat Hunter @ Countercept
Code junkie
THE AGENDA
Detect
Why .NET ?
IN THE NOT SO DISTANT PAST
PowerShell
VBScript
Office Macros
POWERSHELL, A HOT FAVOURITE
Load shellcode
into memory
Call upon
.NET API
Call upon
native API
Powerful
DEFENCES ARE GETTING BETTER
EDR AGENTS
Command Line Arguments Logging
CommandLine powershell write host “This is an evil command”
Parent-Child Process Relationship
DEFENCES ARE GETTING BETTER
AMSI assisting Anti-Virus with script-based detection
PowerShell Script Block Logging to aid with detection
INDUSTRY AS A WHOLE
More opportunities to
detect bad PowerShell
ADVERSARIES JUST DON’T GIVE UP
Invoke .NET directly
instead of via PowerShell
WHY .NET THOUGH?
Powerful
functions
Installed by
default
Lack of
telemetry
10
LET’S COMPARE POWERSHELL AND .NET
Write a registry key
through a .NET API
Pop a Message box
with a native API
POWERSHELL VS .NET
HOW DID I EXECUTE MY .NET PAYLOAD?
In-memory
assembly loading
IN MEMORY .NET ASSEMBLY LOADING
Compile
Serialize
Load into memory
De-serialize
Instantiate
A FUN FACT
This does exactly the same thing
WHAT CAN THE LOADED OBJECT DO?
Load shellcode
into memory
Call upon .NET API
Call upon native API
Similar to
PowerShell
MID-POINT CHECK
Challenge: Can we detect this?
Similar to PowerShell
Lack of telemetry
THE AGENDA
Detect
Why .NET ?
…… WITH PROCESS HACKER
Process Hacker
Mshta.exe
Analyze
DETECTING .NET LOADED DLLS
Loading of .NET runtime DLLs can be observed
DEFINITELY DODGY
MSHTA typically
only runs HTML or
JavaScript code!
HUNT HYPOTHESIS
Hunt for presence of.NET
runtime DLLs in binaries
WHAT IF A BINARY RELATED TO .NET WAS USED
Msbuild.exe
3rd Party Application
Not uncommon to have .NET
runtime DLL
WE NEED SOMETHING BETTER
And the answer lies deep
within Process Hacker
.NET ASSEMBLIES
Events of assembly loads
.NET ASSEMBLIES
Lack of a path indicates potential in-memory
assembly loads
.NET ASSEMBLIES
How did Process
Hacker achieve this?
DEEP WITHIN PROCESS HACKER
A set of .NET ETW providers
Microsoft-Windows-DotNETRuntime
Microsoft-Windows-DotNETRuntimeRundown
PROOF-OF-CONCEPT
.NET ETWConsumes
LET’S TRY TO DETECT MY ATTACK
Indicators for in-memory
assembly load
Indicators for .NET API
related to registry creation
Indicators for invoking of native API
IN-MEMORY ASSEMBLY LOAD
Events
related to
in-memory
assembly
load
Loading of .NET
assemblies
Just In Time
compilation
.NET CODE COMPILATION ARCHITECTURE
Compile
CIL
Compile Native
code
Upon
execution
JIT
Compiler
Compilation time Runtime
JIT COMPILATION
Events generated
whenever a .NET
method is first utilized
IN-MEMORY ASSEMBLY LOAD INDICATORS
Loading of .NET
assemblies
Just In Time
compilation
IN-MEMORY ASSEMBLY LOAD INDICATORS
Detect execution of the MyAssembly
constructor
REMEMBER THIS?
In-memory loading of assembly attempts
to replicate the above behavior
DETECTION SUMMARY
Indicators for in-memory
assembly load
Indicators for .NET API
related to registry creation
Indicators for invoking
of native API
JIT ETW
Just In Time compilation
Can we use this?
UNFORTUNATELY….
JIT compilation
doesn’t occur for
native .NET assemblies
NATIVE .NET ASSEMBLIES?
System.text
Console.writeLine()
WHY THOUGH?
Compile
Native Image Generator (NGEN)
compiles .NET assemblies to native
images, and caches them
Cache
WHY THOUGH?
Compile
JIT compilation would not occur
Cache
DETECTION SUMMARY
Indicators for in-memory
assembly load
Indicators for .NET API
related to registry creation
Indicators for invoking
of native API
NATIVE CODE
Native function imported from User32.dll
.NET ETW EVENTS
Interop events
INTEROP EVENTS
Events generated
during calls made to
Window’s native API
INTEROP EVENTS
Detected a call towards MessageBox
THIS IS REALLY USEFUL
Logging of
keystrokes
Credential
extraction from
memory
Other malicious
activities
DETECTION SUMMARY
Indicators for in-memory
assembly load
Indicators for .NET API
related to registry creation
Indicators for invoking
of native API
REAL WORLD EXAMPLE, SILENTRINITY
49
Launch a .NET
assembly
Launch SafetyKatz,
a credential
extraction tool
50
.NET TELEMETRY
.NET runtime
DLLS
.NET ETW
events
HOW ABOUT OTHER TELEMETRY?
Objective
Lateral
Movement
Control
Persistence
Execution
Delivery
Recon
Attacker
TO WRAP IT UP
1
.NET isn’t that invisible
2
PowerShell, still
deadly but…..
3
Try it yourself!
QUESTIONS?

Contenu connexe

Tendances

Tendances (20)

Building Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in RailsBuilding Mobile Friendly APIs in Rails
Building Mobile Friendly APIs in Rails
 
Serverless and Kubernetes Workshop on IBM Cloud
Serverless and Kubernetes Workshop on IBM CloudServerless and Kubernetes Workshop on IBM Cloud
Serverless and Kubernetes Workshop on IBM Cloud
 
WebHooks in 10 Minutes
WebHooks in 10 MinutesWebHooks in 10 Minutes
WebHooks in 10 Minutes
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
 
Webhooks
WebhooksWebhooks
Webhooks
 
Flask and Paramiko for Python VA
Flask and Paramiko for Python VAFlask and Paramiko for Python VA
Flask and Paramiko for Python VA
 
Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)Serverless in production, an experience report (CoDe-Conf)
Serverless in production, an experience report (CoDe-Conf)
 
Webpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San FranciscoWebpack Encore Symfony Live 2017 San Francisco
Webpack Encore Symfony Live 2017 San Francisco
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
 
Connecting with the enterprise - The how and why of connecting to Enterprise ...
Connecting with the enterprise - The how and why of connecting to Enterprise ...Connecting with the enterprise - The how and why of connecting to Enterprise ...
Connecting with the enterprise - The how and why of connecting to Enterprise ...
 
Sanic: Experience Blazing Fast Python Web Framework
Sanic: Experience Blazing Fast Python Web FrameworkSanic: Experience Blazing Fast Python Web Framework
Sanic: Experience Blazing Fast Python Web Framework
 
Serverless in production, an experience report (linuxing in london)
Serverless in production, an experience report (linuxing in london)Serverless in production, an experience report (linuxing in london)
Serverless in production, an experience report (linuxing in london)
 
React For Vikings
React For VikingsReact For Vikings
React For Vikings
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)Serverless in production, an experience report (London DevOps)
Serverless in production, an experience report (London DevOps)
 
Ryan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was GoodRyan Christiani I Heard React Was Good
Ryan Christiani I Heard React Was Good
 
Build a bot workshop async primer - php[tek]
Build a bot workshop  async primer - php[tek]Build a bot workshop  async primer - php[tek]
Build a bot workshop async primer - php[tek]
 
fmcsadmin 1.0.0
fmcsadmin 1.0.0fmcsadmin 1.0.0
fmcsadmin 1.0.0
 
APIs That Make Things Happen
APIs That Make Things HappenAPIs That Make Things Happen
APIs That Make Things Happen
 

Similaire à You are not_hiding_from_me_.net

Optimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer ToolsOptimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer Tools
Amazon Web Services
 
2600 av evasion_deuce
2600 av evasion_deuce2600 av evasion_deuce
2600 av evasion_deuce
Db Cooper
 
Native client (Евгений Эльцин)
Native client (Евгений Эльцин)Native client (Евгений Эльцин)
Native client (Евгений Эльцин)
Ontico
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
Joseph Scott
 
Continuous Deployment with Amazon Web Services by Carlos Conde
Continuous Deployment with Amazon Web Services by Carlos Conde Continuous Deployment with Amazon Web Services by Carlos Conde
Continuous Deployment with Amazon Web Services by Carlos Conde
Codemotion
 
Continuous Delivery in the Cloud
Continuous Delivery in the CloudContinuous Delivery in the Cloud
Continuous Delivery in the Cloud
Fabio Lessa
 

Similaire à You are not_hiding_from_me_.net (20)

Optimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer ToolsOptimising Productivity with AWS Developer Tools
Optimising Productivity with AWS Developer Tools
 
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh VariaCloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
Cloud-powered Continuous Integration and Deployment architectures - Jinesh Varia
 
Developer-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for KubernetesDeveloper-Friendly CI / CD for Kubernetes
Developer-Friendly CI / CD for Kubernetes
 
2600 av evasion_deuce
2600 av evasion_deuce2600 av evasion_deuce
2600 av evasion_deuce
 
PVS-Studio: analyzing ReactOS's code
PVS-Studio: analyzing ReactOS's codePVS-Studio: analyzing ReactOS's code
PVS-Studio: analyzing ReactOS's code
 
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
"Applied Enterprise Metaprogramming in JavaScript", Vladyslav Dukhin
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Native client (Евгений Эльцин)
Native client (Евгений Эльцин)Native client (Евгений Эльцин)
Native client (Евгений Эльцин)
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
CI
CICI
CI
 
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-TestingJava Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
Java Hurdling: Obstacles and Techniques in Java Client Penetration-Testing
 
Where Node.JS Meets iOS
Where Node.JS Meets iOSWhere Node.JS Meets iOS
Where Node.JS Meets iOS
 
Serverless in production, an experience report
Serverless in production, an experience reportServerless in production, an experience report
Serverless in production, an experience report
 
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
Building Fault Tolerant, Highly Available and Secured Architectures - Simon E...
 
Continuous Deployment with Amazon Web Services by Carlos Conde
Continuous Deployment with Amazon Web Services by Carlos Conde Continuous Deployment with Amazon Web Services by Carlos Conde
Continuous Deployment with Amazon Web Services by Carlos Conde
 
Continuous Delivery in the AWS Cloud
Continuous Delivery in the AWS CloudContinuous Delivery in the AWS Cloud
Continuous Delivery in the AWS Cloud
 
Continuous Delivery in the Cloud
Continuous Delivery in the CloudContinuous Delivery in the Cloud
Continuous Delivery in the Cloud
 
Dot Net Framework
Dot Net FrameworkDot Net Framework
Dot Net Framework
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

You are not_hiding_from_me_.net

Notes de l'éditeur

  1. Work on better introduction