SlideShare a Scribd company logo
1 of 44
Paul Melson Two-For-One Talk:Malware Analysis for Everyone
MWA-101: Five Automated Analysis Tools You should Know
Why Do Malware Analysis? Client-side attacks that install malware are the #1 external threat. It’s not slowing down any time soon: “Symantec observed an average of 75,158 active bot-infected computers per day in 2008, an increase of 31% from the previous period.” “In 2008, Symantec created 1,656,227 new malicious code signatures. This is a 265% increase over 2007.” 		(Source: Symantec Internet Threat Report, April 2009)
Firewalls and Anti-Virus Have Lost Client-side attacks against web browsers and e-mail go right through most firewall policies Detection rates for current malware files by market leading anti-virus scanners are averaging 30-50% If you’re not adapting some other way, you’ve lost
Malware is Adapting Quickly Take away Local Administrator privileges? Malware that persists in HKCU Registry keys or StartUp group Whitelist apps with Windows Firewall? Malware that hooks into Internet Explorer plugin APIs Block IRC at the firewall? Malware that uses encrypted HTTP/HTTPS back-channels
“But it’s just spyware, right?” In the past 2 years, we’ve found malware in the wild that: Sends hundreds of spam e-mail messages per second Gives bot “herder” full desktop remote control Searches files in “Documents and Settings” for SSNs, credit card numbers, and saved Internet Explorer passwords Records all screen and text input and reports it in real-time to a server in Russia
VirusTotalhttp://www.virustotal.com Upload a suspicious file, they scan it with 40+ different anti-virus products using current signatures Pretty much everybody, except TrendMicro Useful for determining if a file is malicious Also for determining whether your anti-virus would detect a particular file Take advantage of heuristic/edge products without all of the false positives in production OK, but not great for brand new or custom malware Not great for obfuscated exploits, better with binaries
CWSandboxhttp://www.cwsandbox.org Upload a suspicious Windows executable, they run it in their sandbox and tell you what it did Great for figuring out what a file actually does It doesn’t establish malicious vs. benign, that’s up to you Requires some detailed understanding of  Windows Registry, processes, file system to interpret report Some malware can detect this and other sandboxes, and won’t run Other similar services Norman Sandbox JoeBox
Threat Expert http://www.threatexpert.com Upload a suspicious Windows binary, they analyze it Supports web submission, but also Windows applet Must register to submit samples Combines the features of CWSandbox and VirusTotal Anti-virus scan File / registry modifications Packer identification Browse reports and statistics from other submitted files
Wepawethttp://wepawet.iseclab.org Upload a suspicious PDF, HTML, or Flash file, or submit a suspicious URL and it will analyze it for malicious JavaScript. Great for working with obfuscated JavaScript where reversing and debugging is complex and time-intensive. However, some forms of obfuscation, especially in PDF and SWF files, can be used to beat it.
Comodohttp://camas.comodo.com Upload a suspicious Windows binary, they analyze it for you Similar to CWSandbox Very fast Relatively new/unknown, so less likely to be targeted for evasion  (Assuming they use technology different enough from Norman, CWSandbox)
MWA-101: Q&A
MWA-405: Unpacking PDF Exploit Payloads
PDF Files and Malware Malware relies on two methods to install Exploiting a browser vulnerability Tricking people into running a file Adobe Acrobat Reader is, right now, the most reliably vulnerable piece of software in the world It’s really hard to patch across the enterprise Predecessors: Internet Explorer QuickTime Player Adobe Flash Player
They Don’t Call it Pwndobe for Nothing Tuesday’s Acrobat Reader security bulletin That’s 29 unique vulnerabilities, in case you’re keeping score
PDF as an Attack Vector Acrobat Reader is executable from the web browser Called as a browser plugin via COM There is an IE killbit, but I dare you to use it in a business Each version of Acrobat Reader has its own CLSID, and killbit The PDF file format supports scripting and obfuscation  JavaScript Embedding binary objects and scripts as streams Compressing and encoding these streams These are the same things that made Flash a good attack vector, so you may have some idea as to what’s next
PDF With Malicious Payload PDF file header including JavaScript trigger
PDF With Malicious Payload PDF file body showing binary FlateDecode stream Note the /Filter and /Length tags
Unpacking FlateDecode Streams  FlateDecode is stream compression using zlib compress() Several tools can decompress and extract the streams for you PDF Stream Inflater by Bobby Spasic (Malzilla) Not available for download anymore pdftk by Sid Steward (AccessPDF) Not specifically for malware http://www.accesspdf.com/pdftk/ pdf-parser.py by Didier Stevens This guy writes all sorts of awesome tools http://blog.didierstevens.com/programs/pdf-tools/
Unpacking FlateDecode Streams  Using PDF Stream Inflater to extract FlateDecode stream
Unpacking FlateDecode Streams  Viewing decoded stream containing obfuscated JavaScript
Unpacking FlateDecode Streams  Pipe extracted stream through Didier Stevens’ SpiderMonkey mod The log files contain the output of the obfuscated JavaScript
Unpacking FlateDecode Streams  Look! More JavaScript, but this time it’s readable. Hmmm, I wonder…
Unpacking FlateDecode Streams  Oh, look, they copied the exploit from milw0rm.
Beyond FlateDecode Different versions of the PDF file standard support additional forms of encoding streams ASCIIHexDecode ASCII85Decode Encoding methods can be combined on a single stream Order of operations matters! Two methods for extracting and decoding: Manually decode Hex stream to zlib binary stream, reinsert, resize header, basically recreating the PDF as if it only contained the FlateDecode stream, then extract with inflater.exe      (this sucks, BTW) Use pdf-parser.py
Beyond FlateDecode This stream is encoded with ASCIIHexDecode and FlateDecode
Beyond FlateDecode We decode the stream and find more obfuscated JavaScript ./pdf-parser.py -f boBAn.pdf | less
Beyond FlateDecode Throw <html> and <script> tags around the obfuscated JavaScript and upload it to Wepawet
Beyond FlateDecode Ooh, second stage executable downloads!
Beyond FlateDecode - Epilogue From the time that I started this research to the time I wrote this presentation, Wepawet has added support for ASCIIHexDecode in PDF files So, yes, the hours of work I did on this can be replicated in mere seconds with only a web browser But this underscores the ongoing arms race between security researchers and malware vendors That’s right, I said vendors
Some Extra Fun whois goodshoot1.com Note the goofy domain on those name servers
Some Extra Fun So we search malwareurl.com for that domain, and…
Some Extra Fun YES is a crimeware system made in Russia This is the login page for its web console
Network Detection Easy enough to find PDF files that use encoded streams with your IDS/IPS Your firewall and proxy logs are a good place to look, too Most sites hosting second-stage malware are in foreign countries, especially Russia, China Use language to your advantage – if your employees speak English, then documents downloaded from countries that don’t speak English could be suspicious
Network Detection alert tcp $EXTERNAL_NET 80 -> $HOME_NET any (msg:"LOCAL PDF mailto exploit HTTP download"; flow:from_server,established; content:"%PDF"; nocase; content:"RI(mailto:%/"; nocase; classtype:trojan-activity; sid:9000140; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL PDF with FlateDecode stream download"; flow:from_server,established; content:"%PDF"; content:"FlateDecode"; nocase; classtype:trojan-activity; sid:90000190; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL PDF with ASCIIHexDecode stream download"; flow:from_server,established; content:"%PDF"; content:"ASCIIHexDecode"; nocase; classtype:trojan-activity; sid:90000191; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL PDF with ASCII85Decode stream download"; flow:from_server,established; content:"%PDF"; content:"ASCII85Decode"; nocase; classtype:trojan-activity; sid:90000192; rev:1;) Snort rules to detect suspicious PDF files
Network Detection Firewall events for PDFs downloaded from countries other than the US, UK, and Canada
pmelson@gmail.com http://pmelson.blogspot.com Special Thanks to Sean Koessel MWA-405: Q&A

More Related Content

What's hot

Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?"
Introduction to Dynamic Malware Analysis   ...Or am I "Cuckoo for Malware?"Introduction to Dynamic Malware Analysis   ...Or am I "Cuckoo for Malware?"
Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?"Lane Huff
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseTakahiro Haruyama
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesCNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesSam Bowne
 
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesSam Bowne
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginTakahiro Haruyama
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXTakahiro Haruyama
 
Malware analysis - What to learn from your invaders
Malware analysis - What to learn from your invadersMalware analysis - What to learn from your invaders
Malware analysis - What to learn from your invadersTazdrumm3r
 
Malware Analysis Made Simple
Malware Analysis Made SimpleMalware Analysis Made Simple
Malware Analysis Made SimplePaul Melson
 
openioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsopenioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsTakahiro Haruyama
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Sam Bowne
 
Malware Analysis 101 - N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...
Malware Analysis 101 -  N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...Malware Analysis 101 -  N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...
Malware Analysis 101 - N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...grecsl
 
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Sam Bowne
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgSam Bowne
 
SANS Windows Artifact Analysis 2012
SANS Windows Artifact Analysis 2012SANS Windows Artifact Analysis 2012
SANS Windows Artifact Analysis 2012Rian Yulian
 
Basic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareBasic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareNatraj G
 
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an..."Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...SegInfo
 
Investigating Hackers' Tools
Investigating Hackers' ToolsInvestigating Hackers' Tools
Investigating Hackers' ToolsIsrael Umana
 
Forensics of a Windows System
Forensics of a Windows SystemForensics of a Windows System
Forensics of a Windows SystemConferencias FIST
 
Malware Analysis and Defeating using Virtual Machines
Malware Analysis and Defeating using Virtual MachinesMalware Analysis and Defeating using Virtual Machines
Malware Analysis and Defeating using Virtual Machinesintertelinvestigations
 

What's hot (20)

Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?"
Introduction to Dynamic Malware Analysis   ...Or am I "Cuckoo for Malware?"Introduction to Dynamic Malware Analysis   ...Or am I "Cuckoo for Malware?"
Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?"
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident Response
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesCNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
 
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
 
I Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugXI Know You Want Me - Unplugging PlugX
I Know You Want Me - Unplugging PlugX
 
Malware analysis - What to learn from your invaders
Malware analysis - What to learn from your invadersMalware analysis - What to learn from your invaders
Malware analysis - What to learn from your invaders
 
Malware Analysis Made Simple
Malware Analysis Made SimpleMalware Analysis Made Simple
Malware Analysis Made Simple
 
openioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensicsopenioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensics
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
 
Winnti Polymorphism
Winnti PolymorphismWinnti Polymorphism
Winnti Polymorphism
 
Malware Analysis 101 - N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...
Malware Analysis 101 -  N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...Malware Analysis 101 -  N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...
Malware Analysis 101 - N00b to Ninja in 60 Minutes at BSidesLV on August 5, ...
 
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
 
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbgCNIT 126: 10: Kernel Debugging with WinDbg
CNIT 126: 10: Kernel Debugging with WinDbg
 
SANS Windows Artifact Analysis 2012
SANS Windows Artifact Analysis 2012SANS Windows Artifact Analysis 2012
SANS Windows Artifact Analysis 2012
 
Basic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareBasic Dynamic Analysis of Malware
Basic Dynamic Analysis of Malware
 
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an..."Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
 
Investigating Hackers' Tools
Investigating Hackers' ToolsInvestigating Hackers' Tools
Investigating Hackers' Tools
 
Forensics of a Windows System
Forensics of a Windows SystemForensics of a Windows System
Forensics of a Windows System
 
Malware Analysis and Defeating using Virtual Machines
Malware Analysis and Defeating using Virtual MachinesMalware Analysis and Defeating using Virtual Machines
Malware Analysis and Defeating using Virtual Machines
 

Similar to Two-For-One Talk: Malware Analysis for Everyone

CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.pptCHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.pptManjuAppukuttan2
 
File inflection techniques
File inflection techniquesFile inflection techniques
File inflection techniquesSandun Perera
 
Dev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT SecurityDev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT SecurityMario Heiderich
 
Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008ClubHack
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CDamiable_indian
 
Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008ClubHack
 
Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)
Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)
Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)Akmal Hisyam
 
