SlideShare uma empresa Scribd logo
1 de 57
Malware
Analysis
N00b to Ninja in 60 Minutes*
@grecs

*

Most listeners do not become Ninjas in under 60 minutes.
Pic of hacked sites; news articles of breaches, mid-2000s
Infosec COTS
Thanks

@BulbSecurity

@PenTestTraining

Tweet/Post: Thanks … for sponsoring @grecs & @novainfosec…
Looking for Bloggers
Pay in Beer or $$$
http://bit.ly/nispsubarticle
Agenda
•
•
•
•

Introduction
Environment
Methodology
Where to Learn
More
• Conclusion
Introduction

General Security Practitioners Interested in
Getting Started in Malware Analysis

SOC Analysts Looking to Expand Skills beyond
Event Monitoring & Basic Analysis

WARNING!!!
DO NOT ANALYZE MALWARE
ON PRODUCTION SYSTEMS
Environment
• Setup
– Virtual
– Physical

• Options
– Single Box
– Dual+ Box
Environment
Setup
• Virtual
– Efficient & Easy to Setup
– Snap-Shots to Revert Back To
– Malware Detecting VM & Terminating

• Physical
– VM Detection Not Possible
– Resource Intensive
Environment
Setup – Virtual
• Network: Use Non-Host Connected Interface

Be Careful
Environment
Options
• Single Box
– All Analysis Performed on One Machine
– Risk of Potential Malware Sabotage

• Dual+ Box
– Mitigates Some Potential Sabotage
– Gateway to Simulate More
Real Network
– Realistic External View (port
sopen, network traffic)
Environment
Options – Single Box
• Start with Base Unpatched Windows XP SP2 Box in VMware
– Similar to First Set of Post-Install Instructions for Metasploit
Unleashed
– Switch to Classic View
– Disable Windows Firewall
– Turn Off Automatic Updates
– Disable Alerts
– Uncheck Simple File Sharing

• Add Target Software

– Older Versions If Needed
• Starting with: OldVersion.com / OldApps.com
• Google for Others

•
•
•
•

Where to Get
eBay, NewEgg, etc.
Win Eval OSs (prev vs)
Modern.ie
AWS (servers only)
Environment
Options – Single Box
• Install Dynamic Analysis Tools
– Process Monitor
• Shows File System, Registry & Process Activity that Started
During Malware Execution

– Process Explorer
• Shows Info about Handles/DLLs Processes Opened/Loaded
by Malware

– WireShark
• Sniffer to Capture Network the Malware May Make

– RegShot
• View Changes Malware May Make in the Registry
Process Monitor: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
Process Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653
WireShark: https://www.wireshark.org/
RegShot: http://sourceforge.net/projects/regshot/
Environment
Options – Single Box
• Install Dynamic Analysis Tools (cont)
– TCPView
• Allows Detection of Malware Initiated Network Connections

– Malware Analysis Pack
• MAP FakeDNS
• MAP Right-Click (MD5 Hash, Strings, VirusTotal)

– FakeNet
• Aids Dynamic Analysis of Malicious Software
• Simulates Network so Malware Thinks Its Interacting with
Remote Hosts
• DNS, HTTP, SSL, Dummy Listener
TCPView: http://technet.microsoft.com/en-us/sysinternals/bb897437
MAP: http://www.woodmann.com/collaborative/tools/index.php/Malcode_Analysis_Pack
FakeNet: http://practicalmalwareanalysis.com/fakenet/
Environment
Options – Single Box
• Install Static Analysis Tools
– OllyDbg with OllyDump Plugin
• General Disassembler/Debugger for Windows Used to Analyze
Malware in Assembly; Plugin to View Encrypted Malware

– IDA Pro
• Windows Disassembler/Debugger with Freeware Alternative

– 010 Editor
• Standard Hex Editor

– Specialized Tools
• PDFs: Didier Stevens’s pdfid.py & pdf-parser.py
• Flash: SWFTtools
• Others: Java, JavaScript
OllyDbg: http://www.ollydbg.de/
OllyDump: http://www.openrce.org/downloads/details/108/OllyDump
IDA Pro Freeware: http://www.hex-rays.com/products/ida/support/download_freeware.shtml
Didier Stevens PDF Tools: http://blog.didierstevens.com/programs/pdf-tools/
Environment
Options – Single Box
• Baseline
– Configure VM to "Host-Only” Mode Secluded
Network
• Temporarily Change to NAT to Download Malware
• Write-Once Media (e.g., CDs)
• USB Key with Physical Write-Protect Switch
– Imation USB 2.0 Clip Flash Drive
– Kanguru Flashblu 2

