SlideShare una empresa de Scribd logo
1 de 30
HUNT OR BE HUNTED
7th June 2017
• Senior Threat Hunter @ Countercept
• Pentester + Defensive fanboi
• Bug Bounty Lover <3
• Blogger? @pwndizzle
WHOAMI
Threat hunting when you don’t know you’re threat hunting…
“THE PROCESS OF PROACTIVELY AND
ITERATIVELY SEARCHING THROUGH
NETWORKS TO DETECT AND ISOLATE
ADVANCED THREATS THAT EVADE
EXISTING SECURITY SOLUTIONS”
- SQRRL
What is threat hunting?
Manual
Alerts from
“products” (AV)
Semi-AutomatedFully Automated
Manual Threat
Hunting
Assisted Hunts
Vuln Scanners
(Nessus)
Manual
Pentesting
Tools (nmap)
Advanced
Threat Hunting
Traditional
security teams
Manual vs Automated
OFFENCE
DEFENCE
TacticalThreatIntel
10%
40%
80%
99%
AUTOMATED NOTIFICATION
AUTOMATION
Capability
‘HUNTING USE CASE’
GENERATION (HYPOTHESIS)
‘HUNTING USE CASE’
EXECUTION
The Paris Model
(or Hunting Rocket, or APT Eiffel Tower)
Process
• Red team use-case: HTA w/PS payload
• Manual hunt: mshta.exe usage, PS script logging
• Automated hunt: suspicious processes/script analysis
• Refine automation (increase fidelity): Filtering/Enrichment
Requirements
• People: someone needs to know this technique, understand it enough
to search and automate
• Tech: endpoint visibility required + automated analysis framework.
Paris Model In Action
Where do I start?
What data sources?
Payload
executed
Data
exfiltrated
Persistence
installed
Escalated
Privs
Lateral
movement
Payload
delivered
• Email Filter
• Web Proxy
• Bro Logs
• Firewall
• Endpoint
• Windows/Linux logs
• AV logs
• Bro Logs
• Web Proxy
• App Logs
How to do analysis?
IOCs are bad*
*If you rely on IOCs as your primary detection technique
Specific Attacker TTPs
• Anomaly or context driven
• Windows – Logins, DCSync, PrivEsc,
Lockouts
• Binaries
• Execution – cmd, ps,
wscript, wmi
• Enumeration - net
• Persistence – schtasks,
services, registry, cron
• In-Memory injection
• Privilege Escalation
• UAC Bypass
Endpoint
Logs Network
• Domain classification/history/age
• File analysis - Extension, Content-
type, Content, Mismatches
• Data Transfers –
Uploads/Downloads
• Dynamic DNS usage
• DNS Tunneling
In-Memory Injection
Detection
• Suspicious threads
• Unknown module
• Unusual Permissions (e.g. RWX)
• Check for MZ
• Check for PE Header
• Check for MS-DOS strings
Injection Techniques
• LoadLibrary
• Process Hollowing
• Reflective Loading
• Hooking
Advanced Attack Detection @ Securitay2017 -
https://youtu.be/ihElrBBJQo8
Least Frequency Analysis/Stacking
Frequency
Count
Highest Frequency
Process Name Count
conhost.exe 11730618
cscript.exe 9819507
cmd.exe 1497875
WmiPrvSE.exe 1444628
dllhost.exe 579741
Lowest Frequency
Process Name Count
hpzpsl01.exe 1
ismagent.exe 1
MSIAE02.tmp 1
dJK4oMMtx.exe 1
SketchUp.exe 1
Anomalies
That’s a bit weird
Relationships/Graphing
Clustering/Behaviour Based Detection
https://countercept.com/our-thinking/machine-learning/
Automation
Efficiency is intelligent laziness
Speeding it up
• Data analysis with scoring/rules
(“Assisted Hunts”)
• Enrichment/Context
• Integrated prevention/response
• Ticketing – Creation, Updating,
Closing
• Payload Analysis – VT and Cuckoo
integration, IDA/Radare plugins
• Comms with other users/clients
(https://github.com/dropbox/securitybot)
Welcome to the
real world…
• Targeting ATM management systems! :O
Example #1 – Don’t trust your admins
• Lateral movement using “Advanced IP Scanner”
• History of deployment, 1 host, 5 hosts, 27 hosts.
• Compiled Python binary with key-logging capabilities
• Suspicious executable bstack.exe running from StartUp folder
Example #2 – Emotet - Macros+Powershell <3
Scoring
• Hidden Window (3/10)
• WebClient Download File (10/10)
• URL in args (7/10)
• Start-Process (8/10)
• Network comms/File writes (9/10)
IEX( ( '36{78Q55@32t61_91{99@104X97{114Q91-32t93}32t93}32t34@110m111@105}115X115-
101m114_112@120@69-45{101@107X111m118m110-73Q124Q32X41Q57@51-
93Q114_97_104t67t91{44V39Q112_81t109@39}101{99@97}108{112}101}82_45m32_32X52{51Q93m114@97-
104{67t91t44t39V98t103V48t39-101}99}97V108}112t101_82_45{32@41X39{41_112t81_109_39m43{39-
110t101@112{81t39X43@39t109_43t112_81Q109t101X39Q43m39}114Q71_112{81m109m39@43X39V32Q40}32m3
9_43_39{114-111m108t111t67{100m110{117Q39_43m39-111-114Q103_101t114@39m43-39{111t70-
45}32m41}98{103V48V110Q98t103{48@39{43{39-43{32t98m103_48{111@105t98@103V48-39@43{39_32-
32V43V32}32t98t103@48X116m97V99t98X103t48_39V43m39@43-
39X43Q39_98@103@48}115V117V102Q98V79m45@98m39Q43{39X103_39X43Q39V48}43-39}43t39}98-
103{48V101_107Q39t43X39_111X118X110V39X43}39t98_103{48@43}32_98{103}48{73{98-
39@43t39m103_39}43{39{48Q32t39X43X39-32{40V32t41{39Q43V39m98X103{39_43V39{48-
116{115Q79{39_43_39}98}103m48{39Q43t39X32X43{32_98@103-39@43m39X48_72-
39_43t39V45m39t43Q39_101Q98}103_48-
32_39Q43V39V32t39V43}39m43Q32V98X39Q43_39@103_48V39@43Q39@116X73t82V119m98-
39{43_39}103Q48X40_46_32m39}40_40{34t59m91@65V114V114@97_121}93Q58Q58V82Q101Q118Q101{114}115
_101m40_36_78m55@32t41t32-59{32}73{69V88m32{40t36V78t55}45Q74m111@105-110m32X39V39-32}41'.SpLiT(
'{_Q-@t}mXV' ) |ForEach-Object { ([Int]$_ -AS [Char]) } ) -Join'' )
• IEX (9/10)
• Letter/Number/Special Char
Ratios (8/10)
• Decoder Stub (7/10)
• Length (8/10)
https://github.com/danielbohannon/Invoke-Obfuscation
How to be a stealthier attacker
Foothold
Execution
Persistence
C2/Exfil
• Avoid SysInternals Autoruns - Scheduled Tasks, Services, Registry, Cron,
Launch Daemons/Agents
• WMI and COM not perfect but better than others
• Use “hide in plain sight” techniques
• Outlook rules, Office templates
• DLL side-loading
• Rootkits
• Anything involving custom applications
• Don’t use persistence if you don’t need to!
• Avoid network comms from processes which don’t have network comms
• Avoid newly registered domains, if possible use Google/Twitter/Youtube etc.
• Avoid DNS tunneling
• Use SSL and outlook/browsers where possible and go low and slow
• Avoid new processes and avoid using command line arguments
• Avoid Windows utilities – cmd, powershell, net, reg, etc.
• Avoid in-memory techniques
• Avoid “hacker tools” – Metasploit, CobaltStrike, Mimikatz
• Avoid “spraying” credentials
• WMI is a better option
• Use direct Windows API access where possible
• Modify tools/binaries – name, hash, description
• Avoid macros/hta files
• Social engineering, exploits, webapps are better
• Abuse third party services Facebook/Linkedin
• Target personal assets instead of corporate assets
• Data – OSQuery, GRR, Sysmon, Bro,
Event logs
• Storage – Elastic
• Analytics - ElasticDSL, Kibana,
ElastAlert, 411
• Infrastructure – Puppet, Chef, Ansible,
Docker
DIY Detection
But what about
CVE-2017-0144?!
Blue is the new red…
QUESTIONS?

Más contenido relacionado

La actualidad más candente

[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
CODE BLUE
 
Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
Ross Wolf
 
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
CODE BLUE
 

La actualidad más candente (20)

Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
Big Bang Theory: The Evolution of Pentesting High Security Enviroments IT Def...
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
BSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathers
 
EASE spectre meltdown_support
EASE spectre meltdown_supportEASE spectre meltdown_support
EASE spectre meltdown_support
 
Fantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
 
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015 Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
 
Web security for developers
Web security for developersWeb security for developers
Web security for developers
 
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malwareDefcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
Defcon 22-wesley-mc grew-instrumenting-point-of-sale-malware
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
More fun using Kautilya
More fun using KautilyaMore fun using Kautilya
More fun using Kautilya
 
I Hunt Sys Admins
I Hunt Sys AdminsI Hunt Sys Admins
I Hunt Sys Admins
 
Top Security Challenges Facing Credit Unions Today
Top Security Challenges Facing Credit Unions TodayTop Security Challenges Facing Credit Unions Today
Top Security Challenges Facing Credit Unions Today
 
Oscp preparation
Oscp preparationOscp preparation
Oscp preparation
 
Kautilya: Teensy beyond shell
Kautilya: Teensy beyond shellKautilya: Teensy beyond shell
Kautilya: Teensy beyond shell
 
I got 99 trends and a # is all of them
I got 99 trends and a # is all of themI got 99 trends and a # is all of them
I got 99 trends and a # is all of them
 
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
[CB16] Facebook Malware: Tag Me If You Can by Ido Naor & Dani Goland
 
Nessus and Reporting Karma
Nessus and Reporting KarmaNessus and Reporting Karma
Nessus and Reporting Karma
 
Owning windows 8 with human interface devices
Owning windows 8 with human interface devicesOwning windows 8 with human interface devices
Owning windows 8 with human interface devices
 
Defending Your "Gold"
Defending Your "Gold"Defending Your "Gold"
Defending Your "Gold"
 

Destacado

Kavya racharla ndh-naropanth_fin_jp-final
Kavya racharla ndh-naropanth_fin_jp-finalKavya racharla ndh-naropanth_fin_jp-final
Kavya racharla ndh-naropanth_fin_jp-final
PacSecJP
 

Destacado (17)

WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017WMI for Penetration Testers - Arcticcon 2017
WMI for Penetration Testers - Arcticcon 2017
 
Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017
 
Pwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShellPwning the Enterprise With PowerShell
Pwning the Enterprise With PowerShell
 
Obfuscating The Empire
Obfuscating The EmpireObfuscating The Empire
Obfuscating The Empire
 
Invoke-Obfuscation nullcon 2017
Invoke-Obfuscation nullcon 2017Invoke-Obfuscation nullcon 2017
Invoke-Obfuscation nullcon 2017
 
A Case Study in Attacking KeePass
A Case Study in Attacking KeePassA Case Study in Attacking KeePass
A Case Study in Attacking KeePass
 
Ace Up the Sleeve
Ace Up the SleeveAce Up the Sleeve
Ace Up the Sleeve
 
SANS DFIR Prague: PowerShell & WMI
SANS DFIR Prague: PowerShell & WMISANS DFIR Prague: PowerShell & WMI
SANS DFIR Prague: PowerShell & WMI
 
PuppetConf 2017: Inviting Windows to the Puppet Party- Chris Kittell & Derek ...
PuppetConf 2017: Inviting Windows to the Puppet Party- Chris Kittell & Derek ...PuppetConf 2017: Inviting Windows to the Puppet Party- Chris Kittell & Derek ...
PuppetConf 2017: Inviting Windows to the Puppet Party- Chris Kittell & Derek ...
 
Catch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs BlueCatch Me If You Can: PowerShell Red vs Blue
Catch Me If You Can: PowerShell Red vs Blue
 
Taking the Attacker Eviction Red Pill (v2.0)
Taking the Attacker Eviction Red Pill (v2.0)Taking the Attacker Eviction Red Pill (v2.0)
Taking the Attacker Eviction Red Pill (v2.0)
 
MS Just Gave the Blue Team Tactical Nukes (And How Red Teams Need To Adapt) -...
MS Just Gave the Blue Team Tactical Nukes (And How Red Teams Need To Adapt) -...MS Just Gave the Blue Team Tactical Nukes (And How Red Teams Need To Adapt) -...
MS Just Gave the Blue Team Tactical Nukes (And How Red Teams Need To Adapt) -...
 
Keeping Up with the Adversary: Creating a Threat-Based Cyber Team
Keeping Up with the Adversary:  Creating a Threat-Based Cyber TeamKeeping Up with the Adversary:  Creating a Threat-Based Cyber Team
Keeping Up with the Adversary: Creating a Threat-Based Cyber Team
 
Living off the land and fileless attack techniques
Living off the land and fileless attack techniquesLiving off the land and fileless attack techniques
Living off the land and fileless attack techniques
 
Catching fileless attacks
Catching fileless attacksCatching fileless attacks
Catching fileless attacks
 
Hunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows Infrastructure
 
Kavya racharla ndh-naropanth_fin_jp-final
Kavya racharla ndh-naropanth_fin_jp-finalKavya racharla ndh-naropanth_fin_jp-final
Kavya racharla ndh-naropanth_fin_jp-final
 

Similar a BSides London 2017 - Hunt Or Be Hunted

Honeypots for Active Defense
Honeypots for Active DefenseHoneypots for Active Defense
Honeypots for Active Defense
Greg Foss
 

Similar a BSides London 2017 - Hunt Or Be Hunted (20)

Loggin alerting and hunting technology hub 2016
Loggin alerting and hunting   technology hub 2016Loggin alerting and hunting   technology hub 2016
Loggin alerting and hunting technology hub 2016
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
Nomura UCCSC 2009
Nomura UCCSC 2009Nomura UCCSC 2009
Nomura UCCSC 2009
 
unit 2 confinement techniques.pdf
unit 2 confinement techniques.pdfunit 2 confinement techniques.pdf
unit 2 confinement techniques.pdf
 
L27
L27L27
L27
 
Honeypots for Active Defense
Honeypots for Active DefenseHoneypots for Active Defense
Honeypots for Active Defense
 
InfoSecurity.be 2011
InfoSecurity.be 2011InfoSecurity.be 2011
InfoSecurity.be 2011
 
The Golden Rules - Detecting more with RSA Security Analytics
The Golden Rules  - Detecting more with RSA Security AnalyticsThe Golden Rules  - Detecting more with RSA Security Analytics
The Golden Rules - Detecting more with RSA Security Analytics
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
Building next gen malware behavioural analysis environment
Building next gen malware behavioural analysis environment Building next gen malware behavioural analysis environment
Building next gen malware behavioural analysis environment
 
intrusion detection system (IDS)
intrusion detection system (IDS)intrusion detection system (IDS)
intrusion detection system (IDS)
 
honeypots.ppt
honeypots.ppthoneypots.ppt
honeypots.ppt
 
WTF is Penetration Testing v.2
WTF is Penetration Testing v.2WTF is Penetration Testing v.2
WTF is Penetration Testing v.2
 
NextGen Endpoint Security for Dummies
NextGen Endpoint Security for DummiesNextGen Endpoint Security for Dummies
NextGen Endpoint Security for Dummies
 
Spo2 t19 spo2-t19
Spo2 t19 spo2-t19Spo2 t19 spo2-t19
Spo2 t19 spo2-t19
 
Hermit Crab Presentation
Hermit Crab PresentationHermit Crab Presentation
Hermit Crab Presentation
 
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
The Dirty Little Secrets They Didn’t Teach You In Pentesting Class
 
Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...
 

Último

Último (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

BSides London 2017 - Hunt Or Be Hunted

  • 1. HUNT OR BE HUNTED 7th June 2017
  • 2. • Senior Threat Hunter @ Countercept • Pentester + Defensive fanboi • Bug Bounty Lover <3 • Blogger? @pwndizzle WHOAMI
  • 3. Threat hunting when you don’t know you’re threat hunting…
  • 4. “THE PROCESS OF PROACTIVELY AND ITERATIVELY SEARCHING THROUGH NETWORKS TO DETECT AND ISOLATE ADVANCED THREATS THAT EVADE EXISTING SECURITY SOLUTIONS” - SQRRL What is threat hunting?
  • 5. Manual Alerts from “products” (AV) Semi-AutomatedFully Automated Manual Threat Hunting Assisted Hunts Vuln Scanners (Nessus) Manual Pentesting Tools (nmap) Advanced Threat Hunting Traditional security teams Manual vs Automated OFFENCE DEFENCE
  • 6. TacticalThreatIntel 10% 40% 80% 99% AUTOMATED NOTIFICATION AUTOMATION Capability ‘HUNTING USE CASE’ GENERATION (HYPOTHESIS) ‘HUNTING USE CASE’ EXECUTION The Paris Model (or Hunting Rocket, or APT Eiffel Tower)
  • 7. Process • Red team use-case: HTA w/PS payload • Manual hunt: mshta.exe usage, PS script logging • Automated hunt: suspicious processes/script analysis • Refine automation (increase fidelity): Filtering/Enrichment Requirements • People: someone needs to know this technique, understand it enough to search and automate • Tech: endpoint visibility required + automated analysis framework. Paris Model In Action
  • 8.
  • 9. Where do I start?
  • 10.
  • 12.
  • 13. Payload executed Data exfiltrated Persistence installed Escalated Privs Lateral movement Payload delivered • Email Filter • Web Proxy • Bro Logs • Firewall • Endpoint • Windows/Linux logs • AV logs • Bro Logs • Web Proxy • App Logs
  • 14. How to do analysis?
  • 15. IOCs are bad* *If you rely on IOCs as your primary detection technique
  • 16. Specific Attacker TTPs • Anomaly or context driven • Windows – Logins, DCSync, PrivEsc, Lockouts • Binaries • Execution – cmd, ps, wscript, wmi • Enumeration - net • Persistence – schtasks, services, registry, cron • In-Memory injection • Privilege Escalation • UAC Bypass Endpoint Logs Network • Domain classification/history/age • File analysis - Extension, Content- type, Content, Mismatches • Data Transfers – Uploads/Downloads • Dynamic DNS usage • DNS Tunneling
  • 17. In-Memory Injection Detection • Suspicious threads • Unknown module • Unusual Permissions (e.g. RWX) • Check for MZ • Check for PE Header • Check for MS-DOS strings Injection Techniques • LoadLibrary • Process Hollowing • Reflective Loading • Hooking Advanced Attack Detection @ Securitay2017 - https://youtu.be/ihElrBBJQo8
  • 18. Least Frequency Analysis/Stacking Frequency Count Highest Frequency Process Name Count conhost.exe 11730618 cscript.exe 9819507 cmd.exe 1497875 WmiPrvSE.exe 1444628 dllhost.exe 579741 Lowest Frequency Process Name Count hpzpsl01.exe 1 ismagent.exe 1 MSIAE02.tmp 1 dJK4oMMtx.exe 1 SketchUp.exe 1 Anomalies That’s a bit weird
  • 23. Speeding it up • Data analysis with scoring/rules (“Assisted Hunts”) • Enrichment/Context • Integrated prevention/response • Ticketing – Creation, Updating, Closing • Payload Analysis – VT and Cuckoo integration, IDA/Radare plugins • Comms with other users/clients (https://github.com/dropbox/securitybot)
  • 25. • Targeting ATM management systems! :O Example #1 – Don’t trust your admins • Lateral movement using “Advanced IP Scanner” • History of deployment, 1 host, 5 hosts, 27 hosts. • Compiled Python binary with key-logging capabilities • Suspicious executable bstack.exe running from StartUp folder
  • 26. Example #2 – Emotet - Macros+Powershell <3 Scoring • Hidden Window (3/10) • WebClient Download File (10/10) • URL in args (7/10) • Start-Process (8/10) • Network comms/File writes (9/10) IEX( ( '36{78Q55@32t61_91{99@104X97{114Q91-32t93}32t93}32t34@110m111@105}115X115- 101m114_112@120@69-45{101@107X111m118m110-73Q124Q32X41Q57@51- 93Q114_97_104t67t91{44V39Q112_81t109@39}101{99@97}108{112}101}82_45m32_32X52{51Q93m114@97- 104{67t91t44t39V98t103V48t39-101}99}97V108}112t101_82_45{32@41X39{41_112t81_109_39m43{39- 110t101@112{81t39X43@39t109_43t112_81Q109t101X39Q43m39}114Q71_112{81m109m39@43X39V32Q40}32m3 9_43_39{114-111m108t111t67{100m110{117Q39_43m39-111-114Q103_101t114@39m43-39{111t70- 45}32m41}98{103V48V110Q98t103{48@39{43{39-43{32t98m103_48{111@105t98@103V48-39@43{39_32- 32V43V32}32t98t103@48X116m97V99t98X103t48_39V43m39@43- 39X43Q39_98@103@48}115V117V102Q98V79m45@98m39Q43{39X103_39X43Q39V48}43-39}43t39}98- 103{48V101_107Q39t43X39_111X118X110V39X43}39t98_103{48@43}32_98{103}48{73{98- 39@43t39m103_39}43{39{48Q32t39X43X39-32{40V32t41{39Q43V39m98X103{39_43V39{48- 116{115Q79{39_43_39}98}103m48{39Q43t39X32X43{32_98@103-39@43m39X48_72- 39_43t39V45m39t43Q39_101Q98}103_48- 32_39Q43V39V32t39V43}39m43Q32V98X39Q43_39@103_48V39@43Q39@116X73t82V119m98- 39{43_39}103Q48X40_46_32m39}40_40{34t59m91@65V114V114@97_121}93Q58Q58V82Q101Q118Q101{114}115 _101m40_36_78m55@32t41t32-59{32}73{69V88m32{40t36V78t55}45Q74m111@105-110m32X39V39-32}41'.SpLiT( '{_Q-@t}mXV' ) |ForEach-Object { ([Int]$_ -AS [Char]) } ) -Join'' ) • IEX (9/10) • Letter/Number/Special Char Ratios (8/10) • Decoder Stub (7/10) • Length (8/10) https://github.com/danielbohannon/Invoke-Obfuscation
  • 27. How to be a stealthier attacker Foothold Execution Persistence C2/Exfil • Avoid SysInternals Autoruns - Scheduled Tasks, Services, Registry, Cron, Launch Daemons/Agents • WMI and COM not perfect but better than others • Use “hide in plain sight” techniques • Outlook rules, Office templates • DLL side-loading • Rootkits • Anything involving custom applications • Don’t use persistence if you don’t need to! • Avoid network comms from processes which don’t have network comms • Avoid newly registered domains, if possible use Google/Twitter/Youtube etc. • Avoid DNS tunneling • Use SSL and outlook/browsers where possible and go low and slow • Avoid new processes and avoid using command line arguments • Avoid Windows utilities – cmd, powershell, net, reg, etc. • Avoid in-memory techniques • Avoid “hacker tools” – Metasploit, CobaltStrike, Mimikatz • Avoid “spraying” credentials • WMI is a better option • Use direct Windows API access where possible • Modify tools/binaries – name, hash, description • Avoid macros/hta files • Social engineering, exploits, webapps are better • Abuse third party services Facebook/Linkedin • Target personal assets instead of corporate assets
  • 28. • Data – OSQuery, GRR, Sysmon, Bro, Event logs • Storage – Elastic • Analytics - ElasticDSL, Kibana, ElastAlert, 411 • Infrastructure – Puppet, Chef, Ansible, Docker DIY Detection