Breaking av software
Breaking av softwareBreaking av software
Breaking av softwareJoxean Koret
 
Breaking av software
Breaking av softwareBreaking av software
Breaking av softwareThomas Pollet
 
Breaking Antivirus Software
Breaking Antivirus SoftwareBreaking Antivirus Software
Breaking Antivirus Softwarerahmanprojectd
 
2600 av evasion_deuce
2600 av evasion_deuce2600 av evasion_deuce
2600 av evasion_deuceDb Cooper
 
Black Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysisBlack Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysisRoberto Suggi Liverani
 
computerviruses-171008143158.ppt
computerviruses-171008143158.pptcomputerviruses-171008143158.ppt
computerviruses-171008143158.pptssuser342286
 
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
Lab-10 Malware Creation and Denial of Service (DoS)        In t.docxLab-10 Malware Creation and Denial of Service (DoS)        In t.docx
Lab-10 Malware Creation and Denial of Service (DoS) In t.docxpauline234567
 
The Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A PrimerThe Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A Primeramiable_indian
 
Protecting Your organization from WannaCry Ransomware
Protecting Your organization from WannaCry RansomwareProtecting Your organization from WannaCry Ransomware
Protecting Your organization from WannaCry RansomwareQuick Heal Technologies Ltd.
 
44CON 2014 - Breaking AV Software
44CON 2014 - Breaking AV Software44CON 2014 - Breaking AV Software
44CON 2014 - Breaking AV Software44CON
 
