SlideShare a Scribd company logo
Detecting Malicious SSL
Certificates Using Bro
Andrew Beard
Ajit Thyagarajan
Motivation
• SSL traffic is increasing and so is malicious usage!
Motivation
• SSL traffic is increasing and so is malicious usage!
• Content visibility of SSL traffic is becoming increasingly harder
Motivation
• SSL traffic is increasing and so is malicious usage!
• Content visibility of SSL traffic is becoming increasingly harder
• BSides Charm talk – Using Bro IDS to Detect X509 Anomalies by Will
Glodek
Direct application of cert feeds
• Well known SSL cert blacklist, SSLBL by abuse.ch
• Identifies certificates via hash (SHA1)
• Averages about 10 new entries per week
• Relatively high efficacy
David Bianco’s Pyramid Triangle of Pain
• Reflects the pain you
cause to an adversary
• Generating new
certificates (even signed
ones) causes little pain
Using cert feeds and Bro to greater effect
• Use the feeds as a starting point to gather and label data
• Analyze metadata from known bad certificates as a training set
• Treat other certs resulting from other feeds as maybes
• Try to find patterns in the metadata we can use to match as many
known bad and maybes as possible, verify against known (or at least,
heavily biased) good traffic
Why Bro?
• Content awareness
• Ability to apply patterns to live network traffic
• Symmetry on the front and the back end
I don’t have a supercomputer
• I have a 7 year old Dell workstation
my wife’s IT department was
throwing out
• Nothing here would be remotely
considered HPC
Generating training sets
• Visit every potentially malicious site you can possibly find
• OSINT feeds are great for this
• Don’t have a lot of context (if any)
• Look for certificates that match our known bad ones
• “Everything else” creates a data set that isn’t totally trustworthy, use
for testing
Feed
Data
(All)
Fetch
Script
In
Cert
Feed?
Known
Bad
Maybe
Bad
Yes
No
Problems with generating data sets
• Expect a low response rate
• Sites get taken down, not HTTPS port 443, don’t serve anything out,
unregistered DGAs, etc
• Less than 1 in 5000 respond (with no guarantee those responses are
actually bad)
• Number that match on the SSLBL is even worse, and that’s biased
• Based entirely on what’s already labeled as bad
x509.log Fields
• ts
• id
• version
• serial
• subject
• issuer
• not_valid_before
• not_valid_after
• key_alg
• sig_alg
• key_type
• key_length
• exponent
• curve
• san.dns
• san.uri
• san.email
• san.ip
• basic_constraints.ca
• basic_constraints.path_len
Subjects and Issuers
• CN=nycards2016.com,OU=PositiveSSL,OU=Domain Control
Validated
• emailAddress=ha@163.com,CN=gjf,OU=comba,O=comba,L=guang
zhou,ST=china,C=CN
• CN=A_LifeSize_System,C=US,ST=Texas,L=Austin,emailAddres
s=hostmaster@lifesize.com,OU=IT,O=LifeSize
Communications, Inc.
• CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec
Trust Network,O=Symantec Corporation,C=US
• OU=Test,O=Peersec
Networks,L=Bellevue,ST=WA,C=US,CN=MatrixSSL Sample
Server CA
Splitting the Attributes
• Subject and Issuer are the string representations of multiple Attribute
Value Assertions (AVAs)
• Hard to compare them as big strings, but a lot more commonality
once you split them up
• Not hard to parse out each attribute using something like Splunk or
Kiabana, but it makes matching on those fields harder later
• Split the fields into a new Bro log based on x509.log
(x509_extended.log)
Many attributes, but we’re just using a subset
• C Country
• CN Common Name (Site identifier)
• L Locality (City)
• O Organization
• OU Organizational Unit
• ST State (or Province)
• emailAddress
• unstructuredName
• serialNumber
x509_extended
type Info: record {
fuid: string &log;
sha1: string &log;
subject_c: string &log &optional;
subject_cn: string &log &optional;
subject_l: string &log &optional;
subject_o: string &log &optional;
subject_ou: string &log &optional;
subject_st: string &log &optional;
subject_email: string &log &optional;
subject_unstruct: string &log &optional;
subject_serial: string &log &optional;
issuer_c: string &log &optional;
…
}
Need a prototyping system
• Wanted to gather data, then test patterns on the same data sets over
and over
• Could do this with Bro directly, but you don’t really need to reprocess
the packets and sessions over and over again
• Process traffic into Bro logs, evaluate via Splunk or SQL
• May want to apply new certificate feeds to existing logs outside of Bro
Analysis
• Look at data in $VISUALIZATION
• Clustering -> Pattern Synthesis
• Check for hits in the bad table
• Check for hits in the unknown table
• Confirm against a known good set
Examples
Default Values
C ST O emailAddress
AU Some-State Internet Widgits Pty Ltd -
AU Some-State Internet Widgits Pty Ltd chmod 0600 /etc/nginx/ssl/server.key
AU Some-State Internet Widgits Pty Ltd -
openssl Command Defaults
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:
Is it actionable?
• Very strong correlation between sites that were hosting malware or
control nodes, though
• Gozi, Gootkit, Shifu, others have all been identified running from
servers with “Internet Widgits Pty Ltd” certificates
• Non-malicious sites mostly default server pages and sites under
development
• A user visiting a site outside the network could be considered
anomalous
• Default Company Ltd, Default City, also used by some OpenSSL
distributions
Copypasta
sha1 O L ST
1147947433f261bcd2cd8f508461e01898c3960b Dis Springfield Denial
f2a61975cb541e6a62ed8ca5214020108d922a14 Dis Springfield Denial
368e6beb6f8d2f6049831fe25dd397287823c5e6 Dis Springfield Denial
a9650a4522140d42e5ca4529da54805625eebe64 Dis Springfield Denial
• 4 cert feed matches in our original sample set
• SSLBL lists all four as TorrentLocker C2 servers
• 14 others were found with the same ST, L, and O fields (and other
fields not present)
• 5 of those have shown up in the SSLBL feed since
• So far ALL TorrentLocker C2 servers seem to use the same pattern
Where did it come from?
“Random” Values
C CN L O ST
CN TJMauph2wkefdglVFzqmyEvM 3KLyyRWQF0IRfH91yu5frdLX rfUvM2rqVg1P8IpFP2mJbEjD ST
CN RJHeFQ9nCz69k5RNTTLmVCIf gBEUDkp44OE7ihODZD4VbdDv oLsGPV9bx43NaNg1ZjOqIGfJ ST
CN Hcoc6tfYqmEXPnDtwJ39vBFg N9El3p9XpqOBDcqUQxKCbw5V OJ2vl3Vz2Tn0skdsUsLUMwFz ST
CN X5WBo9o5AqvtVGGAVyBiNgwO wHMhVyFMNPcbdG84Q8gKcijH 8V3jDPLZIGdNoOmKQ42ZmhlE ST
CN rQ9YqiO7S1pgULTmD3nNahn7 OBfmruLgjF88LKyg0fVHqRzU zs3L7avZO3gDESogMpf4HBxj ST
• Fixed C and ST values, and exactly 24 character in the CN, L, and O
fields
• Over 27 matches for the same pattern in the “maybe” set
• All C2 nodes from the same malware family
Applying Patterns to Bro
• Wrote collection of bro scripts that load the x509_extended module
• Hooks into an event after subject and issuer subfields have been
parsed out
• Logs to notice.log
Triangle of Pain, Revisited
Recap
• Bro makes it easy to extract certificate metadata
• Using OSINT and Bro you can easily collect large sets of data on bad
and suspect certificates
• Patterns in the certificate metadata can yield higher-value
information than the feeds alone
• Hard to definitively say something is malicious with no context, but
you can get to a high level of confidence
• Since Bro can operate a line speed, it can be used to match against
those patterns with live traffic
Future
• Better ways of applying patterns in Bro (less hardcoding into scripts)
• Certificate analysis has potential for uncovering a lot more patterns
• Better automatic clustering
• BSides DC talk focusing on clustering and analysis (Oct 22, '16)
• Continuing to enhance our collection of good/bad certs
• Looking for collaborators - let us know if you are interested...
Thanks to:
• Abuse.ch
• John Bambenek and Bambenek Consulting
• AlienVault and numerous OTX contributors
• Ravi Pandey from University of Maryland
Questions?
Andrew Beard
andrew@atomicmole.com
Ajit Thyagarajan
ajit@atomicmole.com
Atomic Mole GitHub
https://github.com/atomicmole/brocon2016

More Related Content

PPTX
Analyzing RDP traffc with Bro
PPTX
I See You
PPTX
Hunting Botnets with Zmap
PDF
PacNOG 29: Routing security is more than RPKI
PDF
Death of Web App Firewall
PPTX
Death of WAF - GoSec '15
PPT
Web Services Discovery for Devices
PPTX
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Analyzing RDP traffc with Bro
I See You
Hunting Botnets with Zmap
PacNOG 29: Routing security is more than RPKI
Death of Web App Firewall
Death of WAF - GoSec '15
Web Services Discovery for Devices
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations

What's hot (20)

PDF
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
PDF
Black hat usa_2015-bypass_surgery-6_aug2015
PDF
Internal Pentest: from z3r0 to h3r0
PDF
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...
PPTX
My Bro The ELK
PPTX
Jon Gorenflo - Burp Collaborator
PDF
An Introduction to DANE - Securing TLS using DNSSEC
PPTX
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
PPTX
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
PPTX
External service interaction
PDF
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters
PDF
getdns PyCon presentation
PPTX
Invoke-Obfuscation DerbyCon 2016
PPTX
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
PDF
DANE and Application Uses of DNSSEC
PDF
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
PDF
CNIT 124: Ch 5: Information Gathering
PPTX
Offensive Python for Pentesting
PDF
Carlos García - Pentesting Active Directory Forests [rooted2019]
PPTX
Pentesting Tips: Beyond Automated Testing
Using Algorithms to Brute Force Algorithms...A Journey Through Time and Names...
Black hat usa_2015-bypass_surgery-6_aug2015
Internal Pentest: from z3r0 to h3r0
BlueHat v17 || 28 Registrations Later: Measuring the Exploitation of Residual...
My Bro The ELK
Jon Gorenflo - Burp Collaborator
An Introduction to DANE - Securing TLS using DNSSEC
Dirty Little Secrets They Didn't Teach You In Pentest Class v2
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
External service interaction
2nd ICANN APAC-TWNIC Engagement Forum: Why RPKI Matters
getdns PyCon presentation
Invoke-Obfuscation DerbyCon 2016
BlueHat v17 || TLS 1.3 - Full speed ahead... mind the warnings - the great, t...
DANE and Application Uses of DNSSEC
"Into the Fog The Return of ICEFOG APT" - Chi en (Ashley) Shen
CNIT 124: Ch 5: Information Gathering
Offensive Python for Pentesting
Carlos García - Pentesting Active Directory Forests [rooted2019]
Pentesting Tips: Beyond Automated Testing
Ad

Viewers also liked (18)

PDF
Detecting Malicious Websites using Machine Learning
PPTX
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
PDF
Usage Notes of The Bro 2.2 / 2.3
PPTX
Wireless Investigations using Xplico
PPTX
Giga vue hb1 event rolling presentation-final-1
PPTX
Eyeing the Onion
PDF
Security Onion: peeling back the layers of your network in minutes
PPT
Как сдать IELTS на 8.5?
PPTX
Intro to NSM with Security Onion - AusCERT
PDF
Gigamon 1Q15 Investor Relations Presentation
PPTX
Optimizing your google local listing for search
PDF
DEF CON 23 - NSM 101 for ICS
PDF
Visibility and Automation for Enhanced Security
PPTX
Snort IDS/IPS Basics
PPT
Data Mining and Intrusion Detection
PPTX
Harnessing the Power of Metadata for Security
ODP
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2
PDF
IELTS Writing Common Grammar Mistakes
Detecting Malicious Websites using Machine Learning
Hacker's Practice Ground - Wall of Sheep workshops - Defcon 2015
Usage Notes of The Bro 2.2 / 2.3
Wireless Investigations using Xplico
Giga vue hb1 event rolling presentation-final-1
Eyeing the Onion
Security Onion: peeling back the layers of your network in minutes
Как сдать IELTS на 8.5?
Intro to NSM with Security Onion - AusCERT
Gigamon 1Q15 Investor Relations Presentation
Optimizing your google local listing for search
DEF CON 23 - NSM 101 for ICS
Visibility and Automation for Enhanced Security
Snort IDS/IPS Basics
Data Mining and Intrusion Detection
Harnessing the Power of Metadata for Security
5 Easy Ways to Improve Cohesion in IELTS Writing Task 2
IELTS Writing Common Grammar Mistakes
Ad

Similar to Detecting Malicious SSL Certificates Using Bro (20)

PDF
Unity Makes Strength
PPTX
The Hidden Empires of Malware with TLS Certified Hypotheses and Machine Learning
PDF
Fun With SHA2 Certificates
PDF
Malware Analysis Using Free Software
DOCX
FBI & Secret Service- Business Email Compromise Workshop
PPTX
Believe It Or Not SSL Attacks
PDF
bro - what is in my network?
PDF
Black Hat Dc 09 Marlinspike Defeating Ssl
PPTX
BSides_Charm2015_Info sec hunters_gathers
PDF
June OpenNTF Webinar - Domino V12 Certification Manager
DOCX
FBI & Secret Service- Business Email Compromise Workshop
PDF
1086: The SSL Problem and How to Deploy SHA2 Certificates (with Mark Myers)
PPTX
News bytes Sept-2011
PDF
Infosecurity.be 2019: What are relevant open source security tools you should...
PDF
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
PPTX
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
PDF
Unity Makes Strength SOURCE Dublin 2013
PDF
DEF CON 23 - Wesley McGrew - i hunt penetration testers
PDF
In headers / Padlocks / Certificate authorities / site seals we trust
PPT
Dmk blackops2006
Unity Makes Strength
The Hidden Empires of Malware with TLS Certified Hypotheses and Machine Learning
Fun With SHA2 Certificates
Malware Analysis Using Free Software
FBI & Secret Service- Business Email Compromise Workshop
Believe It Or Not SSL Attacks
bro - what is in my network?
Black Hat Dc 09 Marlinspike Defeating Ssl
BSides_Charm2015_Info sec hunters_gathers
June OpenNTF Webinar - Domino V12 Certification Manager
FBI & Secret Service- Business Email Compromise Workshop
1086: The SSL Problem and How to Deploy SHA2 Certificates (with Mark Myers)
News bytes Sept-2011
Infosecurity.be 2019: What are relevant open source security tools you should...
DEF CON 24 - workshop - Craig Young - brainwashing embedded systems
Fun with Macros & Other Sneaky Tricks to Avoid Detection - SANS Manchester 2020
Unity Makes Strength SOURCE Dublin 2013
DEF CON 23 - Wesley McGrew - i hunt penetration testers
In headers / Padlocks / Certificate authorities / site seals we trust
Dmk blackops2006

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
Teaching material agriculture food technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
cuic standard and advanced reporting.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
Understanding_Digital_Forensics_Presentation.pptx
Teaching material agriculture food technology
Per capita expenditure prediction using model stacking based on satellite ima...
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Programs and apps: productivity, graphics, security and other tools
Building Integrated photovoltaic BIPV_UPV.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Mobile App Security Testing_ A Comprehensive Guide.pdf
Approach and Philosophy of On baking technology
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Encapsulation theory and applications.pdf

Detecting Malicious SSL Certificates Using Bro

  • 1. Detecting Malicious SSL Certificates Using Bro Andrew Beard Ajit Thyagarajan
  • 2. Motivation • SSL traffic is increasing and so is malicious usage!
  • 3. Motivation • SSL traffic is increasing and so is malicious usage! • Content visibility of SSL traffic is becoming increasingly harder
  • 4. Motivation • SSL traffic is increasing and so is malicious usage! • Content visibility of SSL traffic is becoming increasingly harder • BSides Charm talk – Using Bro IDS to Detect X509 Anomalies by Will Glodek
  • 5. Direct application of cert feeds • Well known SSL cert blacklist, SSLBL by abuse.ch • Identifies certificates via hash (SHA1) • Averages about 10 new entries per week • Relatively high efficacy
  • 6. David Bianco’s Pyramid Triangle of Pain • Reflects the pain you cause to an adversary • Generating new certificates (even signed ones) causes little pain
  • 7. Using cert feeds and Bro to greater effect • Use the feeds as a starting point to gather and label data • Analyze metadata from known bad certificates as a training set • Treat other certs resulting from other feeds as maybes • Try to find patterns in the metadata we can use to match as many known bad and maybes as possible, verify against known (or at least, heavily biased) good traffic
  • 8. Why Bro? • Content awareness • Ability to apply patterns to live network traffic • Symmetry on the front and the back end
  • 9. I don’t have a supercomputer • I have a 7 year old Dell workstation my wife’s IT department was throwing out • Nothing here would be remotely considered HPC
  • 10. Generating training sets • Visit every potentially malicious site you can possibly find • OSINT feeds are great for this • Don’t have a lot of context (if any) • Look for certificates that match our known bad ones • “Everything else” creates a data set that isn’t totally trustworthy, use for testing
  • 12. Problems with generating data sets • Expect a low response rate • Sites get taken down, not HTTPS port 443, don’t serve anything out, unregistered DGAs, etc • Less than 1 in 5000 respond (with no guarantee those responses are actually bad) • Number that match on the SSLBL is even worse, and that’s biased • Based entirely on what’s already labeled as bad
  • 13. x509.log Fields • ts • id • version • serial • subject • issuer • not_valid_before • not_valid_after • key_alg • sig_alg • key_type • key_length • exponent • curve • san.dns • san.uri • san.email • san.ip • basic_constraints.ca • basic_constraints.path_len
  • 14. Subjects and Issuers • CN=nycards2016.com,OU=PositiveSSL,OU=Domain Control Validated • emailAddress=ha@163.com,CN=gjf,OU=comba,O=comba,L=guang zhou,ST=china,C=CN • CN=A_LifeSize_System,C=US,ST=Texas,L=Austin,emailAddres s=hostmaster@lifesize.com,OU=IT,O=LifeSize Communications, Inc. • CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US • OU=Test,O=Peersec Networks,L=Bellevue,ST=WA,C=US,CN=MatrixSSL Sample Server CA
  • 15. Splitting the Attributes • Subject and Issuer are the string representations of multiple Attribute Value Assertions (AVAs) • Hard to compare them as big strings, but a lot more commonality once you split them up • Not hard to parse out each attribute using something like Splunk or Kiabana, but it makes matching on those fields harder later • Split the fields into a new Bro log based on x509.log (x509_extended.log)
  • 16. Many attributes, but we’re just using a subset • C Country • CN Common Name (Site identifier) • L Locality (City) • O Organization • OU Organizational Unit • ST State (or Province) • emailAddress • unstructuredName • serialNumber
  • 17. x509_extended type Info: record { fuid: string &log; sha1: string &log; subject_c: string &log &optional; subject_cn: string &log &optional; subject_l: string &log &optional; subject_o: string &log &optional; subject_ou: string &log &optional; subject_st: string &log &optional; subject_email: string &log &optional; subject_unstruct: string &log &optional; subject_serial: string &log &optional; issuer_c: string &log &optional; … }
  • 18. Need a prototyping system • Wanted to gather data, then test patterns on the same data sets over and over • Could do this with Bro directly, but you don’t really need to reprocess the packets and sessions over and over again • Process traffic into Bro logs, evaluate via Splunk or SQL • May want to apply new certificate feeds to existing logs outside of Bro
  • 19. Analysis • Look at data in $VISUALIZATION • Clustering -> Pattern Synthesis • Check for hits in the bad table • Check for hits in the unknown table • Confirm against a known good set
  • 21. Default Values C ST O emailAddress AU Some-State Internet Widgits Pty Ltd - AU Some-State Internet Widgits Pty Ltd chmod 0600 /etc/nginx/ssl/server.key AU Some-State Internet Widgits Pty Ltd -
  • 22. openssl Command Defaults You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]: State or Province Name (full name) [Some-State]: Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]: Organizational Unit Name (eg, section) []: Common Name (e.g. server FQDN or YOUR name) []: Email Address []:
  • 23. Is it actionable? • Very strong correlation between sites that were hosting malware or control nodes, though • Gozi, Gootkit, Shifu, others have all been identified running from servers with “Internet Widgits Pty Ltd” certificates • Non-malicious sites mostly default server pages and sites under development • A user visiting a site outside the network could be considered anomalous • Default Company Ltd, Default City, also used by some OpenSSL distributions
  • 24. Copypasta sha1 O L ST 1147947433f261bcd2cd8f508461e01898c3960b Dis Springfield Denial f2a61975cb541e6a62ed8ca5214020108d922a14 Dis Springfield Denial 368e6beb6f8d2f6049831fe25dd397287823c5e6 Dis Springfield Denial a9650a4522140d42e5ca4529da54805625eebe64 Dis Springfield Denial • 4 cert feed matches in our original sample set • SSLBL lists all four as TorrentLocker C2 servers • 14 others were found with the same ST, L, and O fields (and other fields not present) • 5 of those have shown up in the SSLBL feed since • So far ALL TorrentLocker C2 servers seem to use the same pattern
  • 25. Where did it come from?
  • 26. “Random” Values C CN L O ST CN TJMauph2wkefdglVFzqmyEvM 3KLyyRWQF0IRfH91yu5frdLX rfUvM2rqVg1P8IpFP2mJbEjD ST CN RJHeFQ9nCz69k5RNTTLmVCIf gBEUDkp44OE7ihODZD4VbdDv oLsGPV9bx43NaNg1ZjOqIGfJ ST CN Hcoc6tfYqmEXPnDtwJ39vBFg N9El3p9XpqOBDcqUQxKCbw5V OJ2vl3Vz2Tn0skdsUsLUMwFz ST CN X5WBo9o5AqvtVGGAVyBiNgwO wHMhVyFMNPcbdG84Q8gKcijH 8V3jDPLZIGdNoOmKQ42ZmhlE ST CN rQ9YqiO7S1pgULTmD3nNahn7 OBfmruLgjF88LKyg0fVHqRzU zs3L7avZO3gDESogMpf4HBxj ST • Fixed C and ST values, and exactly 24 character in the CN, L, and O fields • Over 27 matches for the same pattern in the “maybe” set • All C2 nodes from the same malware family
  • 27. Applying Patterns to Bro • Wrote collection of bro scripts that load the x509_extended module • Hooks into an event after subject and issuer subfields have been parsed out • Logs to notice.log
  • 28. Triangle of Pain, Revisited
  • 29. Recap • Bro makes it easy to extract certificate metadata • Using OSINT and Bro you can easily collect large sets of data on bad and suspect certificates • Patterns in the certificate metadata can yield higher-value information than the feeds alone • Hard to definitively say something is malicious with no context, but you can get to a high level of confidence • Since Bro can operate a line speed, it can be used to match against those patterns with live traffic
  • 30. Future • Better ways of applying patterns in Bro (less hardcoding into scripts) • Certificate analysis has potential for uncovering a lot more patterns • Better automatic clustering • BSides DC talk focusing on clustering and analysis (Oct 22, '16) • Continuing to enhance our collection of good/bad certs • Looking for collaborators - let us know if you are interested...
  • 31. Thanks to: • Abuse.ch • John Bambenek and Bambenek Consulting • AlienVault and numerous OTX contributors • Ravi Pandey from University of Maryland
  • 32. Questions? Andrew Beard andrew@atomicmole.com Ajit Thyagarajan ajit@atomicmole.com Atomic Mole GitHub https://github.com/atomicmole/brocon2016

Editor's Notes

  • #2: Hello folks, My name is Ajit Thyagarajan and this is my colleague, Andrew Beard.  We are both from Atomic Mole, a small startup developing a security solution for the mid-market. Before we dive into the guts of this presentation, I thought it would be worthwhile to tell you how we got interested in this work.
  • #3: The statistics are out there.  SSL traffic is on the increase (courtesy Dell).   Expected growth is 20% each year and not surprisingly only a very small percentage of this traffic is analyzed. According to Dell, there was a sharp increase in SSL/TLS encryption through 2015. In the fourth quarter of 2015 nearly 65 percent of all web connections that Dell observed were encrypted, leading to a lot more under-the-radar attacks, according to the company. Gartner has predicted that 50 percent of all network attacks will take advantage of SSL/TLS by 2017.
  • #4: Another interesting statistic is that it is becoming harder and harder to inspect SSL traffic content.  First you need a man-in-the-middle device and then you have to figure out how to manage certificates.  In addition, Certificate pinning and use of complex ciphers make decryption of content even more challenging. A lot of organizations also just do not decrypt SSL traffic due to legal concerns and infringement of privacy for users . [Ref: https://securityevaluators.com/knowledge/case_studies/mutual/] So, all of this points to a need for new innovative ways to analyze SSL traffic for maliciousness without decrypting the content by looking for other clues.
  • #5: So, Andrew and I both attended BSides Baltimore and there was a talk there about detecting anomalies in x.509 certs using bro. Since our security solution uses Bro for network traffic analysis, we figured that it would be a great feature to explore.  So, we listen and it turns out that the main hypothesis of that talk was around the certificate creation time.  The author had hypothesized that if the certificate creation time was some random value like 10am, then there was a high probability of it being malicious mainly because most of the good certs apparently had the creation time as midnight.  Well, that didn't make any sense to us and we decided to really look into this further. Turns out that the default value for creation time (its an optional field during cert creation) is 0, so thats why a lot of the values were showing up as 12:00am.  That validated our theory that the creation time probably didn't have much to do with the maliciousness of a cert. But we left with a burning question - so what attributes could potentially indicate maliciousness (if any) and we thought that there were definitely some attributes that were more likely than not which might be indicative of maliciousness.  We also had to sort of think like a hacker and try and see how and what they might do to get certs as compared to a legitimate organization. In the BSides talk, the author had used 2K good certs and a "handful" of bad certs.  Not sure if this was a good training set in the first place.  So, we decided to go all out with much higher fidelity .  We needed a setup that would pull a very large number of good and bad certs and analyze the heck out of them. One thing I did want to point out is that when our abstract was accepted, we got some great feedback from the reviewers (kudos to them - wish more conferences gave that kind of feedback).  They mentioned that since this was a Bro conference, it would be beneficial to focus more on the Bro aspect of things, so thats  what we did.
  • #6: Talk a little bit about certificate feeds, as these become very important to information gathering process as you’ll see in a moment Mostly commodity C2 servers, Dridex, Dyre, TorrentLocker, etc 10/week excludes Dyre High efficacy -> Ground truth
  • #7: Pain on adversary by denying them access to X Not just for self-signed certs anymore. Mention the rise of Let’s Encrypt and other no-cost ways of getting legit certificates. As a network defender, I want to cause pain. How do we cause pain? Identify adversary's process and tools Make them identify and change things that take time and effort
  • #8: We can do better, enriching feed data and processing results Not just cert feeds, but they’re my confirmed bads What do I mean by resulting from? Refer to next side
  • #9: Could have scripted something with curl, openssl, and a lot of parsing Combine Bro for research and monitoring after the fact Talk about feedback loop, bro -> pattern generating process -> back into bro
  • #10: Tours of my datacenter usually begin with someone asking “What’s making that noise?”
  • #11: All x509 certificates end up in files table with sha1s By isn’t totally trustworthy, I mean we don’t for use it’s malicious. Things move, takedown pages, etc
  • #13: Response rate on the order of most telemarketers This is a funnel, start wide, end up with few final results. Match rate is biased because our feeds include other Abuse.ch feeds, so there’s a better chance than looking at other sources
  • #14: Mention Bsides Charm talk concentrated on not_valid_after and not_valid_before Not scalar, categorical
  • #15: Ran into problems with initial analysis, not a lot of commonality. There is structure here. Separate attributes with key and value pairs
  • #16: Yes, we’ll make it a package
  • #17: ALL optional
  • #19: Last point, feeds change. I’ve already processed the data, tell me given what I know know about the things that happened then
  • #20: Look at data -> common elements. Values that recur. Every single attribute you have, sort by count Start with a bad record, spider out of other similar records Next steps -> automation. Still working on getting good results there. Known good, baseline set of traffic you trust. With a lot number of results it’s always the possibility that your “known good” traffic isn’t that good, so review to be sure.
  • #22: The email address part didn’t make a lot of sense until we tried generating a certificate with the openssl command
  • #23: Alex Kirk blog post talking about Snort signature, Talos Netresec, post on https reverse tunnel Note about the email address going off the end of the command. Probably not an automated system. Also saw results for Default Company Ltd, some versions of openssl use this by default instead
  • #24: These aren’t malicious, but there’s a higher proibability of something bad going on
  • #27: Not all patterns are in the values themselves, some are in the form Difficult to do via automated analysis Entropy calculation on text would probably show very high value
  • #28: What’s the best way to do these? Not really part of intel framework as I understand it.
  • #29: Longer shelf life. Issuing new certs part of brining up new domains, but if the patterns don’t change puts you a step ahead.
  • #30: Try to piece together why. Easy to create patterns that are coincidental.
  • #32: Special thanks to Ravi Pandey, one of our summer interns from UMD, who spent a fair bit of time with the certificates applying trying various ML algorithms on multiple versions of our dataset.