Introduction to Malware Analysis

Andrew McNicol
Andrew McNicolCTO at BreakPoint Labs, OSCE, OSCP um BreakPoint Labs, LLC
Introduction to Malware Analysis
Disclaimer 
• This stuff requires the analyst to dive 
extremely deep into technical details 
• This quick talk will attempt to give you a 1000 
foot view of malware analysis 
• I put a careful distinction between Malware 
Analysis and Reverse Engineering
Malware Analysis Overview 
• Static Analysis: involves analyzing the code 
without actually running the code 
– File identification, header information, strings, etc. 
– Disassembler – IDA Pro 
• Dynamic Analysis: involves executing the code in 
a controlled manner and monitoring system 
changes 
– Sysinternals, memory forencis, etc. 
– Debuggers – Immunity Debugger OllyDbg
Coding Terms 
• Malware authors with code in High Level Programming 
Language: C/C++
Static Analysis: File Identification 
• Linux “file” utility 
• Python-magic module
Static Analysis: MD5 Hash 
• Linux “md5sum” utility: md5sum <fileName> 
• Python hashlib module:
Static Analysis: Strings 
• Can be a quick way to gain intelligence from 
the file: 
– Domains, Ips, URLs, Function names, hardcoded 
information
Static Analysis: Packers 
• Packers are used to obfuscate the code which leads to: 
Changes the file signature (MD5 Hash) 
– Obfuscates the file strings, and code 
– Compress file size (sometimes) 
• Packed code can be identified by: 
– Examining the PE sections, and Imports: If a PE file only 
has LoadLibrary/GetProcAddress normally packed 
– Strings: UPX0, UPX1, aspack, adata, NSP0, NSP1, WinRAR 
SFX, PEC2, PECompact2, Themida, Orean.sys, NTkrnl, 
Secure Suite 
• Tools like (PEiD, LordPE, and Python peutils module)
Static Analysis: Packers 
• Unpacked vs. Packed Strings:
Data Encoding 
• Malware uses encoding for a number of reasons, 
some are to disguise internal workings, hide C2 
information, and data exfil 
– Some simple encoding algorithms are: 
– Character Substitution 
– XOR – uses a static key to XOR with the original value 
– Base64 – Can use default or custom character set 
– Default Base64 character set: A-Z, a-z, 0-9, +, / 
• We will examine two common data encoding 
techniques used in Malware XOR and Base64
Data Encoding: XOR 
• Strings are often required to be stored in a program in order 
to pass it as a parameter to a function 
• XOR once = encoded 
• XOR again with same key = plaintext
Data Encoding: Base64 
• Storing base64 strings as HTML comments is how the APT group 
“Comment Crew” got their name. This technique is still leveraged today in 
malware 
• Base64 is a common encoding scheme because it is very easy to decode
Static Analysis: PE File Format 
• PE data structure contains all the information required for the 
Windows OS loader to manage executable code. .text – instructions 
the CPU executes 
– .rdata – Imports and Exports 
– .data – Global data 
– .rsrc – Resources (icons, images, strings, etc.) 
• Useful information in PE header: Imports and Exports – Gives an 
idea to malware functionality 
– Compilation Time, Language Settings, and strings 
– Section Names – Packed code can have non-standard section names 
• Tools to analyze PE header: pescanner.py, CFF Explorer, python 
pefile, Resource Hacker, Dependency Walker, LordPE, etc.
Windows API Calls: 
• When performing advanced static or dynamic analysis it’s 
important to have a good understanding of Windows API calls 
• By looking at the imported functions within the PE header you 
can see which Windows API functions the PE file wants to 
utilize 
• By recognizing API calls you can quickly get an idea of 
malware’s functionality by analyzing strings output, and 
during advanced static analysis using a disassembler 
• An excellent resource for Windows API calls is MSDN. Google 
search “API_Function MSDN”
Windows API: MSDN Example 
• The Parameters modify how the function will be used on the 
system. 
• The return type is what the function will return after it is 
called in a program
Windows API: Disassembly 
• Parameters are pushed to the stack in Last In First Out(LIFO) 
order, which is why they are in reverse order in the 
disassembly
Wake Up  
• Okay, that was likely starting to bore some 
people – SORRY 
• Let’s move to Dynamic analysis which is more 
flashy
Getting Infected 
• Double clicking the executable doesn’t always work 
– Sometimes you need to register the malware as a service or load it as 
a DLL (regsvr32.exe and rundll32.exe ) 
• Install the malware as a service 
– Interact with the system like a normal user The 
malware may be waiting for a certain application to open 
to inject code into it (Ex: Internet Explorer) 
– It could require a CLI argument : One sample required 
<filename> /install in order to actually run the malware 
– Static analysis is normally required to determine CLI 
switches
SysInternals Tool Suite 
• If I could pick just one tool, id pick the 50+ in 
the Sysinternals tool suite  
• Tools put out by Mark Russinovich – now 
works for Microsoft 
• Process Explorer, Process Monitor, Autoruns, 
etc.
Process Explorer
Process Monitor 
• Very verbose tool that generates a lot of events 
• Filtering is required to make sense of the data
Process Monitor Cont. 
• Press Ctrl+L to bring up the filtering dialog box 
– Quick filters are: Operation is WriteFile 
– Category is Write
Malware Persistence - Autoruns 
• Really is the key to identify malware – how does it gain 
persistence? 
• Autoruns can help enumerate persistence mechanisms:
Monitoring Network Activity 
• Some interesting network indicators of malware are: 
– SYNs out to an IP or domain 
– UDP traffic to IP or domain 
– HTTP GET/POST requests 
– DNS Queries 
– Connection attempt times are important. Every 1 min, 30mins, etc.
Automation? Sandboxes 
• So far the basic dynamic analysis we have talked about 
can be automated 
• Sandboxes are a good tool in any malware analyst 
toolbox – they have Pro’s and Con’s: 
– Pros: Speeds up analysis, fast, saves time 
– Cons: Misses details, can be fooled 
• Sandboxes can be open source or commercial: 
– Really good free option is Cuckoo sandbox: 
• Install Tutorial: http://www.primalsecurity.net/im-cuckoo-for-malware- 
with-a-spice-of-reverse-engineering/
Summary 
• Malware analysis requires both static and 
dynamic analysis techniques to accurately 
enumerate indicators of compromise 
• As with any automated tool an analyst will 
need to be able to validate findings manually
1 von 26