– Snapshot VM
Environment
Dual+ Box – Fake Gateway Server
• Second Machine for Target to Connect To
– Additional Advantage of Examining Network Traffic without
Possible Malware Sabotage
– Implement Linux Server in VMware & Configure to Be Default
Route on Victim Machine
– Should Have Fixed IP Addresses

• Enable or Install Software that Provides Needed Services
–
–
–
–
–

DNS: Configured to Return Fake Servers IP for All Queries
HTTP
IRC
Others: DHCP, FTP, SSH
Other Services Depending on Goal of Analysis
Environment
Dual+ Box – Fake Gateway Server
• Install Network Analysis Tools
– WireShark: Records Network Traffic from Victim
– Netcat: Start Needed Ad-Hoc Services
– Nmap: Scan for Open Ports External to Victim

• Snapshot Fake Server Revert Back To
Environment
Preconfigured
• REMnux
– Created by Lenny Zeltser
– ISO or Virtual Appliance
– Static Analysis

v4

• Load Malware on & Analyze
• Web-Based Malware (e.g., Malicious JavaScript, Java Programs, &
Flash Files)
• Malicious Documents (e.g., Microsoft Office & Adobe PDF files)
• Utilities for Reversing Malware through Memory Forensics

– Dynamic Analysis
•
•
•
•

Emulate Network Services Used as Fake Gateway Server
Emulate Services in Isolated Lab Environment
Infects Another Laboratory System with Malware Sample
Directs Potentially-Malicious Connections to REMnux that's Listening
on Appropriate Ports

REMnux: http://zeltser.com/remnux/
Environment
Preconfigured
Environment
Preconfigured
• CuckooBox
– Automated Dynamic Analysis of Malware
– Data Captured
•
•
•
•

Trace of Performed Relevant Win32 API Calls
Dump of Network Traffic Generated During Analysis
Creation of Screenshots Taken During Analysis
Dump of Files Created, Deleted and Downloaded by the
Malware During Analysis
• Trace of Assembly Instructions Executed by Malware
Process

CuckooBox: http://cuckoobox.org/
Environment
Preconfigured
Methodology
1. Triage
2. Dynamic Analysis
3. Static Analysis
Methodology
1. Triage
a. 

Run through External/Internal
Sandbox Services for QnD Results
•
•

b.

 b. MD5 Hash Comparison (can run
live is possible)
•

c.

Goals: Establish Rough Idea of Malware
Activities
Tools: Norman Sandbox, GFI Sandbox,
Anubis, Malwr.com, ThreatExpert.com,
…

•

Goals: When Compiled, Packed or
Obfuscated)
Tools: VirusTotal.com, MAP, FileAlyzer,
Google Hash

 c. Determine Real File Type
•
•

UNIX “file” Command and/or TrID
Open in 010 & Look for Magic Numbers:
Win Exe (MZ), PDF (%PDF), ZIP (PK), …
(more at Wikipedia)

d. 
e. 
f. 

Unpack If Needed
•

Analyze Imports
•
•

Goals: Discovery Interesting Things
Malware May Be Importing (networking
APIs for non-networking app)
Tools: FileAlyzer (PD Imports), PEView

f. Extract Readable Strings
•

e. 

Tools: OllyDump, PE Explorer (UPX builtin)

•

Goals: Discover Interesting Data Points
like Host Name & IP Addresses
Tools: MAP

Specialized Tools
•

E.g., pdfid.py, pdf-parser.py, SWFTtools,
…

MASTIFF: Open Source Linux Tool Automates Much of Above
(on REMnux)

v4
Methodology
2. Dynamic Analysis
a. • Take RegShot & Start WireShark, Process Monitor,

Process Explorer, FakeNet & TCPView

– Monitors File and Registry Access, Network Traffic, Process
Creation, etc.
b. • Execute Malware & Let it Run for 15 Minutes or Until