Computer virus and antivirus
Computer virus and antivirusComputer virus and antivirus
Computer virus and antivirusBESOR ACADEMY
 

Similar to Two-For-One Talk: Malware Analysis for Everyone (20)

CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.pptCHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
CHAPTER 3 BASIC DYNAMIC ANALYSIS.ppt
 
File inflection techniques
File inflection techniquesFile inflection techniques
File inflection techniques
 
Dev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT SecurityDev and Blind - Attacking the weakest Link in IT Security
Dev and Blind - Attacking the weakest Link in IT Security
 
Attacking antivirus
Attacking antivirusAttacking antivirus
Attacking antivirus
 
Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to backtrack - ClubHack2008
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CD
 
Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008Kunal - Introduction to BackTrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008
 
Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)
Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)
Breaking Antivirus Software - Joxean Koret (SYSCAN 2014)
 
Breaking av software
Breaking av softwareBreaking av software
Breaking av software
 
Breaking av software
Breaking av softwareBreaking av software
Breaking av software
 
Breaking Antivirus Software
Breaking Antivirus SoftwareBreaking Antivirus Software
Breaking Antivirus Software
 
2600 av evasion_deuce
2600 av evasion_deuce2600 av evasion_deuce
2600 av evasion_deuce
 
Sembang2 Keselamatan It 2004
Sembang2 Keselamatan It 2004Sembang2 Keselamatan It 2004
Sembang2 Keselamatan It 2004
 