Recomendados

Malware analysis, threat intelligence and reverse engineering von
Malware analysis, threat intelligence and reverse engineeringMalware analysis, threat intelligence and reverse engineering
Malware analysis, threat intelligence and reverse engineeringbartblaze
33.3K views78 Folien
Basic malware analysis von
Basic malware analysisBasic malware analysis
Basic malware analysissecurityxploded
3.7K views33 Folien
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T... von
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
6.7K views72 Folien
Malware Static Analysis von
Malware Static AnalysisMalware Static Analysis
Malware Static AnalysisHossein Yavari
259 views60 Folien
Malware analysis von
Malware analysisMalware analysis
Malware analysisPrakashchand Suthar
3.4K views39 Folien
Introduction to Malware von
Introduction to MalwareIntroduction to Malware
Introduction to Malwareamiable_indian
7.7K views35 Folien

Más contenido relacionado

Was ist angesagt?

The rise of malware(ransomware) von
The rise of malware(ransomware)The rise of malware(ransomware)
The rise of malware(ransomware)phexcom1
487 views18 Folien
Hunting Lateral Movement in Windows Infrastructure von
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows InfrastructureSergey Soldatov
9K views52 Folien
Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?" von
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
3.3K views63 Folien
Ransomware von
RansomwareRansomware
RansomwareNick Miller
2.4K views5 Folien
PHDays 2018 Threat Hunting Hands-On Lab von
PHDays 2018 Threat Hunting Hands-On LabPHDays 2018 Threat Hunting Hands-On Lab
PHDays 2018 Threat Hunting Hands-On LabTeymur Kheirkhabarov
7.7K views116 Folien
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis von
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisSam Bowne
2.6K views46 Folien

Was ist angesagt?(20)

