SlideShare a Scribd company logo
Malware Analysis Made Simple SecureWorld Expo Detroit Wednesday, November 5, 2008 Paul Melson
Security Incident Response
Why Not Focus On Prevention? You Should!  But… Nothing is 100% secure, blah blah When (not “if”) an incident occurs, a responsible team with a plan will: Respond quickly Be thorough Keep costs down
You’re Probably Required To An Incident Response Plan is a requirement of: FISMA HIPAA ISO/IEC 27002 PCI-DSS
Why Do Malware Analysis In-House?
Malware is Number 1!  Yay! Client-side attacks that install malware are the #1 external threat. It’s not slowing down any time soon: “ Symantec observed an average of 61,940 active bot-infected computers per day, a 17% increase from the previous period.” “ In the second half of 2007, 499,811 new malicious code threats were reported, a 136% increase over the first half of 2007.” (Source: Symantec Internet Threat Report, April 2008)
Malware Trends
Firewalls & Antivirus Have Lost Client-side attacks, web browsing and e-mail, go right through most firewall policies. Antivirus detection rates for current malware files are averaging 30-50%. If you’re not adapting some other way, you’ve lost.
Malware is Adapting Quickly Take away Local Admin? Malware that persists in non-admin accounts via HKLU Registry hive Whitelist apps with Windows Firewall? Malware that hooks into browser plugin APIs Block IRC at the firewall? Malware that uses encrypted HTTP/HTTPS back-channels
“ But it’s just spyware, right?” Our security analysts found samples in the past 18 months that: Send spam or launch DDoS attacks Give full desktop remote control Search “Documents and Settings” for SSNs, credit cards, and saved IE passwords Record all screen text and input and report it in near-real time to servers in Russia
Detection
Anatomy of a Drive-By Download Dropper Malware Servers More Malware JScript Exploit
Log Files Firewall Logs Outbound SMTP from workstations (lots!) Outbound IRC connections Peer-to-peer file sharing traffic, esp. Winny Sustained high-volume traffic from workstations Proxy / Web Filter Logs Monitor URL’s ending in “.exe”
 