Black Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysisBlack Energy18 - Russian botnet package analysis
Black Energy18 - Russian botnet package analysis
 
computerviruses-171008143158.ppt
computerviruses-171008143158.pptcomputerviruses-171008143158.ppt
computerviruses-171008143158.ppt
 
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
Lab-10 Malware Creation and Denial of Service (DoS)        In t.docxLab-10 Malware Creation and Denial of Service (DoS)        In t.docx
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
 
The Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A PrimerThe Top 10/20 Internet Security Vulnerabilities – A Primer
The Top 10/20 Internet Security Vulnerabilities – A Primer
 
Protecting Your organization from WannaCry Ransomware
Protecting Your organization from WannaCry RansomwareProtecting Your organization from WannaCry Ransomware
Protecting Your organization from WannaCry Ransomware
 
44CON 2014 - Breaking AV Software
44CON 2014 - Breaking AV Software44CON 2014 - Breaking AV Software
44CON 2014 - Breaking AV Software
 
Computer virus and antivirus
Computer virus and antivirusComputer virus and antivirus
Computer virus and antivirus
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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.pdfsudhanshuwaghmare1
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
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.pdfOrbitshub
 
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 SavingEdi Saputra
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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 ModelDeepika Singh
 
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 educationjfdjdjcjdnsjd
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
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 REVIEWERMadyBayot
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Two-For-One Talk: Malware Analysis for Everyone

  • 1. Paul Melson Two-For-One Talk:Malware Analysis for Everyone
  • 2. MWA-101: Five Automated Analysis Tools You should Know
  • 3. Why Do Malware Analysis? Client-side attacks that install malware are the #1 external threat. It’s not slowing down any time soon: “Symantec observed an average of 75,158 active bot-infected computers per day in 2008, an increase of 31% from the previous period.” “In 2008, Symantec created 1,656,227 new malicious code signatures. This is a 265% increase over 2007.” (Source: Symantec Internet Threat Report, April 2009)
  • 4. Firewalls and Anti-Virus Have Lost Client-side attacks against web browsers and e-mail go right through most firewall policies Detection rates for current malware files by market leading anti-virus scanners are averaging 30-50% If you’re not adapting some other way, you’ve lost
  • 5. Malware is Adapting Quickly Take away Local Administrator privileges? Malware that persists in HKCU Registry keys or StartUp group Whitelist apps with Windows Firewall? Malware that hooks into Internet Explorer plugin APIs Block IRC at the firewall? Malware that uses encrypted HTTP/HTTPS back-channels
  • 6. “But it’s just spyware, right?” In the past 2 years, we’ve found malware in the wild that: Sends hundreds of spam e-mail messages per second Gives bot “herder” full desktop remote control Searches files in “Documents and Settings” for SSNs, credit card numbers, and saved Internet Explorer passwords Records all screen and text input and reports it in real-time to a server in Russia
  • 7. VirusTotalhttp://www.virustotal.com Upload a suspicious file, they scan it with 40+ different anti-virus products using current signatures Pretty much everybody, except TrendMicro Useful for determining if a file is malicious Also for determining whether your anti-virus would detect a particular file Take advantage of heuristic/edge products without all of the false positives in production OK, but not great for brand new or custom malware Not great for obfuscated exploits, better with binaries
  • 8.
  • 9. CWSandboxhttp://www.cwsandbox.org Upload a suspicious Windows executable, they run it in their sandbox and tell you what it did Great for figuring out what a file actually does It doesn’t establish malicious vs. benign, that’s up to you Requires some detailed understanding of Windows Registry, processes, file system to interpret report Some malware can detect this and other sandboxes, and won’t run Other similar services Norman Sandbox JoeBox
  • 10.
  • 11.
  • 12. Threat Expert http://www.threatexpert.com Upload a suspicious Windows binary, they analyze it Supports web submission, but also Windows applet Must register to submit samples Combines the features of CWSandbox and VirusTotal Anti-virus scan File / registry modifications Packer identification Browse reports and statistics from other submitted files
  • 13.
  • 14.
  • 15. Wepawethttp://wepawet.iseclab.org Upload a suspicious PDF, HTML, or Flash file, or submit a suspicious URL and it will analyze it for malicious JavaScript. Great for working with obfuscated JavaScript where reversing and debugging is complex and time-intensive. However, some forms of obfuscation, especially in PDF and SWF files, can be used to beat it.
  • 16.
  • 17. Comodohttp://camas.comodo.com Upload a suspicious Windows binary, they analyze it for you Similar to CWSandbox Very fast Relatively new/unknown, so less likely to be targeted for evasion (Assuming they use technology different enough from Norman, CWSandbox)
  • 18.
  • 20. MWA-405: Unpacking PDF Exploit Payloads
  • 21. PDF Files and Malware Malware relies on two methods to install Exploiting a browser vulnerability Tricking people into running a file Adobe Acrobat Reader is, right now, the most reliably vulnerable piece of software in the world It’s really hard to patch across the enterprise Predecessors: Internet Explorer QuickTime Player Adobe Flash Player
  • 22. They Don’t Call it Pwndobe for Nothing Tuesday’s Acrobat Reader security bulletin That’s 29 unique vulnerabilities, in case you’re keeping score
  • 23. PDF as an Attack Vector Acrobat Reader is executable from the web browser Called as a browser plugin via COM There is an IE killbit, but I dare you to use it in a business Each version of Acrobat Reader has its own CLSID, and killbit The PDF file format supports scripting and obfuscation JavaScript Embedding binary objects and scripts as streams Compressing and encoding these streams These are the same things that made Flash a good attack vector, so you may have some idea as to what’s next
  • 24. PDF With Malicious Payload PDF file header including JavaScript trigger
  • 25. PDF With Malicious Payload PDF file body showing binary FlateDecode stream Note the /Filter and /Length tags
  • 26. Unpacking FlateDecode Streams FlateDecode is stream compression using zlib compress() Several tools can decompress and extract the streams for you PDF Stream Inflater by Bobby Spasic (Malzilla) Not available for download anymore pdftk by Sid Steward (AccessPDF) Not specifically for malware http://www.accesspdf.com/pdftk/ pdf-parser.py by Didier Stevens This guy writes all sorts of awesome tools http://blog.didierstevens.com/programs/pdf-tools/
  • 27. Unpacking FlateDecode Streams Using PDF Stream Inflater to extract FlateDecode stream
  • 28. Unpacking FlateDecode Streams Viewing decoded stream containing obfuscated JavaScript
  • 29. Unpacking FlateDecode Streams Pipe extracted stream through Didier Stevens’ SpiderMonkey mod The log files contain the output of the obfuscated JavaScript
  • 30. Unpacking FlateDecode Streams Look! More JavaScript, but this time it’s readable. Hmmm, I wonder…
  • 31. Unpacking FlateDecode Streams Oh, look, they copied the exploit from milw0rm.
  • 32. Beyond FlateDecode Different versions of the PDF file standard support additional forms of encoding streams ASCIIHexDecode ASCII85Decode Encoding methods can be combined on a single stream Order of operations matters! Two methods for extracting and decoding: Manually decode Hex stream to zlib binary stream, reinsert, resize header, basically recreating the PDF as if it only contained the FlateDecode stream, then extract with inflater.exe (this sucks, BTW) Use pdf-parser.py
  • 33. Beyond FlateDecode This stream is encoded with ASCIIHexDecode and FlateDecode
  • 34. Beyond FlateDecode We decode the stream and find more obfuscated JavaScript ./pdf-parser.py -f boBAn.pdf | less
  • 35. Beyond FlateDecode Throw <html> and <script> tags around the obfuscated JavaScript and upload it to Wepawet
  • 36. Beyond FlateDecode Ooh, second stage executable downloads!
  • 37. Beyond FlateDecode - Epilogue From the time that I started this research to the time I wrote this presentation, Wepawet has added support for ASCIIHexDecode in PDF files So, yes, the hours of work I did on this can be replicated in mere seconds with only a web browser But this underscores the ongoing arms race between security researchers and malware vendors That’s right, I said vendors
  • 38. Some Extra Fun whois goodshoot1.com Note the goofy domain on those name servers
  • 39. Some Extra Fun So we search malwareurl.com for that domain, and…
  • 40. Some Extra Fun YES is a crimeware system made in Russia This is the login page for its web console
  • 41. Network Detection Easy enough to find PDF files that use encoded streams with your IDS/IPS Your firewall and proxy logs are a good place to look, too Most sites hosting second-stage malware are in foreign countries, especially Russia, China Use language to your advantage – if your employees speak English, then documents downloaded from countries that don’t speak English could be suspicious
  • 42. Network Detection alert tcp $EXTERNAL_NET 80 -> $HOME_NET any (msg:"LOCAL PDF mailto exploit HTTP download"; flow:from_server,established; content:"%PDF"; nocase; content:"RI(mailto:%/"; nocase; classtype:trojan-activity; sid:9000140; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL PDF with FlateDecode stream download"; flow:from_server,established; content:"%PDF"; content:"FlateDecode"; nocase; classtype:trojan-activity; sid:90000190; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL PDF with ASCIIHexDecode stream download"; flow:from_server,established; content:"%PDF"; content:"ASCIIHexDecode"; nocase; classtype:trojan-activity; sid:90000191; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL PDF with ASCII85Decode stream download"; flow:from_server,established; content:"%PDF"; content:"ASCII85Decode"; nocase; classtype:trojan-activity; sid:90000192; rev:1;) Snort rules to detect suspicious PDF files
  • 43. Network Detection Firewall events for PDFs downloaded from countries other than the US, UK, and Canada
  • 44. pmelson@gmail.com http://pmelson.blogspot.com Special Thanks to Sean Koessel MWA-405: Q&A