SlideShare a Scribd company logo
1 of 44
Abusing “Accepted Risk” With
3rd-Party Command and Control
(C2)
Justin Warner
Jon Perez
$whoami
Justin Warner - @sixdub
■ Computer Science grad from USAF
Academy & former USAF Cyber Guy
■ Former: Red Team Lead w/ Adaptive Threat
Div
■ Current: Principal Security Engineer at
ICEBRG
■ Co-founder of PowerShell Empire and
contributor on numerous open-source
projects
■ BlackHat USA Instructor in 2015 & 2016
$whoami
Jon Perez (JP)
■ Army Veteran and part-time grad student
■ Former: Army Cyber Ops Specialist
■ Current: Security Research Engineer at
IronNet Cybersecurity
■ First time conference presenter (be kind)
■ True tinkerer who spends his free time
diving head first into malware and
malicious network flows
Disclaimer
■ We are not data scientists
■ We are not mathematicians
■ We are not all-knowing
■ We are amateurs/n00bs
■ We have not seen your networks
• Although we have seen many like it
■ We are not the first people to
research these techniques
Hold Up...
What is this about?!
Who Are The Adversaries?
Methods of Infrastructure
■Utilize paid services
• Digital ocean, AWS, Azure, etc
■Utilize bare metal
• Buy dedicated servers around the world
■Utilize previously compromised
infrastructure
• Hack people to hack other people
■Utilize 3rd parties
• Utilize techniques to bend traffic in
“legitimate” ways
Break… It… Down
“Accepted Risk” of allowing various services
■ Organizations are constantly fighting the battle
of risk vs reward
• Workplace culture and satisfaction
■ Do the technical controls match policy rules?
■ Some services are considered productive vs
traditional social media
Let me illustrate this for you…
When Did This Become Okay?
CTO
CIO
CISO
Network Security Team
Break… It… Down...
“3rd Party C2”
■ The use of neutral services as a means of
C2
• Uses API or programmatic interaction
■ Useful throughout the killchain
Put It Together
“Social media and storage services are a must
for my standard users and marketing team”
(Reward > Risk) ∴ Adversaries Abuse
Services
Real World Case
Studies
Lessons from “the field”
Case Study #1: APT 29 & Twitter+Github+Stego
git.io/vHegd
#viper098
exfil.ps1
Case Study #2: Icoscript Malware & Yahoo Mail
djiwdE@FHU
#DJwd3i2jdi3
2dm23idm3i2
Decrypts “script” from .ico file
IE COM Object
Yahoo Mail Account
Check Inbox
For
Commands
Send Email
w/Exfil
Uses Script To Command
Fake User Interaction
Case Study #3: CloudAtlas & CloudMe
Webdav Connection
Implant Activities
webdav.cloudme.com<Username>CloudDrive
Encrypted C2 & Exfil
Victim Folders
Case Study #4: Random Phish & Google Forms
System Survey w/ WMI & Environment
Win32_Processor
Win32_OperatingSystem
ENV Variables: USERNAME, COMPUTERNAME, USERDOMAIN
1
2
3
Threat Replication
… and how we can do it!
What is Adversary Emulation?
■A type of red teaming that focuses on
the emulation of a specific adversaries
• Utilize intel to model the adversary
• Highly realistic tools
• Attempt to behave as they have before
• Works against networks and products
■Some weaknesses to this approach
• Risk of handcuffing the red team
• Easy to study tools, hard to emulate
tactics/techniques (lack of real intel)
Existing Tools
■ Surprise… we are not the only ones
doing this:
• GCat - Shell over gmail
• Empire 2.0 - Able to do custom C2 modules
including 3rd party apps
• DropSmack - C2 over Dropbox sync folder
• Instegogram - C2 over Instagram with stego
■ We are using our POCs to prove a point
• Not weaponized
• More time should be spent with realistic IOAs
(known unknowns) rather than threat data feeds
“
You: Justin/Jon… I can stop your POCs… I
block PowerShell!
Me: Can you block all C exes? How about
legit signed C++ exes? How about .dll
files? How about py2exe? Can you do so
without impacting business? If so, we
should talk.
I know you can defeat my POCs.
MAKE CALC.EXE GREAT AGAIN!
CloudMe WebDav C2
Google Mail COM Object C2
Google Sheets C2
Dropbox API C2
Twitter COM C2
Detecting Threats
#BigData
“
“I can’t possibly capture that amount of data…”
“How will we be able to parse and process the data quick
enough?”
“I don’t even know where all of my endpoints are let alone am
I able to collect from them”
“All I end up with is a giant collection of telemetry, what is that
useful for… what do we go look for?”
“99/100 times, I spend hours looking at false positives”
I didn’t say this was easy…
If User Can Do It, So Can APT
I didn’t say this was easy…
Define “Normal”
I didn’t say this was easy…
What You Need To Find Evil
■Wide swath of data with a statistically
significant sample size
• Ongoing collection is helpful
■Collaborative data is helpful (host/net)
• Hunting is easier with a full picture
• SSL terminating might give more info but…
privacy
■Ability to rapidly ingest, parse, and
analyze data to prevent relevant
information
Information Process
Context Enrichment
Intel Information
Intel
Raw Data
Examples of Data Sources (Not All Inclusive)
■Network
• PCAP / Span off of core switch and egress
• DNS logs or passive DNS
• Netflow
• Proxy logs
• Internal Threat Intel (Sandbox Detonation)
■Endpoint (eventing is best)
• Process listing events
• Network connection events
• DNS lookup events
• Service add/removal events
• Program install / uninstall events
Data Enrichment Sources
■ Data helps you draw a picture but does not turn it
into a movie
• Enriching the data makes it significantly more useful
■ Any question you would normally ask about an
indicator… someone else has probably thought of
it! (Enrich)
• REST APIs
• Free Sources of Info
• Internal Info
■ If not, try to calculate or look up the information
yourself (correlate / contextualize)
Indicator of Compromise (IOC) vs Attack (IOA)
IOC - Evidence or artifact on a computer
that indicates that the system/network has
been compromised [breached]
Has been focused on data aka IP address, hash, C2
domain, etc
IOA - Series of actions or events that
indicates malicious action is ongoing
Usually chains together data points into an analytic
that indicates progression in the kill chain
Endpoint Based: Binary Signature Heuristics w/DNS
■Signature hygiene has significantly
increased through the years
■Should unsigned code be reaching out
to the internet? Can we detect on it?
Network Based: Timestamp Analysis & Beaconing
■Assuming you have an analytic to
determine periodicity
■Establish a baseline for nodes in the
environment
Network Based: API Token & Host Pairing
■SSL termination is a risk/reward
tradeoff
• Lets just assume you do SSL termination and
collect metadata or PCAP
Endpoint Based: Network & Process Correlation
■Next-Gen EDR “X” usually has
eventing capability (or you can use
event logs)
• ETW is a great built-in capability for defensive
teams to collect eventing data from
environment!
Should powershell.exe be reaching out to Dropbox API?
Network Based: Flow Abnormalities
So What?
Takeaways
Wrapping Up
■Threat actors are creative and will find
ways to use your weaknesses
■3rd party services make for quick and
easy C2 or exfiltration vectors
■Detecting the use of 3rd party services
for C2 is difficult
• Requires foundational network collection
• Attacker activity will often come in a series of
behaviors to create a pattern
• Need to look for anomalous activity
THANKS!
Feel free to reach out with questions
or share ideas…
justin@sixdub.net
johnny.nohandle@gmail.com
Off to the beach…
CREDITS
Case Study 1: https://www2.fireeye.com/rs/848-DID-242/images/rpt-
apt29-hammertoss.pdf
Case Study 2:
https://www.virusbulletin.com/virusbulletin/2014/08/icoscript-using-
webmail-control-malware
Case Study 3: https://threatpost.com/red-october-attackers-return-with-
cloudatlas-apt-campaign/109806/
Case Study 4: @JohnLaTwC (and the real authors)
Slide Template: slidecarnival.com