The rise of malware(ransomware) von phexcom1
The rise of malware(ransomware)The rise of malware(ransomware)
The rise of malware(ransomware)
phexcom1487 views
Hunting Lateral Movement in Windows Infrastructure von Sergey Soldatov
Hunting Lateral Movement in Windows InfrastructureHunting Lateral Movement in Windows Infrastructure
Hunting Lateral Movement in Windows Infrastructure
Sergey Soldatov9K views
Introduction to Dynamic Malware Analysis ...Or am I "Cuckoo for Malware?" von Lane Huff
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 Huff3.3K views
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis von Sam Bowne
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic AnalysisCNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
Sam Bowne2.6K views
Ransomware - The Growing Threat von Nick Miller
Ransomware - The Growing ThreatRansomware - The Growing Threat
Ransomware - The Growing Threat
Nick Miller1.1K views
Ethical hacking : Its methodologies and tools von chrizjohn896
Ethical hacking : Its methodologies and toolsEthical hacking : Its methodologies and tools
Ethical hacking : Its methodologies and tools
chrizjohn896621 views
Vulnerabilities in modern web applications von Niyas Nazar
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
Niyas Nazar1.5K views
Hunting for Privilege Escalation in Windows Environment von Teymur Kheirkhabarov
Hunting for Privilege Escalation in Windows EnvironmentHunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows Environment
Teymur Kheirkhabarov11.9K views
Malware Analysis 101 - N00b to Ninja in 60 Minutes at BSidesLV on August 5, ... von grecsl
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, ...
grecsl5.9K views
Basic Malware Analysis von Albert Hui
Basic Malware AnalysisBasic Malware Analysis
Basic Malware Analysis
Albert Hui4.4K views
Fantastic Red Team Attacks and How to Find Them von Ross Wolf
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find Them
Ross Wolf894 views
Nessus Software von Megha Sahu
Nessus SoftwareNessus Software
Nessus Software
Megha Sahu2.6K views
Introduction to Web Application Penetration Testing von Anurag Srivastava
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
Anurag Srivastava2.2K views
Metasploit von henelpj
MetasploitMetasploit
Metasploit
henelpj3.8K views
Malware von Tuhin_Das
MalwareMalware
Malware
Tuhin_Das12.7K views

Destacado

Viruses andthreats@dharmesh von
Viruses andthreats@dharmeshViruses andthreats@dharmesh
Viruses andthreats@dharmeshDharmesh Kumar Sharma
1.2K views48 Folien
Malware- Types, Detection and Future von
Malware- Types, Detection and FutureMalware- Types, Detection and Future
Malware- Types, Detection and Futurekaranwayne
6.2K views15 Folien
Malware von
MalwareMalware
Malwaregonzalosantomemolanes
3.4K views10 Folien
Malware von
Malware Malware
Malware javierholgueras
7.6K views105 Folien
Computer Malware von
Computer MalwareComputer Malware
Computer Malwareaztechtchr
26.4K views28 Folien
Malware ppt von
Malware pptMalware ppt
Malware pptFaiz Khan
43.2K views10 Folien

Similar a Introduction to Malware Analysis

Ch0 1 von
Ch0 1Ch0 1
Ch0 1TylerDerdun
79 views72 Folien
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques von
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
6.3K views75 Folien
RIoT (Raiding Internet of Things) by Jacob Holcomb von
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob HolcombPriyanka Aash
1.1K views51 Folien
BSIDES-PR Keynote Hunting for Bad Guys von
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad GuysJoff Thyer
444 views46 Folien
Monitorama 2015 Netflix Instance Analysis von
Monitorama 2015 Netflix Instance AnalysisMonitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance AnalysisBrendan Gregg
34.8K views69 Folien

Similar a Introduction to Malware Analysis(20)

CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques von Sam Bowne
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
Sam Bowne6.3K views
RIoT (Raiding Internet of Things) by Jacob Holcomb von Priyanka Aash
RIoT  (Raiding Internet of Things)  by Jacob HolcombRIoT  (Raiding Internet of Things)  by Jacob Holcomb
RIoT (Raiding Internet of Things) by Jacob Holcomb
Priyanka Aash1.1K views
BSIDES-PR Keynote Hunting for Bad Guys von Joff Thyer
BSIDES-PR Keynote Hunting for Bad GuysBSIDES-PR Keynote Hunting for Bad Guys
BSIDES-PR Keynote Hunting for Bad Guys
Joff Thyer444 views
Monitorama 2015 Netflix Instance Analysis von Brendan Gregg
Monitorama 2015 Netflix Instance AnalysisMonitorama 2015 Netflix Instance Analysis
Monitorama 2015 Netflix Instance Analysis
Brendan Gregg34.8K views
You need a PROcess to catch running processes and their modules_v2.0 von Michael Gough
You need a PROcess to catch running processes and their modules_v2.0You need a PROcess to catch running processes and their modules_v2.0
You need a PROcess to catch running processes and their modules_v2.0
Michael Gough506 views
Logging for Hackers v1.0 von Michael Gough
Logging for Hackers v1.0Logging for Hackers v1.0
Logging for Hackers v1.0
Michael Gough1.6K views
Building next gen malware behavioural analysis environment von isc2-hellenic
Building next gen malware behavioural analysis environment Building next gen malware behavioural analysis environment
Building next gen malware behavioural analysis environment
isc2-hellenic633 views
DC612 Day - Hands on Penetration Testing 101 von dc612
DC612 Day - Hands on Penetration Testing 101DC612 Day - Hands on Penetration Testing 101
DC612 Day - Hands on Penetration Testing 101
dc6124.3K views
Deeplook into apt and how to detect and defend v1.0 von Michael Gough
Deeplook into apt and how to detect and defend v1.0Deeplook into apt and how to detect and defend v1.0
Deeplook into apt and how to detect and defend v1.0
Michael Gough1.7K views
EMBA - Firmware analysis DEFCON30 demolabs USA 2022 von MichaelM85042
EMBA - Firmware analysis DEFCON30 demolabs USA 2022EMBA - Firmware analysis DEFCON30 demolabs USA 2022
EMBA - Firmware analysis DEFCON30 demolabs USA 2022
MichaelM85042182 views
openioc_scan - IOC scanner for memory forensics von Takahiro Haruyama
openioc_scan - IOC scanner for memory forensicsopenioc_scan - IOC scanner for memory forensics
openioc_scan - IOC scanner for memory forensics
Takahiro Haruyama5.4K views
EMBA Firmware analysis - TROOPERS22 von MichaelM85042
EMBA Firmware analysis - TROOPERS22EMBA Firmware analysis - TROOPERS22
EMBA Firmware analysis - TROOPERS22
MichaelM85042100 views
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too... von RootedCON
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...
Jaime Blasco - Fighting Advanced Persistent Threat (APT) with Open Source Too...
RootedCON2.6K views
Piratng Avs to bypass exploit mitigation von Priyanka Aash
Piratng Avs to bypass exploit mitigationPiratng Avs to bypass exploit mitigation
Piratng Avs to bypass exploit mitigation
Priyanka Aash408 views
Captain Hook: Pirating AVs to Bypass Exploit Mitigations von enSilo
Captain Hook: Pirating AVs to Bypass Exploit MitigationsCaptain Hook: Pirating AVs to Bypass Exploit Mitigations
Captain Hook: Pirating AVs to Bypass Exploit Mitigations
enSilo4K views

Más de Andrew McNicol

BSidesJXN 2017 - Improving Vulnerability Management von
BSidesJXN 2017 - Improving Vulnerability ManagementBSidesJXN 2017 - Improving Vulnerability Management
BSidesJXN 2017 - Improving Vulnerability ManagementAndrew McNicol
462 views28 Folien
BSides Philly Finding a Company's BreakPoint von
BSides Philly Finding a Company's BreakPointBSides Philly Finding a Company's BreakPoint
BSides Philly Finding a Company's BreakPointAndrew McNicol
346 views48 Folien
BSidesJXN 2016: Finding a Company's BreakPoint von
BSidesJXN 2016: Finding a Company's BreakPointBSidesJXN 2016: Finding a Company's BreakPoint
BSidesJXN 2016: Finding a Company's BreakPointAndrew McNicol
666 views48 Folien
BSidesDC 2016 Beyond Automated Testing von
BSidesDC 2016 Beyond Automated TestingBSidesDC 2016 Beyond Automated Testing
BSidesDC 2016 Beyond Automated TestingAndrew McNicol
501 views50 Folien
Beyond Automated Testing - RVAsec 2016 von
Beyond Automated Testing - RVAsec 2016Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016Andrew McNicol
693 views52 Folien
Pentesting Tips: Beyond Automated Testing von
Pentesting Tips: Beyond Automated TestingPentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated TestingAndrew McNicol
1.9K views62 Folien

Más de Andrew McNicol(12)