IDS/IPS Alerts Most products attempt to detect post-infection traffic, such as IRC or Winny C&C channels EmergingThreats.net for Snort, huge list of trojan/malware signatures, all free If your IDS can, write some custom rules: Look for “.exe” downloads on ports where web filters won’t Win32 PE headers in HTTP traffic (renamed files) JavaScript obfuscation techniques
Snort Rules alert tcp $HOME_NET any -> $EXTERNAL_NET !80 (msg: "LOCAL .exe file download on port other than 80"; flow:established; content: "GET"; depth:4; content:".exe"; nocase; classtype:misc-activity; sid:9000160; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL Obfuscated JavaScript document.write"; flow:from_server,established; content:"document.write“; nocase; pcre:"/document\.write\(\"\\[0-9][0-9]/i"; classtype:trojan-activity; sid:9000110; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL Obfuscated JavaScript unescape"; flow:from_server,established; content:"script>"; nocase; content:"unescape("; nocase; classtype:trojan-activity; sid:9000111; rev:2;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL Obfuscated JavaScript eval"; flow:from_server,established; content:"script>"; nocase; content:"eval("; nocase; classtype:trojan-activity; sid:9000112; rev:2;)
Antivirus?! Yes, Antivirus! Many droppers will install multiple pieces of malware.  Your antivirus might detect 1 or 2 of them. When you see AV alerts from a workstation, check proxy logs for what else was downloaded.
Analysis
For Starters VirusTotal http://www.virustotal.com Norman Sandbox http://www.norman.com/microsites/nsic/Submit/en-us CWSandbox http://www.cwsandbox.org
 
Detecting Packed Files Packers are used to obfuscate malware executables from antivirus scanners. PEiD http://www.peid.info/ pefile http://code.google.com/p/pefile/ Jim Clausing’s packerid.py http://handlers.dshield.org/jclausing/
Analyzing Binary Files Utilities perform deeper scans of executables to determine the likelihood that they are suspicious/malicious Mandiant Red Curtain http://www.mandiant.com/mrc Resource Hacker http://angusj.com/resourcehacker/
 
Behavioral Analysis Utilities analyze system activity while malware is running to identify suspicious or malicious behavior SysAnalyzer http://labs.idefense.com/software/malcode.php AMIR http://www.malwareinfo.org/Utilities/
 
Network Analysis Analyzing network traffic can identify the presence of malware based on the connections the machine is generating. SniffHit http://labs.idefense.com/software/malcode.php WireShark http://www.wireshark.org TCPView http://technet.microsoft.com/en-us/sysinternals/
Analyzing System Hooks Analyzing system startup/execution hooks can determine if malware/rootkits are present. OSAM Autorun Manager http://www.online-solutions.ru/en/osam_autorun_manager.php StartupCPL http://www.mlin.net/StartupCPL.shtml HiJackThis! And StartupList http://www.merijn.org/programs.php
 
Building Toolkits
Response Toolkit: CD You could use a thumb drive, but read-only media is helpful here. Trusted Shell Copy of Windows CMD.EXE on CD Behavioral Analysis: AMIR Network Analysis: TCPView Startup Analysis: OSAM, HiJackThis!
Analysis Toolkit: VM Use a VM tool that supports snapshots “ Thwarting VM Detection” by Ed Skoudis Packer Analysis: PEiD, packerid.py Behavioral Analysis: SysAnalyzer Network Analysis: Wireshark on HOST Binary Analysis: Mandiant Red Curtain
Prevention & Recovery
Prevention – Whack-a-Mole Add malicious web sites and file names to your web content filter rules. Block malicious web site addresses with your firewall. If your AV/HIPS supports it, blacklist malicious file names and hashes as you find them.
Prevention: Local Admin? Restricting local admin access used to work well to prevent malware from persisting on a machine.  Some won’t run at all. More and more malware can persist in user space via HKLU Registry and StartUp group. But recovery is still easier! Develop & test a procedure for renaming local user profiles in Windows to enable quick recovery from infection for non-admins. Save downtime costs by not re-imaging.
Parting Shot: Best Practices Active monitoring by security staff. Develop response procedures for malware incidents.  Focus on response times. Contain potential incidents first, then analyze to determine impact.
Q & A Session

More Related Content

PPTX
Malware Static Analysis
PDF
Threat hunting 101 by Sandeep Singh
PPTX
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
PDF
Penetration testing & Ethical Hacking
PDF
Web application security & Testing
PPTX
Malware analysis
PPTX
Threat modelling with_sample_application
Malware Static Analysis
Threat hunting 101 by Sandeep Singh
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Penetration testing & Ethical Hacking
Web application security & Testing
Malware analysis
Threat modelling with_sample_application

What's hot (20)

PDF
Web Application Penetration Testing
PPTX
Penetration Testing for Cybersecurity Professionals
PPT
Application Threat Modeling
PDF
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
PPT
Introduction to Web Application Penetration Testing
PDF
Offensive OSINT
PDF
Windows Threat Hunting
PDF
Hunting for Privilege Escalation in Windows Environment
PDF
Threat Hunting Procedures and Measurement Matrice
PDF
SANS Threat Hunting Summit 2018 - Hunting Lateral Movement with Windows Event...
PDF
MITRE ATT&CK Framework
PPTX
WTF is Penetration Testing v.2
PPTX
Web application attacks
PPT
Introduction To OWASP
PDF
OWASP Top 10 Web Application Vulnerabilities
PPTX
Introduction to Malware Analysis
PPTX
Bsides 2019 - Intelligent Threat Hunting
PPTX
PPTX
Vulnerability assessment and penetration testing
PPTX
Introduction to penetration testing
Web Application Penetration Testing
Penetration Testing for Cybersecurity Professionals
Application Threat Modeling
Penetration Testing Tutorial | Penetration Testing Tools | Cyber Security Tra...
Introduction to Web Application Penetration Testing
Offensive OSINT
Windows Threat Hunting
Hunting for Privilege Escalation in Windows Environment
Threat Hunting Procedures and Measurement Matrice
SANS Threat Hunting Summit 2018 - Hunting Lateral Movement with Windows Event...
MITRE ATT&CK Framework
WTF is Penetration Testing v.2
Web application attacks
Introduction To OWASP
OWASP Top 10 Web Application Vulnerabilities
Introduction to Malware Analysis
Bsides 2019 - Intelligent Threat Hunting
Vulnerability assessment and penetration testing
Introduction to penetration testing
Ad

Viewers also liked (20)

PDF
'Malware Analysis' by PP Singh
PPTX
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014
PPTX
PyTriage: A malware analysis framework
PDF
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
PDF
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
PPTX
Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?"
PDF
CNIT 126 4: A Crash Course in x86 Disassembly
PDF
CNIT 126 7: Analyzing Malicious Windows Programs
PDF
CNIT 127 14: Protection Mechanisms
PDF
CNIT 126 6: Recognizing C Code Constructs in Assembly
PDF
CNIT 126 8: Debugging
PDF
CNIT 126 5: IDA Pro
PDF
Practical Malware Analysis Ch12
PPTX
Practical Malware Analysis: Ch 6: Recognizing C Code Constructs in Assembly
PDF
Ch 13: Network Protection Systems
PDF
Cybersecurity and The Board
PDF
Practical Malware Analysis: Ch 11: Malware Behavior
PDF
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
PDF
Practical Malware Analysis: Ch 15: Anti-Disassembly
PPTX
Client side attacks using PowerShell
'Malware Analysis' by PP Singh
Malware Analysis 101 - N00b to Ninja in 60 Minutes at CactusCon on April 4, 2014
PyTriage: A malware analysis framework
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?"
CNIT 126 4: A Crash Course in x86 Disassembly
CNIT 126 7: Analyzing Malicious Windows Programs
CNIT 127 14: Protection Mechanisms
CNIT 126 6: Recognizing C Code Constructs in Assembly
CNIT 126 8: Debugging
CNIT 126 5: IDA Pro
Practical Malware Analysis Ch12
Practical Malware Analysis: Ch 6: Recognizing C Code Constructs in Assembly
Ch 13: Network Protection Systems
Cybersecurity and The Board
Practical Malware Analysis: Ch 11: Malware Behavior
Practical Malware Analysis: Ch 10: Kernel Debugging with WinDbg
Practical Malware Analysis: Ch 15: Anti-Disassembly
Client side attacks using PowerShell
Ad

Similar to Malware Analysis Made Simple (20)

PPTX
Two-For-One Talk: Malware Analysis for Everyone
PPT
Penetration Testing Basics
DOCX
Security Handbook
PPT
Hacking and its Defence
PPTX
Basic Dynamic Analysis of Malware
PPTX
Cybersecurity - Jim Butterworth
PPTX
An experiment in agile threat modelling
PPTX
DevSecCon Talk: An experiment in agile Threat Modelling
ODP
2600 av evasion_deuce
DOCX
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
PPT
Sembang2 Keselamatan It 2004
PDF
Intro2 malwareanalysisshort
PDF
Modern Malware and Threats
PPS
Workshop on BackTrack live CD
PPT
Kunal - Introduction to backtrack - ClubHack2008
PPT
Kunal - Introduction to BackTrack - ClubHack2008
PDF
Modern malware and threats
PDF
SplunkLive! Stockholm 2015 breakout - Analytics based security
PPT
Two-For-One Talk: Malware Analysis for Everyone
Penetration Testing Basics
Security Handbook
Hacking and its Defence
Basic Dynamic Analysis of Malware
Cybersecurity - Jim Butterworth
An experiment in agile threat modelling
DevSecCon Talk: An experiment in agile Threat Modelling
2600 av evasion_deuce
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
Sembang2 Keselamatan It 2004
Intro2 malwareanalysisshort
Modern Malware and Threats
Workshop on BackTrack live CD
Kunal - Introduction to backtrack - ClubHack2008
Kunal - Introduction to BackTrack - ClubHack2008
Modern malware and threats
SplunkLive! Stockholm 2015 breakout - Analytics based security

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Modernizing your data center with Dell and AMD
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Cloud computing and distributed systems.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
KodekX | Application Modernization Development
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Understanding_Digital_Forensics_Presentation.pptx
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Modernizing your data center with Dell and AMD
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Review of recent advances in non-invasive hemoglobin estimation
KodekX | Application Modernization Development
Spectral efficient network and resource selection model in 5G networks
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf

Malware Analysis Made Simple

  • 1. Malware Analysis Made Simple SecureWorld Expo Detroit Wednesday, November 5, 2008 Paul Melson
  • 3. Why Not Focus On Prevention? You Should! But… Nothing is 100% secure, blah blah When (not “if”) an incident occurs, a responsible team with a plan will: Respond quickly Be thorough Keep costs down
  • 4. You’re Probably Required To An Incident Response Plan is a requirement of: FISMA HIPAA ISO/IEC 27002 PCI-DSS
  • 5. Why Do Malware Analysis In-House?
  • 6. Malware is Number 1! Yay! Client-side attacks that install malware are the #1 external threat. It’s not slowing down any time soon: “ Symantec observed an average of 61,940 active bot-infected computers per day, a 17% increase from the previous period.” “ In the second half of 2007, 499,811 new malicious code threats were reported, a 136% increase over the first half of 2007.” (Source: Symantec Internet Threat Report, April 2008)
  • 8. Firewalls & Antivirus Have Lost Client-side attacks, web browsing and e-mail, go right through most firewall policies. Antivirus detection rates for current malware files are averaging 30-50%. If you’re not adapting some other way, you’ve lost.
  • 9. Malware is Adapting Quickly Take away Local Admin? Malware that persists in non-admin accounts via HKLU Registry hive Whitelist apps with Windows Firewall? Malware that hooks into browser plugin APIs Block IRC at the firewall? Malware that uses encrypted HTTP/HTTPS back-channels
  • 10. “ But it’s just spyware, right?” Our security analysts found samples in the past 18 months that: Send spam or launch DDoS attacks Give full desktop remote control Search “Documents and Settings” for SSNs, credit cards, and saved IE passwords Record all screen text and input and report it in near-real time to servers in Russia
  • 12. Anatomy of a Drive-By Download Dropper Malware Servers More Malware JScript Exploit
  • 13. Log Files Firewall Logs Outbound SMTP from workstations (lots!) Outbound IRC connections Peer-to-peer file sharing traffic, esp. Winny Sustained high-volume traffic from workstations Proxy / Web Filter Logs Monitor URL’s ending in “.exe”
  • 14.  
  • 15. IDS/IPS Alerts Most products attempt to detect post-infection traffic, such as IRC or Winny C&C channels EmergingThreats.net for Snort, huge list of trojan/malware signatures, all free If your IDS can, write some custom rules: Look for “.exe” downloads on ports where web filters won’t Win32 PE headers in HTTP traffic (renamed files) JavaScript obfuscation techniques
  • 16. Snort Rules alert tcp $HOME_NET any -> $EXTERNAL_NET !80 (msg: "LOCAL .exe file download on port other than 80"; flow:established; content: "GET"; depth:4; content:".exe"; nocase; classtype:misc-activity; sid:9000160; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL Obfuscated JavaScript document.write"; flow:from_server,established; content:"document.write“; nocase; pcre:"/document\.write\(\"\\[0-9][0-9]/i"; classtype:trojan-activity; sid:9000110; rev:1;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL Obfuscated JavaScript unescape"; flow:from_server,established; content:"script>"; nocase; content:"unescape("; nocase; classtype:trojan-activity; sid:9000111; rev:2;) alert tcp $EXTERNAL_NET $HTTP_PORTS -> $HOME_NET any (msg:"LOCAL Obfuscated JavaScript eval"; flow:from_server,established; content:"script>"; nocase; content:"eval("; nocase; classtype:trojan-activity; sid:9000112; rev:2;)
  • 17. Antivirus?! Yes, Antivirus! Many droppers will install multiple pieces of malware. Your antivirus might detect 1 or 2 of them. When you see AV alerts from a workstation, check proxy logs for what else was downloaded.
  • 19. For Starters VirusTotal http://www.virustotal.com Norman Sandbox http://www.norman.com/microsites/nsic/Submit/en-us CWSandbox http://www.cwsandbox.org
  • 20.  
  • 21. Detecting Packed Files Packers are used to obfuscate malware executables from antivirus scanners. PEiD http://www.peid.info/ pefile http://code.google.com/p/pefile/ Jim Clausing’s packerid.py http://handlers.dshield.org/jclausing/
  • 22. Analyzing Binary Files Utilities perform deeper scans of executables to determine the likelihood that they are suspicious/malicious Mandiant Red Curtain http://www.mandiant.com/mrc Resource Hacker http://angusj.com/resourcehacker/
  • 23.  
  • 24. Behavioral Analysis Utilities analyze system activity while malware is running to identify suspicious or malicious behavior SysAnalyzer http://labs.idefense.com/software/malcode.php AMIR http://www.malwareinfo.org/Utilities/
  • 25.  
  • 26. Network Analysis Analyzing network traffic can identify the presence of malware based on the connections the machine is generating. SniffHit http://labs.idefense.com/software/malcode.php WireShark http://www.wireshark.org TCPView http://technet.microsoft.com/en-us/sysinternals/
  • 27. Analyzing System Hooks Analyzing system startup/execution hooks can determine if malware/rootkits are present. OSAM Autorun Manager http://www.online-solutions.ru/en/osam_autorun_manager.php StartupCPL http://www.mlin.net/StartupCPL.shtml HiJackThis! And StartupList http://www.merijn.org/programs.php
  • 28.  
  • 30. Response Toolkit: CD You could use a thumb drive, but read-only media is helpful here. Trusted Shell Copy of Windows CMD.EXE on CD Behavioral Analysis: AMIR Network Analysis: TCPView Startup Analysis: OSAM, HiJackThis!
  • 31. Analysis Toolkit: VM Use a VM tool that supports snapshots “ Thwarting VM Detection” by Ed Skoudis Packer Analysis: PEiD, packerid.py Behavioral Analysis: SysAnalyzer Network Analysis: Wireshark on HOST Binary Analysis: Mandiant Red Curtain
  • 33. Prevention – Whack-a-Mole Add malicious web sites and file names to your web content filter rules. Block malicious web site addresses with your firewall. If your AV/HIPS supports it, blacklist malicious file names and hashes as you find them.
  • 34. Prevention: Local Admin? Restricting local admin access used to work well to prevent malware from persisting on a machine. Some won’t run at all. More and more malware can persist in user space via HKLU Registry and StartUp group. But recovery is still easier! Develop & test a procedure for renaming local user profiles in Windows to enable quick recovery from infection for non-admins. Save downtime costs by not re-imaging.
  • 35. Parting Shot: Best Practices Active monitoring by security staff. Develop response procedures for malware incidents. Focus on response times. Contain potential incidents first, then analyze to determine impact.
  • 36. Q & A Session