More Related Content

What's hot

Ariu - Ph.D. Defense Slides
Ariu - Ph.D. Defense SlidesAriu - Ph.D. Defense Slides
Ariu - Ph.D. Defense Slides
Pluribus One
 
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Zoltan Balazs
 
[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi
[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi
[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi
CODE BLUE
 
[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...
[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...
[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...
CODE BLUE
 

What's hot (20)

BSidesLV 2016 - Powershell - Hunting on the Endpoint - Gerritz
BSidesLV 2016 - Powershell - Hunting on the Endpoint - GerritzBSidesLV 2016 - Powershell - Hunting on the Endpoint - Gerritz
BSidesLV 2016 - Powershell - Hunting on the Endpoint - Gerritz
 
DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...
DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...
DNS – Strategies for Reducing Data Leakage & Protecting Online Privacy – Hack...
 
DNS Security, is it enough?
DNS Security, is it enough? DNS Security, is it enough?
DNS Security, is it enough?
 
Are your cloud servers under attack?– Hacker Halted 2019 – Brian Hileman
Are your cloud servers under attack?– Hacker Halted 2019 – Brian HilemanAre your cloud servers under attack?– Hacker Halted 2019 – Brian Hileman
Are your cloud servers under attack?– Hacker Halted 2019 – Brian Hileman
 
Incident Response for the Work-from-home Workforce
Incident Response for the Work-from-home WorkforceIncident Response for the Work-from-home Workforce
Incident Response for the Work-from-home Workforce
 
Ariu - Ph.D. Defense Slides
Ariu - Ph.D. Defense SlidesAriu - Ph.D. Defense Slides
Ariu - Ph.D. Defense Slides
 
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
Hacktivity 2016: The real risks of the IoT security-nightmare: Hacking IP cam...
 
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
 
Shamoon
ShamoonShamoon
Shamoon
 
Breach and attack simulation tools
Breach and attack simulation toolsBreach and attack simulation tools
Breach and attack simulation tools
 
[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi
[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi
[CB20] Explainable malicious domain diagnosis by Tsuyoshi Taniguchi
 
Anti-Forensic Rootkits
Anti-Forensic RootkitsAnti-Forensic Rootkits
Anti-Forensic Rootkits
 
Inside Cybercrime Groups Harvesting Active Directory for Fun and Profit - Vit...
Inside Cybercrime Groups Harvesting Active Directory for Fun and Profit - Vit...Inside Cybercrime Groups Harvesting Active Directory for Fun and Profit - Vit...
Inside Cybercrime Groups Harvesting Active Directory for Fun and Profit - Vit...
 
Presentation
PresentationPresentation
Presentation
 
DNS Security Threats and Solutions
DNS Security Threats and SolutionsDNS Security Threats and Solutions
DNS Security Threats and Solutions
 
[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...
[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...
[CB20] Operation Chimera - APT Operation Targets Semiconductor Vendors by CK ...
 
Days of the Honeynet: Attacks, Tools, Incidents
Days of the Honeynet: Attacks, Tools, IncidentsDays of the Honeynet: Attacks, Tools, Incidents
Days of the Honeynet: Attacks, Tools, Incidents
 
GreyNoise - Lowering Signal To Noise
GreyNoise - Lowering Signal To NoiseGreyNoise - Lowering Signal To Noise
GreyNoise - Lowering Signal To Noise
 
CheckPoint: Anatomy of an evolving bot
CheckPoint: Anatomy of an evolving botCheckPoint: Anatomy of an evolving bot
CheckPoint: Anatomy of an evolving bot
 
[HITCON 2020 CTI Village] Threat Hunting and Campaign Tracking Workshop.pptx
[HITCON 2020 CTI Village] Threat Hunting and Campaign Tracking Workshop.pptx[HITCON 2020 CTI Village] Threat Hunting and Campaign Tracking Workshop.pptx
[HITCON 2020 CTI Village] Threat Hunting and Campaign Tracking Workshop.pptx
 

Similar to Abusing "Accepted Risk" With 3rd Party C2 - HackMiamiCon5

03.fnc corporate protect workshop new
03.fnc corporate protect workshop new03.fnc corporate protect workshop new
03.fnc corporate protect workshop new
forensicsnation
 
FNC Corporate Protect Workshop
FNC Corporate Protect WorkshopFNC Corporate Protect Workshop
FNC Corporate Protect Workshop
forensicsnation
 
AktaionPPTv5_JZedits
AktaionPPTv5_JZeditsAktaionPPTv5_JZedits
AktaionPPTv5_JZedits
Rod Soto
 
Hunting: Defense Against The Dark Arts v2
Hunting: Defense Against The Dark Arts v2Hunting: Defense Against The Dark Arts v2
Hunting: Defense Against The Dark Arts v2
Spyglass Security
 

Similar to Abusing "Accepted Risk" With 3rd Party C2 - HackMiamiCon5 (20)

Threat Hunting with Splunk
Threat Hunting with Splunk Threat Hunting with Splunk
Threat Hunting with Splunk
 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
 
Using Big Data to Counteract Advanced Threats
Using Big Data to Counteract Advanced ThreatsUsing Big Data to Counteract Advanced Threats
Using Big Data to Counteract Advanced Threats
 
Threat Hunting with Splunk
Threat Hunting with SplunkThreat Hunting with Splunk
Threat Hunting with Splunk
 
Smart Bombs: Mobile Vulnerability and Exploitation
Smart Bombs: Mobile Vulnerability and ExploitationSmart Bombs: Mobile Vulnerability and Exploitation
Smart Bombs: Mobile Vulnerability and Exploitation
 
03.fnc corporate protect workshop new
03.fnc corporate protect workshop new03.fnc corporate protect workshop new
03.fnc corporate protect workshop new
 
FNC Corporate Protect
FNC Corporate ProtectFNC Corporate Protect
FNC Corporate Protect
 
Cloud Intrusion Detection Reloaded - 2018
Cloud Intrusion Detection Reloaded - 2018Cloud Intrusion Detection Reloaded - 2018
Cloud Intrusion Detection Reloaded - 2018
 
FNC Corporate Protect Workshop
FNC Corporate Protect WorkshopFNC Corporate Protect Workshop
FNC Corporate Protect Workshop
 
Bsides 2019 - Intelligent Threat Hunting
Bsides 2019 - Intelligent Threat HuntingBsides 2019 - Intelligent Threat Hunting
Bsides 2019 - Intelligent Threat Hunting
 
SplunkLive! Stockholm 2015 breakout - Analytics based security
SplunkLive! Stockholm 2015 breakout - Analytics based securitySplunkLive! Stockholm 2015 breakout - Analytics based security
SplunkLive! Stockholm 2015 breakout - Analytics based security
 
technical-information-gathering-slides.pdf
technical-information-gathering-slides.pdftechnical-information-gathering-slides.pdf
technical-information-gathering-slides.pdf
 
Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016
 
Introduction To Information Security
Introduction To Information SecurityIntroduction To Information Security
Introduction To Information Security
 
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
 
Cybersecurity - Jim Butterworth
Cybersecurity - Jim ButterworthCybersecurity - Jim Butterworth
Cybersecurity - Jim Butterworth
 
FireSIGHT Management Center (FMC) slides
FireSIGHT Management Center (FMC) slidesFireSIGHT Management Center (FMC) slides
FireSIGHT Management Center (FMC) slides
 
AktaionPPTv5_JZedits
AktaionPPTv5_JZeditsAktaionPPTv5_JZedits
AktaionPPTv5_JZedits
 
Advanced malware analysis training session3 botnet analysis part2
Advanced malware analysis training session3 botnet analysis part2Advanced malware analysis training session3 botnet analysis part2
Advanced malware analysis training session3 botnet analysis part2
 
Hunting: Defense Against The Dark Arts v2
Hunting: Defense Against The Dark Arts v2Hunting: Defense Against The Dark Arts v2
Hunting: Defense Against The Dark Arts v2
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Abusing "Accepted Risk" With 3rd Party C2 - HackMiamiCon5

  • 1. Abusing “Accepted Risk” With 3rd-Party Command and Control (C2) Justin Warner Jon Perez
  • 2. $whoami Justin Warner - @sixdub ■ Computer Science grad from USAF Academy & former USAF Cyber Guy ■ Former: Red Team Lead w/ Adaptive Threat Div ■ Current: Principal Security Engineer at ICEBRG ■ Co-founder of PowerShell Empire and contributor on numerous open-source projects ■ BlackHat USA Instructor in 2015 & 2016
  • 3. $whoami Jon Perez (JP) ■ Army Veteran and part-time grad student ■ Former: Army Cyber Ops Specialist ■ Current: Security Research Engineer at IronNet Cybersecurity ■ First time conference presenter (be kind) ■ True tinkerer who spends his free time diving head first into malware and malicious network flows
  • 4. Disclaimer ■ We are not data scientists ■ We are not mathematicians ■ We are not all-knowing ■ We are amateurs/n00bs ■ We have not seen your networks • Although we have seen many like it ■ We are not the first people to research these techniques
  • 5. Hold Up... What is this about?!
  • 6. Who Are The Adversaries?
  • 7. Methods of Infrastructure ■Utilize paid services • Digital ocean, AWS, Azure, etc ■Utilize bare metal • Buy dedicated servers around the world ■Utilize previously compromised infrastructure • Hack people to hack other people ■Utilize 3rd parties • Utilize techniques to bend traffic in “legitimate” ways
  • 8. Break… It… Down “Accepted Risk” of allowing various services ■ Organizations are constantly fighting the battle of risk vs reward • Workplace culture and satisfaction ■ Do the technical controls match policy rules? ■ Some services are considered productive vs traditional social media Let me illustrate this for you…
  • 9. When Did This Become Okay? CTO CIO CISO Network Security Team
  • 10. Break… It… Down... “3rd Party C2” ■ The use of neutral services as a means of C2 • Uses API or programmatic interaction ■ Useful throughout the killchain
  • 11. Put It Together “Social media and storage services are a must for my standard users and marketing team” (Reward > Risk) ∴ Adversaries Abuse Services
  • 12. Real World Case Studies Lessons from “the field”
  • 13. Case Study #1: APT 29 & Twitter+Github+Stego git.io/vHegd #viper098 exfil.ps1
  • 14. Case Study #2: Icoscript Malware & Yahoo Mail djiwdE@FHU #DJwd3i2jdi3 2dm23idm3i2 Decrypts “script” from .ico file IE COM Object Yahoo Mail Account Check Inbox For Commands Send Email w/Exfil Uses Script To Command Fake User Interaction
  • 15. Case Study #3: CloudAtlas & CloudMe Webdav Connection Implant Activities webdav.cloudme.com<Username>CloudDrive Encrypted C2 & Exfil Victim Folders
  • 16. Case Study #4: Random Phish & Google Forms System Survey w/ WMI & Environment Win32_Processor Win32_OperatingSystem ENV Variables: USERNAME, COMPUTERNAME, USERDOMAIN 1 2 3
  • 17. Threat Replication … and how we can do it!
  • 18. What is Adversary Emulation? ■A type of red teaming that focuses on the emulation of a specific adversaries • Utilize intel to model the adversary • Highly realistic tools • Attempt to behave as they have before • Works against networks and products ■Some weaknesses to this approach • Risk of handcuffing the red team • Easy to study tools, hard to emulate tactics/techniques (lack of real intel)
  • 19. Existing Tools ■ Surprise… we are not the only ones doing this: • GCat - Shell over gmail • Empire 2.0 - Able to do custom C2 modules including 3rd party apps • DropSmack - C2 over Dropbox sync folder • Instegogram - C2 over Instagram with stego ■ We are using our POCs to prove a point • Not weaponized • More time should be spent with realistic IOAs (known unknowns) rather than threat data feeds
  • 20. “ You: Justin/Jon… I can stop your POCs… I block PowerShell! Me: Can you block all C exes? How about legit signed C++ exes? How about .dll files? How about py2exe? Can you do so without impacting business? If so, we should talk. I know you can defeat my POCs.
  • 23. Google Mail COM Object C2
  • 28. “ “I can’t possibly capture that amount of data…” “How will we be able to parse and process the data quick enough?” “I don’t even know where all of my endpoints are let alone am I able to collect from them” “All I end up with is a giant collection of telemetry, what is that useful for… what do we go look for?” “99/100 times, I spend hours looking at false positives” I didn’t say this was easy…
  • 29. If User Can Do It, So Can APT I didn’t say this was easy…
  • 30. Define “Normal” I didn’t say this was easy…
  • 31. What You Need To Find Evil ■Wide swath of data with a statistically significant sample size • Ongoing collection is helpful ■Collaborative data is helpful (host/net) • Hunting is easier with a full picture • SSL terminating might give more info but… privacy ■Ability to rapidly ingest, parse, and analyze data to prevent relevant information
  • 32. Information Process Context Enrichment Intel Information Intel Raw Data
  • 33. Examples of Data Sources (Not All Inclusive) ■Network • PCAP / Span off of core switch and egress • DNS logs or passive DNS • Netflow • Proxy logs • Internal Threat Intel (Sandbox Detonation) ■Endpoint (eventing is best) • Process listing events • Network connection events • DNS lookup events • Service add/removal events • Program install / uninstall events
  • 34. Data Enrichment Sources ■ Data helps you draw a picture but does not turn it into a movie • Enriching the data makes it significantly more useful ■ Any question you would normally ask about an indicator… someone else has probably thought of it! (Enrich) • REST APIs • Free Sources of Info • Internal Info ■ If not, try to calculate or look up the information yourself (correlate / contextualize)
  • 35. Indicator of Compromise (IOC) vs Attack (IOA) IOC - Evidence or artifact on a computer that indicates that the system/network has been compromised [breached] Has been focused on data aka IP address, hash, C2 domain, etc IOA - Series of actions or events that indicates malicious action is ongoing Usually chains together data points into an analytic that indicates progression in the kill chain
  • 36. Endpoint Based: Binary Signature Heuristics w/DNS ■Signature hygiene has significantly increased through the years ■Should unsigned code be reaching out to the internet? Can we detect on it?
  • 37. Network Based: Timestamp Analysis & Beaconing ■Assuming you have an analytic to determine periodicity ■Establish a baseline for nodes in the environment
  • 38. Network Based: API Token & Host Pairing ■SSL termination is a risk/reward tradeoff • Lets just assume you do SSL termination and collect metadata or PCAP
  • 39. Endpoint Based: Network & Process Correlation ■Next-Gen EDR “X” usually has eventing capability (or you can use event logs) • ETW is a great built-in capability for defensive teams to collect eventing data from environment! Should powershell.exe be reaching out to Dropbox API?
  • 40. Network Based: Flow Abnormalities
  • 42. Wrapping Up ■Threat actors are creative and will find ways to use your weaknesses ■3rd party services make for quick and easy C2 or exfiltration vectors ■Detecting the use of 3rd party services for C2 is difficult • Requires foundational network collection • Attacker activity will often come in a series of behaviors to create a pattern • Need to look for anomalous activity
  • 43. THANKS! Feel free to reach out with questions or share ideas… justin@sixdub.net johnny.nohandle@gmail.com Off to the beach…
  • 44. CREDITS Case Study 1: https://www2.fireeye.com/rs/848-DID-242/images/rpt- apt29-hammertoss.pdf Case Study 2: https://www.virusbulletin.com/virusbulletin/2014/08/icoscript-using- webmail-control-malware Case Study 3: https://threatpost.com/red-october-attackers-return-with- cloudatlas-apt-campaign/109806/ Case Study 4: @JohnLaTwC (and the real authors) Slide Template: slidecarnival.com