BSidesJXN 2017 - Improving Vulnerability Management von Andrew McNicol
BSidesJXN 2017 - Improving Vulnerability ManagementBSidesJXN 2017 - Improving Vulnerability Management
BSidesJXN 2017 - Improving Vulnerability Management
Andrew McNicol462 views
BSides Philly Finding a Company's BreakPoint von Andrew McNicol
BSides Philly Finding a Company's BreakPointBSides Philly Finding a Company's BreakPoint
BSides Philly Finding a Company's BreakPoint
Andrew McNicol346 views
BSidesJXN 2016: Finding a Company's BreakPoint von Andrew McNicol
BSidesJXN 2016: Finding a Company's BreakPointBSidesJXN 2016: Finding a Company's BreakPoint
BSidesJXN 2016: Finding a Company's BreakPoint
Andrew McNicol666 views
BSidesDC 2016 Beyond Automated Testing von Andrew McNicol
BSidesDC 2016 Beyond Automated TestingBSidesDC 2016 Beyond Automated Testing
BSidesDC 2016 Beyond Automated Testing
Andrew McNicol501 views
Beyond Automated Testing - RVAsec 2016 von Andrew McNicol
Beyond Automated Testing - RVAsec 2016Beyond Automated Testing - RVAsec 2016
Beyond Automated Testing - RVAsec 2016
Andrew McNicol693 views
Pentesting Tips: Beyond Automated Testing von Andrew McNicol
Pentesting Tips: Beyond Automated TestingPentesting Tips: Beyond Automated Testing
Pentesting Tips: Beyond Automated Testing
Andrew McNicol1.9K views
How To Start Your InfoSec Career von Andrew McNicol
How To Start Your InfoSec CareerHow To Start Your InfoSec Career
How To Start Your InfoSec Career
Andrew McNicol1.3K views
BSides_Charm2015_Info sec hunters_gathers von Andrew McNicol
BSides_Charm2015_Info sec hunters_gathersBSides_Charm2015_Info sec hunters_gathers
BSides_Charm2015_Info sec hunters_gathers
Andrew McNicol2.2K views
Introduction to Penetration Testing von Andrew McNicol
Introduction to Penetration TestingIntroduction to Penetration Testing
Introduction to Penetration Testing
Andrew McNicol10.4K views
Introduction to Python for Security Professionals von Andrew McNicol
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
Andrew McNicol34K views
OSINT for Attack and Defense von Andrew McNicol
OSINT for Attack and DefenseOSINT for Attack and Defense
OSINT for Attack and Defense
Andrew McNicol9.8K views

Último

"Fast Start to Building on AWS", Igor Ivaniuk von
"Fast Start to Building on AWS", Igor Ivaniuk"Fast Start to Building on AWS", Igor Ivaniuk
"Fast Start to Building on AWS", Igor IvaniukFwdays
36 views76 Folien
ChatGPT and AI for Web Developers von
ChatGPT and AI for Web DevelopersChatGPT and AI for Web Developers
ChatGPT and AI for Web DevelopersMaximiliano Firtman
174 views82 Folien
Microchip: CXL Use Cases and Enabling Ecosystem von
Microchip: CXL Use Cases and Enabling EcosystemMicrochip: CXL Use Cases and Enabling Ecosystem
Microchip: CXL Use Cases and Enabling EcosystemCXL Forum
129 views12 Folien
Web Dev - 1 PPT.pdf von
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdfgdsczhcet
52 views45 Folien
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ... von
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ..."Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...Fwdays
33 views39 Folien

Último(20)