Activity Dies Down

– Watching WireShark, Process Monitor, & TCPView for
Anything Interesting
c. • Take Second RegShot & Stop WireShark, Process

Monitor, FakeNet
d. • Compare Initial & Final RegShots & Review All
Monitoring Tool Logs
Methodology
2. Dynamic Analysis (Regshot & Wireshark)

a-1.

a-2.

a-3.
Methodology
2. Dynamic Analysis (Process Monitor)
a-4.

a-5.

a-6.
Methodology
2. Dynamic Analysis (Process Explorer)

a-7. Just Start
Methodology
2. Dynamic Analysis (FakeNet)

a-8. Just Start
Methodology
2. Dynamic Analysis (TCPView)

a-9. Just Start
Methodology
2. Dynamic Analysis (Execute Malware)
• Double-Click EXE
• Rundll32.exe DLLName, Export arguments
– PE Explorer to Discover Export arguments
– E.g., rundll32.exe rip.dll, Install

• Watch All Monitoring Tools & Stop When
Activity Dies Down

b. Just Monitor
Methodology
2. Dynamic Analysis (Spin Down)
c-3.

c-1.
c-2.
Methodology
2. Dynamic Analysis (Spin Down)
c-4.
Methodology
2. Dynamic Analysis (Spin Down)
c-5.
Methodology
2. Dynamic Analysis (Analysis)
c-6.•

Save Logs for Future Reference
c-7.• Analyze
Methodology
3. Static Analysis
d.

• Use OllyDbg or IDA Pro to Disassemble &
Analyze Deobfuscated Malware
– Just Stare at It
– ...
– Stare Some More
– ...
– And Some More
Where to Learn More

OpenSecurityTraining.info
Where to Learn More
• OpenSecurityTraining.info
– “Reverse Engineering Malware”
• Matt Briggs & Frank Poz
• “Practical Malware Analysis” by M. Sikorski/A. Honig
• http://opensecuritytraining.info/ReverseEngineeringM
alware.html
Where to Learn More
• Malware Analysis Toolkit:
http://zeltser.com/malware-analysis-toolkit/
• OpenRCE: http://www.openrce.org/
• Certifications
– TrainACE AMA
– GREM, CHFI

• NIST: 800-94, 800-83, 800-61
• Books: Practical Malware Analysis
• NoVA Infosec: Workshop Style?
Conclusion
• Introduction
• Environment
–
–
–
–

Setup
Single Box - Victim
Dual+ Box – Fake Server
Preconfigured

• Methodology
– Triage
– Dynamic Analysis
– Static Analysis

• Where to Learn More
– OpenSecurityTraining.info
– Zeltser.com
– OpenRCE.org

• Conclusion
Questions?

• Twitter
• Website
• Contact

@grecs
NovaInfosec.com
http://bit.ly/nispcontact

Mais conteúdo relacionado

Mais procurados

Shmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSHShmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSH
Andrew Morris
 
The Background Noise of the Internet
The Background Noise of the InternetThe Background Noise of the Internet
The Background Noise of the Internet
Andrew Morris
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
CODE BLUE
 

Mais procurados (20)

Outlook and Exchange for the bad guys
Outlook and Exchange for the bad guysOutlook and Exchange for the bad guys
Outlook and Exchange for the bad guys
 
Tcpdump hunter
Tcpdump hunterTcpdump hunter
Tcpdump hunter
 
Identifying and Correlating Internet-wide Scan Traffic to Newsworthy Security...
Identifying and Correlating Internet-wide Scan Traffic to Newsworthy Security...Identifying and Correlating Internet-wide Scan Traffic to Newsworthy Security...
Identifying and Correlating Internet-wide Scan Traffic to Newsworthy Security...
 
Shmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSHShmoocon Epilogue 2013 - Ruining security models with SSH
Shmoocon Epilogue 2013 - Ruining security models with SSH
 
Improvement in Rogue Access Points - SensePost Defcon 22
Improvement in Rogue Access Points - SensePost Defcon 22Improvement in Rogue Access Points - SensePost Defcon 22
Improvement in Rogue Access Points - SensePost Defcon 22
 