"Fast Start to Building on AWS", Igor Ivaniuk von Fwdays
"Fast Start to Building on AWS", Igor Ivaniuk"Fast Start to Building on AWS", Igor Ivaniuk
"Fast Start to Building on AWS", Igor Ivaniuk
Fwdays36 views
Microchip: CXL Use Cases and Enabling Ecosystem von CXL Forum
Microchip: CXL Use Cases and Enabling EcosystemMicrochip: CXL Use Cases and Enabling Ecosystem
Microchip: CXL Use Cases and Enabling Ecosystem
CXL Forum129 views
Web Dev - 1 PPT.pdf von gdsczhcet
Web Dev - 1 PPT.pdfWeb Dev - 1 PPT.pdf
Web Dev - 1 PPT.pdf
gdsczhcet52 views
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ... von Fwdays
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ..."Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
"Quality Assurance: Achieving Excellence in startup without a Dedicated QA", ...
Fwdays33 views
Future of Learning - Khoong Chan Meng von NUS-ISS
Future of Learning - Khoong Chan MengFuture of Learning - Khoong Chan Meng
Future of Learning - Khoong Chan Meng
NUS-ISS31 views
Micron CXL product and architecture update von CXL Forum
Micron CXL product and architecture updateMicron CXL product and architecture update
Micron CXL product and architecture update
CXL Forum27 views
AMD: 4th Generation EPYC CXL Demo von CXL Forum
AMD: 4th Generation EPYC CXL DemoAMD: 4th Generation EPYC CXL Demo
AMD: 4th Generation EPYC CXL Demo
CXL Forum126 views
GigaIO: The March of Composability Onward to Memory with CXL von CXL Forum
GigaIO: The March of Composability Onward to Memory with CXLGigaIO: The March of Composability Onward to Memory with CXL
GigaIO: The March of Composability Onward to Memory with CXL
CXL Forum126 views
MemVerge: Gismo (Global IO-free Shared Memory Objects) von CXL Forum
MemVerge: Gismo (Global IO-free Shared Memory Objects)MemVerge: Gismo (Global IO-free Shared Memory Objects)
MemVerge: Gismo (Global IO-free Shared Memory Objects)
CXL Forum112 views
Combining Orchestration and Choreography for a Clean Architecture von ThomasHeinrichs1
Combining Orchestration and Choreography for a Clean ArchitectureCombining Orchestration and Choreography for a Clean Architecture
Combining Orchestration and Choreography for a Clean Architecture
ThomasHeinrichs168 views
MemVerge: Memory Viewer Software von CXL Forum
MemVerge: Memory Viewer SoftwareMemVerge: Memory Viewer Software
MemVerge: Memory Viewer Software
CXL Forum118 views
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad... von Fwdays
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad..."Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
"Ukrainian Mobile Banking Scaling in Practice. From 0 to 100 and beyond", Vad...
Fwdays40 views
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen... von NUS-ISS
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...
Upskilling the Evolving Workforce with Digital Fluency for Tomorrow's Challen...
NUS-ISS23 views
Data-centric AI and the convergence of data and model engineering: opportunit... von Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier29 views
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... von Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin70 views
Business Analyst Series 2023 - Week 3 Session 5 von DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10165 views
MemVerge: Past Present and Future of CXL von CXL Forum
MemVerge: Past Present and Future of CXLMemVerge: Past Present and Future of CXL
MemVerge: Past Present and Future of CXL
CXL Forum110 views