The Background Noise of the Internet
The Background Noise of the InternetThe Background Noise of the Internet
The Background Noise of the Internet
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
 
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
[CB16] Invoke-Obfuscation: PowerShell obFUsk8tion Techniques & How To (Try To...
 
Breadcrumbs to Loaves: BSides Austin '17
Breadcrumbs to Loaves: BSides Austin '17Breadcrumbs to Loaves: BSides Austin '17
Breadcrumbs to Loaves: BSides Austin '17
 
BSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathers
 
DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101
 
Applied Detection and Analysis with Flow Data - SO Con 2014
Applied Detection and Analysis with Flow Data - SO Con 2014Applied Detection and Analysis with Flow Data - SO Con 2014
Applied Detection and Analysis with Flow Data - SO Con 2014
 
Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...Infosecurity.be 2019: What are relevant open source security tools you should...
Infosecurity.be 2019: What are relevant open source security tools you should...
 
Analysis Of Adverarial Code - The Role of Malware Kits
Analysis Of Adverarial Code - The Role of Malware KitsAnalysis Of Adverarial Code - The Role of Malware Kits
Analysis Of Adverarial Code - The Role of Malware Kits
 
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...
 
BSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
 
External to DA, the OS X Way
External to DA, the OS X WayExternal to DA, the OS X Way
External to DA, the OS X Way
 
Lateral Movement: How attackers quietly traverse your Network
Lateral Movement: How attackers quietly traverse your NetworkLateral Movement: How attackers quietly traverse your Network
Lateral Movement: How attackers quietly traverse your Network
 

Destaque

Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident Response
Takahiro Haruyama
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic Analysis
Takahiro Haruyama
 
Open Source Forensics
Open Source ForensicsOpen Source Forensics
Open Source Forensics
CTIN
 

Destaque (20)

Reverse Engineering Malware: A look inside Operation Tovar
Reverse Engineering Malware: A look inside Operation TovarReverse Engineering Malware: A look inside Operation Tovar
Reverse Engineering Malware: A look inside Operation Tovar
 
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
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident Response
 
Linux Memory Analysis with Volatility
Linux Memory Analysis with VolatilityLinux Memory Analysis with Volatility
Linux Memory Analysis with Volatility
 
REMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of ArtifactsREMnux tutorial-2: Extraction and decoding of Artifacts
REMnux tutorial-2: Extraction and decoding of Artifacts
 
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with VolatlityOMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
OMFW 2012: Analyzing Linux Kernel Rootkits with Volatlity
 
Windows Registry Forensics with Volatility Framework
Windows Registry Forensics with Volatility FrameworkWindows Registry Forensics with Volatility Framework
Windows Registry Forensics with Volatility Framework
 
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documentsREMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
 
One-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic AnalysisOne-Byte Modification for Breaking Memory Forensic Analysis
One-Byte Modification for Breaking Memory Forensic Analysis
 
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
Remnux tutorial-1  Statically Analyse Portable Executable(PE) FilesRemnux tutorial-1  Statically Analyse Portable Executable(PE) Files
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
 
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
 
revisedhoneypot429
revisedhoneypot429revisedhoneypot429
revisedhoneypot429
 
Setup Your Personal Malware Lab
Setup Your Personal Malware LabSetup Your Personal Malware Lab
Setup Your Personal Malware Lab
 
Open Source Forensics
Open Source ForensicsOpen Source Forensics
Open Source Forensics
 
Sandbox vs manual analysis v2.1
Sandbox vs manual analysis v2.1Sandbox vs manual analysis v2.1
Sandbox vs manual analysis v2.1
 
CISSA Lightning Talk - Building a Malware Analysis Lab on a Budget
CISSA Lightning Talk - Building a Malware Analysis Lab on a BudgetCISSA Lightning Talk - Building a Malware Analysis Lab on a Budget
CISSA Lightning Talk - Building a Malware Analysis Lab on a Budget
 
Understanding CryptoLocker (Ransomware) with a Case Study
Understanding CryptoLocker (Ransomware) with a Case StudyUnderstanding CryptoLocker (Ransomware) with a Case Study
Understanding CryptoLocker (Ransomware) with a Case Study
 
Container con toronto
Container con torontoContainer con toronto
Container con toronto
 
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & AnomaliesREMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
REMnux tutorial 4.1 - Datagrams, Fragmentation & Anomalies
 
The Best Practices of Making WordPress Site Multilingual
The Best Practices of Making WordPress Site MultilingualThe Best Practices of Making WordPress Site Multilingual
The Best Practices of Making WordPress Site Multilingual
 

Semelhante a Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, 2013

Project Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docxProject Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docx
briancrawford30935
 
Analisis Estatico y de Comportamiento de un Binario Malicioso
Analisis Estatico y de Comportamiento de un Binario MaliciosoAnalisis Estatico y de Comportamiento de un Binario Malicioso
Analisis Estatico y de Comportamiento de un Binario Malicioso
Conferencias FIST
 
Novetta Cyber Analytics
Novetta Cyber AnalyticsNovetta Cyber Analytics
Novetta Cyber Analytics
Novetta
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
drewz lin
 
Malware collection and analysis
Malware collection and analysisMalware collection and analysis
Malware collection and analysis
Chong-Kuan Chen
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CanSecWest
 
Watchtowers of the Internet - Source Boston 2012
Watchtowers of the Internet - Source Boston 2012Watchtowers of the Internet - Source Boston 2012
Watchtowers of the Internet - Source Boston 2012
Stephan Chenette
 
CyberCrime in the Cloud and How to defend Yourself
CyberCrime in the Cloud and How to defend Yourself CyberCrime in the Cloud and How to defend Yourself
CyberCrime in the Cloud and How to defend Yourself
Alert Logic
 

Semelhante a Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, 2013 (20)

ch11.ppt
ch11.pptch11.ppt
ch11.ppt
 
Project Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docxProject Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docx
 
Analisis Estatico y de Comportamiento de un Binario Malicioso
Analisis Estatico y de Comportamiento de un Binario MaliciosoAnalisis Estatico y de Comportamiento de un Binario Malicioso
Analisis Estatico y de Comportamiento de un Binario Malicioso
 
Computer security
Computer securityComputer security
Computer security
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
Novetta Cyber Analytics
Novetta Cyber AnalyticsNovetta Cyber Analytics
Novetta Cyber Analytics
 
Threat hunting on the wire
Threat hunting on the wireThreat hunting on the wire
Threat hunting on the wire
 
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitationsAppsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
Appsec 2013-krehel-ondrej-forensic-investigations-of-web-exploitations
 
Building next gen malware behavioural analysis environment
Building next gen malware behavioural analysis environment Building next gen malware behavioural analysis environment
Building next gen malware behavioural analysis environment
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
A Threat Hunter Himself
A Threat Hunter HimselfA Threat Hunter Himself
A Threat Hunter Himself
 
Malware collection and analysis
Malware collection and analysisMalware collection and analysis
Malware collection and analysis
 
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoTCSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
 
Penetration Testing Boot CAMP
Penetration Testing Boot CAMPPenetration Testing Boot CAMP
Penetration Testing Boot CAMP
 
Watchtowers of the Internet - Source Boston 2012
Watchtowers of the Internet - Source Boston 2012Watchtowers of the Internet - Source Boston 2012
Watchtowers of the Internet - Source Boston 2012
 
Thinking Outside the Sand[box]
Thinking Outside the Sand[box]Thinking Outside the Sand[box]
Thinking Outside the Sand[box]
 
RIoT (Raiding Internet of Things) by Jacob Holcomb
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
 
Securitytools
SecuritytoolsSecuritytools
Securitytools
 
CyberCrime in the Cloud and How to defend Yourself
CyberCrime in the Cloud and How to defend Yourself CyberCrime in the Cloud and How to defend Yourself
CyberCrime in the Cloud and How to defend Yourself
 
(130119) #fitalk apt, cyber espionage threat
(130119) #fitalk   apt, cyber espionage threat(130119) #fitalk   apt, cyber espionage threat
(130119) #fitalk apt, cyber espionage threat
 

Mais de grecsl

Mais de grecsl (8)

Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016
Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016
Deploying a Shadow Threat Intel Capability at Thotcon on May 6, 2016
 
Monitoring & Analysis 101 - N00b to Ninja in 60 Minutes at ISSW on April 9, 2016
Monitoring & Analysis 101 - N00b to Ninja in 60 Minutes at ISSW on April 9, 2016Monitoring & Analysis 101 - N00b to Ninja in 60 Minutes at ISSW on April 9, 2016
Monitoring & Analysis 101 - N00b to Ninja in 60 Minutes at ISSW on April 9, 2016
 
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
Deploying a Shadow Threat Intel Capability at CaralinaCon on March 6, 2016
 
Defending the Enterprise with Evernote at SourceBoston on May 27, 2015
Defending the Enterprise with Evernote at SourceBoston on May 27, 2015Defending the Enterprise with Evernote at SourceBoston on May 27, 2015
Defending the Enterprise with Evernote at SourceBoston on May 27, 2015
 
Project KidHack – Teaching the Next Next Generation Security through Gaming a...
Project KidHack – Teaching the Next Next Generation Security through Gaming a...Project KidHack – Teaching the Next Next Generation Security through Gaming a...
Project KidHack – Teaching the Next Next Generation Security through Gaming a...
 
Project KidHack - Teaching Kids Security through Gaming at BSidesCharm on Apr...
Project KidHack - Teaching Kids Security through Gaming at BSidesCharm on Apr...Project KidHack - Teaching Kids Security through Gaming at BSidesCharm on Apr...
Project KidHack - Teaching Kids Security through Gaming at BSidesCharm on Apr...
 
Project KidHack - Teaching Kids Security through Gaming at BSidesTampa on Feb...
Project KidHack - Teaching Kids Security through Gaming at BSidesTampa on Feb...Project KidHack - Teaching Kids Security through Gaming at BSidesTampa on Feb...
Project KidHack - Teaching Kids Security through Gaming at BSidesTampa on Feb...
 
Project Kid Hack - Teaching Kids Security through Gaming at BSidesDE on Novem...
Project Kid Hack - Teaching Kids Security through Gaming at BSidesDE on Novem...Project Kid Hack - Teaching Kids Security through Gaming at BSidesDE on Novem...
Project Kid Hack - Teaching Kids Security through Gaming at BSidesDE on Novem...
 

Último

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
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

Malware Analysis 101: N00b to Ninja in 60 Minutes at BSidesDC on October 19, 2013

  • 1. Malware Analysis N00b to Ninja in 60 Minutes* @grecs * Most listeners do not become Ninjas in under 60 minutes.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Pic of hacked sites; news articles of breaches, mid-2000s
  • 11.
  • 12.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Thanks @BulbSecurity @PenTestTraining Tweet/Post: Thanks … for sponsoring @grecs & @novainfosec…
  • 20. Looking for Bloggers Pay in Beer or $$$ http://bit.ly/nispsubarticle
  • 21.
  • 23. Introduction General Security Practitioners Interested in Getting Started in Malware Analysis SOC Analysts Looking to Expand Skills beyond Event Monitoring & Basic Analysis WARNING!!! DO NOT ANALYZE MALWARE ON PRODUCTION SYSTEMS
  • 24. Environment • Setup – Virtual – Physical • Options – Single Box – Dual+ Box
  • 25. Environment Setup • Virtual – Efficient & Easy to Setup – Snap-Shots to Revert Back To – Malware Detecting VM & Terminating • Physical – VM Detection Not Possible – Resource Intensive
  • 26. Environment Setup – Virtual • Network: Use Non-Host Connected Interface Be Careful
  • 27. Environment Options • Single Box – All Analysis Performed on One Machine – Risk of Potential Malware Sabotage • Dual+ Box – Mitigates Some Potential Sabotage – Gateway to Simulate More Real Network – Realistic External View (port sopen, network traffic)
  • 28. Environment Options – Single Box • Start with Base Unpatched Windows XP SP2 Box in VMware – Similar to First Set of Post-Install Instructions for Metasploit Unleashed – Switch to Classic View – Disable Windows Firewall – Turn Off Automatic Updates – Disable Alerts – Uncheck Simple File Sharing • Add Target Software – Older Versions If Needed • Starting with: OldVersion.com / OldApps.com • Google for Others • • • • Where to Get eBay, NewEgg, etc. Win Eval OSs (prev vs) Modern.ie AWS (servers only)
  • 29. Environment Options – Single Box • Install Dynamic Analysis Tools – Process Monitor • Shows File System, Registry & Process Activity that Started During Malware Execution – Process Explorer • Shows Info about Handles/DLLs Processes Opened/Loaded by Malware – WireShark • Sniffer to Capture Network the Malware May Make – RegShot • View Changes Malware May Make in the Registry Process Monitor: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx Process Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653 WireShark: https://www.wireshark.org/ RegShot: http://sourceforge.net/projects/regshot/
  • 30. Environment Options – Single Box • Install Dynamic Analysis Tools (cont) – TCPView • Allows Detection of Malware Initiated Network Connections – Malware Analysis Pack • MAP FakeDNS • MAP Right-Click (MD5 Hash, Strings, VirusTotal) – FakeNet • Aids Dynamic Analysis of Malicious Software • Simulates Network so Malware Thinks Its Interacting with Remote Hosts • DNS, HTTP, SSL, Dummy Listener TCPView: http://technet.microsoft.com/en-us/sysinternals/bb897437 MAP: http://www.woodmann.com/collaborative/tools/index.php/Malcode_Analysis_Pack FakeNet: http://practicalmalwareanalysis.com/fakenet/
  • 31. Environment Options – Single Box • Install Static Analysis Tools – OllyDbg with OllyDump Plugin • General Disassembler/Debugger for Windows Used to Analyze Malware in Assembly; Plugin to View Encrypted Malware – IDA Pro • Windows Disassembler/Debugger with Freeware Alternative – 010 Editor • Standard Hex Editor – Specialized Tools • PDFs: Didier Stevens’s pdfid.py & pdf-parser.py • Flash: SWFTtools • Others: Java, JavaScript OllyDbg: http://www.ollydbg.de/ OllyDump: http://www.openrce.org/downloads/details/108/OllyDump IDA Pro Freeware: http://www.hex-rays.com/products/ida/support/download_freeware.shtml Didier Stevens PDF Tools: http://blog.didierstevens.com/programs/pdf-tools/
  • 32. Environment Options – Single Box • Baseline – Configure VM to "Host-Only” Mode Secluded Network • Temporarily Change to NAT to Download Malware • Write-Once Media (e.g., CDs) • USB Key with Physical Write-Protect Switch – Imation USB 2.0 Clip Flash Drive – Kanguru Flashblu 2 – Snapshot VM
  • 33. Environment Dual+ Box – Fake Gateway Server • Second Machine for Target to Connect To – Additional Advantage of Examining Network Traffic without Possible Malware Sabotage – Implement Linux Server in VMware & Configure to Be Default Route on Victim Machine – Should Have Fixed IP Addresses • Enable or Install Software that Provides Needed Services – – – – – DNS: Configured to Return Fake Servers IP for All Queries HTTP IRC Others: DHCP, FTP, SSH Other Services Depending on Goal of Analysis
  • 34. Environment Dual+ Box – Fake Gateway Server • Install Network Analysis Tools – WireShark: Records Network Traffic from Victim – Netcat: Start Needed Ad-Hoc Services – Nmap: Scan for Open Ports External to Victim • Snapshot Fake Server Revert Back To
  • 35. Environment Preconfigured • REMnux – Created by Lenny Zeltser – ISO or Virtual Appliance – Static Analysis v4 • Load Malware on & Analyze • Web-Based Malware (e.g., Malicious JavaScript, Java Programs, & Flash Files) • Malicious Documents (e.g., Microsoft Office & Adobe PDF files) • Utilities for Reversing Malware through Memory Forensics – Dynamic Analysis • • • • Emulate Network Services Used as Fake Gateway Server Emulate Services in Isolated Lab Environment Infects Another Laboratory System with Malware Sample Directs Potentially-Malicious Connections to REMnux that's Listening on Appropriate Ports REMnux: http://zeltser.com/remnux/
  • 37. Environment Preconfigured • CuckooBox – Automated Dynamic Analysis of Malware – Data Captured • • • • Trace of Performed Relevant Win32 API Calls Dump of Network Traffic Generated During Analysis Creation of Screenshots Taken During Analysis Dump of Files Created, Deleted and Downloaded by the Malware During Analysis • Trace of Assembly Instructions Executed by Malware Process CuckooBox: http://cuckoobox.org/
  • 39. Methodology 1. Triage 2. Dynamic Analysis 3. Static Analysis
  • 40. Methodology 1. Triage a.  Run through External/Internal Sandbox Services for QnD Results • • b.  b. MD5 Hash Comparison (can run live is possible) • c. Goals: Establish Rough Idea of Malware Activities Tools: Norman Sandbox, GFI Sandbox, Anubis, Malwr.com, ThreatExpert.com, … • Goals: When Compiled, Packed or Obfuscated) Tools: VirusTotal.com, MAP, FileAlyzer, Google Hash  c. Determine Real File Type • • UNIX “file” Command and/or TrID Open in 010 & Look for Magic Numbers: Win Exe (MZ), PDF (%PDF), ZIP (PK), … (more at Wikipedia) d.  e.  f.  Unpack If Needed • Analyze Imports • • Goals: Discovery Interesting Things Malware May Be Importing (networking APIs for non-networking app) Tools: FileAlyzer (PD Imports), PEView f. Extract Readable Strings • e.  Tools: OllyDump, PE Explorer (UPX builtin) • Goals: Discover Interesting Data Points like Host Name & IP Addresses Tools: MAP Specialized Tools • E.g., pdfid.py, pdf-parser.py, SWFTtools, … MASTIFF: Open Source Linux Tool Automates Much of Above (on REMnux) v4
  • 41. Methodology 2. Dynamic Analysis a. • Take RegShot & Start WireShark, Process Monitor, Process Explorer, FakeNet & TCPView – Monitors File and Registry Access, Network Traffic, Process Creation, etc. b. • Execute Malware & Let it Run for 15 Minutes or Until Activity Dies Down – Watching WireShark, Process Monitor, & TCPView for Anything Interesting c. • Take Second RegShot & Stop WireShark, Process Monitor, FakeNet d. • Compare Initial & Final RegShots & Review All Monitoring Tool Logs
  • 42. Methodology 2. Dynamic Analysis (Regshot & Wireshark) a-1. a-2. a-3.
  • 43. Methodology 2. Dynamic Analysis (Process Monitor) a-4. a-5. a-6.
  • 44. Methodology 2. Dynamic Analysis (Process Explorer) a-7. Just Start
  • 45. Methodology 2. Dynamic Analysis (FakeNet) a-8. Just Start
  • 46. Methodology 2. Dynamic Analysis (TCPView) a-9. Just Start
  • 47. Methodology 2. Dynamic Analysis (Execute Malware) • Double-Click EXE • Rundll32.exe DLLName, Export arguments – PE Explorer to Discover Export arguments – E.g., rundll32.exe rip.dll, Install • Watch All Monitoring Tools & Stop When Activity Dies Down b. Just Monitor
  • 48. Methodology 2. Dynamic Analysis (Spin Down) c-3. c-1. c-2.
  • 51. Methodology 2. Dynamic Analysis (Analysis) c-6.• Save Logs for Future Reference c-7.• Analyze
  • 52. Methodology 3. Static Analysis d. • Use OllyDbg or IDA Pro to Disassemble & Analyze Deobfuscated Malware – Just Stare at It – ... – Stare Some More – ... – And Some More
  • 53. Where to Learn More OpenSecurityTraining.info
  • 54. Where to Learn More • OpenSecurityTraining.info – “Reverse Engineering Malware” • Matt Briggs & Frank Poz • “Practical Malware Analysis” by M. Sikorski/A. Honig • http://opensecuritytraining.info/ReverseEngineeringM alware.html
  • 55. Where to Learn More • Malware Analysis Toolkit: http://zeltser.com/malware-analysis-toolkit/ • OpenRCE: http://www.openrce.org/ • Certifications – TrainACE AMA – GREM, CHFI • NIST: 800-94, 800-83, 800-61 • Books: Practical Malware Analysis • NoVA Infosec: Workshop Style?
  • 56. Conclusion • Introduction • Environment – – – – Setup Single Box - Victim Dual+ Box – Fake Server Preconfigured • Methodology – Triage – Dynamic Analysis – Static Analysis • Where to Learn More – OpenSecurityTraining.info – Zeltser.com – OpenRCE.org • Conclusion
  • 57. Questions? • Twitter • Website • Contact @grecs NovaInfosec.com http://bit.ly/nispcontact