Introduction to Malware Analysis

  • 2. Disclaimer • This stuff requires the analyst to dive extremely deep into technical details • This quick talk will attempt to give you a 1000 foot view of malware analysis • I put a careful distinction between Malware Analysis and Reverse Engineering
  • 3. Malware Analysis Overview • Static Analysis: involves analyzing the code without actually running the code – File identification, header information, strings, etc. – Disassembler – IDA Pro • Dynamic Analysis: involves executing the code in a controlled manner and monitoring system changes – Sysinternals, memory forencis, etc. – Debuggers – Immunity Debugger OllyDbg
  • 4. Coding Terms • Malware authors with code in High Level Programming Language: C/C++
  • 5. Static Analysis: File Identification • Linux “file” utility • Python-magic module
  • 6. Static Analysis: MD5 Hash • Linux “md5sum” utility: md5sum <fileName> • Python hashlib module:
  • 7. Static Analysis: Strings • Can be a quick way to gain intelligence from the file: – Domains, Ips, URLs, Function names, hardcoded information
  • 8. Static Analysis: Packers • Packers are used to obfuscate the code which leads to: Changes the file signature (MD5 Hash) – Obfuscates the file strings, and code – Compress file size (sometimes) • Packed code can be identified by: – Examining the PE sections, and Imports: If a PE file only has LoadLibrary/GetProcAddress normally packed – Strings: UPX0, UPX1, aspack, adata, NSP0, NSP1, WinRAR SFX, PEC2, PECompact2, Themida, Orean.sys, NTkrnl, Secure Suite • Tools like (PEiD, LordPE, and Python peutils module)
  • 9. Static Analysis: Packers • Unpacked vs. Packed Strings:
  • 10. Data Encoding • Malware uses encoding for a number of reasons, some are to disguise internal workings, hide C2 information, and data exfil – Some simple encoding algorithms are: – Character Substitution – XOR – uses a static key to XOR with the original value – Base64 – Can use default or custom character set – Default Base64 character set: A-Z, a-z, 0-9, +, / • We will examine two common data encoding techniques used in Malware XOR and Base64
  • 11. Data Encoding: XOR • Strings are often required to be stored in a program in order to pass it as a parameter to a function • XOR once = encoded • XOR again with same key = plaintext
  • 12. Data Encoding: Base64 • Storing base64 strings as HTML comments is how the APT group “Comment Crew” got their name. This technique is still leveraged today in malware • Base64 is a common encoding scheme because it is very easy to decode
  • 13. Static Analysis: PE File Format • PE data structure contains all the information required for the Windows OS loader to manage executable code. .text – instructions the CPU executes – .rdata – Imports and Exports – .data – Global data – .rsrc – Resources (icons, images, strings, etc.) • Useful information in PE header: Imports and Exports – Gives an idea to malware functionality – Compilation Time, Language Settings, and strings – Section Names – Packed code can have non-standard section names • Tools to analyze PE header: pescanner.py, CFF Explorer, python pefile, Resource Hacker, Dependency Walker, LordPE, etc.
  • 14. Windows API Calls: • When performing advanced static or dynamic analysis it’s important to have a good understanding of Windows API calls • By looking at the imported functions within the PE header you can see which Windows API functions the PE file wants to utilize • By recognizing API calls you can quickly get an idea of malware’s functionality by analyzing strings output, and during advanced static analysis using a disassembler • An excellent resource for Windows API calls is MSDN. Google search “API_Function MSDN”
  • 15. Windows API: MSDN Example • The Parameters modify how the function will be used on the system. • The return type is what the function will return after it is called in a program
  • 16. Windows API: Disassembly • Parameters are pushed to the stack in Last In First Out(LIFO) order, which is why they are in reverse order in the disassembly
  • 17. Wake Up  • Okay, that was likely starting to bore some people – SORRY • Let’s move to Dynamic analysis which is more flashy
  • 18. Getting Infected • Double clicking the executable doesn’t always work – Sometimes you need to register the malware as a service or load it as a DLL (regsvr32.exe and rundll32.exe ) • Install the malware as a service – Interact with the system like a normal user The malware may be waiting for a certain application to open to inject code into it (Ex: Internet Explorer) – It could require a CLI argument : One sample required <filename> /install in order to actually run the malware – Static analysis is normally required to determine CLI switches
  • 19. SysInternals Tool Suite • If I could pick just one tool, id pick the 50+ in the Sysinternals tool suite  • Tools put out by Mark Russinovich – now works for Microsoft • Process Explorer, Process Monitor, Autoruns, etc.
  • 21. Process Monitor • Very verbose tool that generates a lot of events • Filtering is required to make sense of the data
  • 22. Process Monitor Cont. • Press Ctrl+L to bring up the filtering dialog box – Quick filters are: Operation is WriteFile – Category is Write
  • 23. Malware Persistence - Autoruns • Really is the key to identify malware – how does it gain persistence? • Autoruns can help enumerate persistence mechanisms:
  • 24. Monitoring Network Activity • Some interesting network indicators of malware are: – SYNs out to an IP or domain – UDP traffic to IP or domain – HTTP GET/POST requests – DNS Queries – Connection attempt times are important. Every 1 min, 30mins, etc.
  • 25. Automation? Sandboxes • So far the basic dynamic analysis we have talked about can be automated • Sandboxes are a good tool in any malware analyst toolbox – they have Pro’s and Con’s: – Pros: Speeds up analysis, fast, saves time – Cons: Misses details, can be fooled • Sandboxes can be open source or commercial: – Really good free option is Cuckoo sandbox: • Install Tutorial: http://www.primalsecurity.net/im-cuckoo-for-malware- with-a-spice-of-reverse-engineering/
  • 26. Summary • Malware analysis requires both static and dynamic analysis techniques to accurately enumerate indicators of compromise • As with any automated tool an analyst will need to be able to validate findings manually