SlideShare a Scribd company logo
1 of 23
REMnux Tutorial-1: Statically
Examine Portable
Executables(PE) Files
Rhydham Joshi
M.S. in Software Engineering, San Jose State University
Phone : (+1) 408-987-1991 | Email : rhydham.joshi@yahoo.com
Blog : malwareforensics1.blogspot.com | Linkedin : www.linkedin.com/in/rhydhamjoshi
Contents:
• REMnux:
• Introduction to REMnux
• Entropy:
• Use of Entropy for malware detection
• Un-packing:
• UPX
• ByteHist
• Density Scout
• Anomaly Detection:
• PEScanner
• EXEScan
• PEFrame
• PEV
• Investigation:
• Pyew
• Bokken
• Disassemblers vs Debuggers vs Decompilers:
• Commonly used tools
• References
REMnux: A Linux Toolkit for Reverse-Engineering and
Analyzing Malware
• REMnux is a free, lightweight Linux (Ubuntu distribution) toolkit for reverse-engineering
malicious software.
• REMnux provides the collection of some of the most common and effective tools used for reverse
engineering malwares in categories like:
1) Investigate Linux malwares
2) Statically analyze windows executable file
3) Examine File properties and contents
4) Multiple sample processing
5) Memory Snapshot Examination
6) Extract and decode artifacts
7) Examine Documents
8) Browser Malware Examination
9) Network utilities
• For more information about REMnux, navigate to my blog at:
http://malwareforensics1.blogspot.com/2015/04/the-power-of-remnux-linux-toolkit-for.html
Entropy
• Entropy is a measure of the unpredictability of an information stream. A perfectly consistent
stream of bits (all zeroes, or all ones) is totally predictable (has no entropy). A stream of completely
unpredictable bits has maximum entropy.
• Range of entropy for 8 byte value : 0 (No entropy) -> 8(Maximum entropy)
• better is the encryption or packing, Higher will be the entropy level.
Use of Entropy in detecting malware:
• Entropy can be used is many different way, but quite commonly to detect encryption and
compression, since truly random data is not common in typical user data.
• Encrypted or packed data prevents an AV engine from seeing "inside" the executables and so the
level of entropy will be high which may trigger an signal to malware investigator about it.
• It is also very helpful in identifying files that have a high-amount of randomness which could
indicate an encrypted container/volume that may go otherwise unnoticed.
Unpacking -> UPX
• UPX is distributed with full source code under the GNU General Public License v2+
for packing/unpacking executables.
• UPX provides excellent compression ratio and very fast decompression.
• It provides in-place decompression so the executable suffers from no memory
overhead.
• It is safe, universal and portable and supports various executable formats.
• It command line utility available for win32/linux and it is used to pack the malware
executables.
• A tool for generating byte-usage-histograms for all types of files with a special focus on binary executables in
PE-format (Windows).
Features:
• Makes byte-usage-histograms of any file of any size
• Histograms are generated as sorted and unsorted diagrams
• Sub-histograms for each section of binary executables (PE)
• Quick overview with GUI navigation in case of sub-histograms
• Percentage for the share in the total filesize for sub-histograms
“The byte-distribution of unencrypted and unpacked clear text, database-files and executable binaries differs
massively as compared to the encrypted and/or packed ones. By putting this "phenomenon" into a picture this
difference can be easily visualized by histograms.”
Unpacking -> ByteHist
Unpacking -> ByteHist
• The tall green bar on the most left side tells represents pixel-column for 0h byte-code and the most
right side represents FFh byte-code.
• Red section arranges the pixel-columns in descending order.
• Section-wise distribution tells us about which section we need to analyze. This feature gives a reverser
the possibility to instantly find out the section that's containing (if so) packed/encrypted data.
Unpacking -> Density Scout
• Density Scout is a tool that has been written for one purpose: finding
(eventually unknown) malware on a potentially infected system.
• Therefore it takes advantage of the typical approach of malware authors to
protect their "products" with obfuscation like run-time-packing and -
encryption.
• It is based on the concept of Bytehist.
• Density Scout's main focus is to scan a desired file-system-path by
calculating the density of each file to finally print out a descending list.
• Usually Microsoft Windows executables are not packed or encrypted in any
way which throws the hits of malicious executables to the top of the list
where you can easily focus on.
Unpacking -> Density Scout
Max Entropy for C:WindowsSystem32 folder in my system is 1.84094
Anomaly detection -> PEScanner
pescanner.py is a PE analyzer written in python.
The script has the ability to detect:
• Files with TLS entries
• Files with resource directories
• Suspicious IAT entries
• Suspicious entry point sections
• Sections with zero-length raw sizes
• Sections with extremely low or high entropy
• Invalid timestamps
• File version information
Among other things, this script is helpful to:
• understand the behavior of an executable
• classify malwares (UPX packed, trojan downloader, trojan dropper, ...)
Anomaly detection -> PEScanner
Anomaly Detection -> ExeScan
• ExeScan is the FREE command-line tool to detect anomalies in PE (Portable Executable or
EXE/DLL) files.
• It instantly scans EXE/DLL file and reports all kind of abnormalities in the PE header fields
such as checksum differences, header field sizes, non-ascii/empty section names,
improper size of raw data etc.
• Typically Malwares use packers/protectors to pack their EXE.
• These packers modify PE header fields in EXE file to make reverse engineering of these
malwares difficult.
• E.g. : These anomalies in PE header can crash debugger thus preventing any attempt to
reversing. Exe-scan becomes handy in such situations.
• Features of EXE-Scan :
* Instantly detect all kind of abnormalities in EXE/PE file.
* Detect the type of Compiler/Packer used in the PE file.
* Scan for commonly used malware APIs
* Great for automation
* Displays PE header and Import table structures
* Generate detailed analysis report
Anomaly Detection -> ExeScan
Anomaly Detection -> PEFrame
• Dowload PEFrame in linux using following command:
pip install https://github.com/guelfoweb/peframe/archive/master.zip
• It lists different sections for anomaly
detection like :
• MD5 Hash Value,
• XOR Discovered
• Digital Signature
• Packers
• Anti Debug code
• Anti VM tricks
• Suspicious API
• Suspicious Sections
• Files, URL and Metadata names
• Imports/exports of file
• Strings
• Dump
Anomaly Detection -> PEFrame
Anomaly Detection -> Pev tool
• Pev is a multiplatform toolkit to work with PE binaries.
• Its main goal is to provide feature-rich tools for proper analyze binaries, specially the suspicious
ones.
Features:
• Based on own PE library, called libpe
• Support for PE32 and PE32+ (64-bit) files
• Formatted output in text and CSV (other formats in development)
Tools:
• pesec: check security features in PE files, extract certificates and more
• readpe: parse PE headers, sections, imports and exports
• pescan: detect TLS callback functions, DOS stub modification, suspicious sections and more
• pedis: disassembly a PE file section or function with support for Intel and AT&T syntax
• pehash: calculate PE file hashes
• pepack: detect if an executable is packed or not
• pestr: search for hardcoded Unicode and ASCII strings simultaneously in PE files
• peres: show and extract PE file resources
Anomaly Detection -> Pev tool
Investigation -> Pyew
Investigation -> Pyew
Investigation -> Bokken
Disassembler vs Debugger vs Decompiler
Reversing tools for Windows (some may work on other platforms):
• Jclasslib (bytecode viewer)
• FrontEnd Plus (java bytecode decompiler)
• Jad (java bytecode decompiler)
• Fernflower (java bytecode decompiler)
• OllyDbg (machine code debugger-disassembler)
• IdaPro (machine code debugger-disassembler)
• PEBrowse (machine code debugger-disassembler)
• Boomerang (machine code decompiler)
References:
• Entropy for files: http://www.forensickb.com/2013/03/file-entropy-
explained.html
• UPX: http://upx.sourceforge.net/
• Bitehist: https://www.cert.at/downloads/software/bytehist_en.html
• DensityScout : http://digital-forensics.sans.org/blog/2012/04/26/finding-
unknown-malware-with-densityscout
• PEScanner : http://sourceforge.net/projects/pescanner/
• EXE-Scan : http://securityxploded.com/exe-scan.php
• PEFrame : http://www.tekdefense.com/news/2013/3/17/tektip-ep25-static-
malware-analysis-with-peframe.html
• PEV : http://pev.sourceforge.net/
• PYEW : https://github.com/joxeankoret/pyew
• Bokken : https://inguma.eu/projects/bokken/wiki/Installation
Thank you.!

More Related Content

What's hot

What's hot (20)

Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker Security: Are Your Containers Tightly Secured to the Ship?
 
Malicious Payloads vs Deep Visibility: A PowerShell Story
Malicious Payloads vs Deep Visibility: A PowerShell StoryMalicious Payloads vs Deep Visibility: A PowerShell Story
Malicious Payloads vs Deep Visibility: A PowerShell Story
 
Rules to Hack By - Offensivecon 2022 keynote
Rules to Hack By - Offensivecon 2022 keynoteRules to Hack By - Offensivecon 2022 keynote
Rules to Hack By - Offensivecon 2022 keynote
 
CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3
 
CNIT 152: 3 Pre-Incident Preparation
CNIT 152: 3 Pre-Incident PreparationCNIT 152: 3 Pre-Incident Preparation
CNIT 152: 3 Pre-Incident Preparation
 
Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017Building Better Backdoors with WMI - DerbyCon 2017
Building Better Backdoors with WMI - DerbyCon 2017
 
CNIT 126 2: Malware Analysis in Virtual Machines & 3: Basic Dynamic Analysis
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
 
Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016Invoke-Obfuscation DerbyCon 2016
Invoke-Obfuscation DerbyCon 2016
 
Thick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptxThick client pentesting_the-hackers_meetup_version1.0pptx
Thick client pentesting_the-hackers_meetup_version1.0pptx
 
Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
Practical Malware Analysis: Ch 2 Malware Analysis in Virtual Machines & 3: Ba...
 
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
 
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static TechniquesCNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
 
Thick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdfThick Client Penetration Testing.pdf
Thick Client Penetration Testing.pdf
 
PowerShell for Practical Purple Teaming
PowerShell for Practical Purple TeamingPowerShell for Practical Purple Teaming
PowerShell for Practical Purple Teaming
 
DeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows KernelDeathNote of Microsoft Windows Kernel
DeathNote of Microsoft Windows Kernel
 
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
 
Physical Penetration Testing (RootedCON 2015)
Physical Penetration Testing (RootedCON 2015)Physical Penetration Testing (RootedCON 2015)
Physical Penetration Testing (RootedCON 2015)
 

Viewers also liked

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
 
Reverse Engineering.pptx
Reverse Engineering.pptxReverse Engineering.pptx
Reverse Engineering.pptx
Sameer Sapra
 
Final Project Report Nadar
Final Project Report NadarFinal Project Report Nadar
Final Project Report Nadar
Maher Nadar
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic Software
Takahiro Haruyama
 

Viewers also liked (20)

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
 
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
 
Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident Response
 
Return Address – The Silver Bullet
Return Address – The Silver BulletReturn Address – The Silver Bullet
Return Address – The Silver Bullet
 
[2007 CodeEngn Conference 01] 이강석 - Malware Analysis Start
[2007 CodeEngn Conference 01] 이강석 - Malware Analysis Start[2007 CodeEngn Conference 01] 이강석 - Malware Analysis Start
[2007 CodeEngn Conference 01] 이강석 - Malware Analysis Start
 
Basic malware analysis
Basic malware analysisBasic malware analysis
Basic malware analysis
 
A walk through Windows firewall and Netsh commands
A walk through Windows firewall and Netsh commandsA walk through Windows firewall and Netsh commands
A walk through Windows firewall and Netsh commands
 
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
 
Reverse Engineering.pptx
Reverse Engineering.pptxReverse Engineering.pptx
Reverse Engineering.pptx
 
FDTK - O Ubuntu para Perícia Forense Digital
FDTK - O Ubuntu para Perícia Forense DigitalFDTK - O Ubuntu para Perícia Forense Digital
FDTK - O Ubuntu para Perícia Forense Digital
 
Code Injection in Windows
Code Injection in WindowsCode Injection in Windows
Code Injection in Windows
 
Malware protection system
Malware protection systemMalware protection system
Malware protection system
 
Final Project Report Nadar
Final Project Report NadarFinal Project Report Nadar
Final Project Report Nadar
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic Software
 
about Tcpreplay
about Tcpreplayabout Tcpreplay
about Tcpreplay
 
Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1
 
Return address
Return addressReturn address
Return address
 
List of Malwares
List of MalwaresList of Malwares
List of Malwares
 
about tcpreplay-edit
about tcpreplay-editabout tcpreplay-edit
about tcpreplay-edit
 

Similar to Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files

Concepts of Malicious Windows Programs
Concepts of Malicious Windows ProgramsConcepts of Malicious Windows Programs
Concepts of Malicious Windows Programs
Natraj G
 
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
EPAM Systems
 

Similar to Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files (20)

Introduction to Malware Analysis
Introduction to Malware AnalysisIntroduction to Malware Analysis
Introduction to Malware Analysis
 
Concepts of Malicious Windows Programs
Concepts of Malicious Windows ProgramsConcepts of Malicious Windows Programs
Concepts of Malicious Windows Programs
 
Malware Analysis Using Free Software
Malware Analysis Using Free SoftwareMalware Analysis Using Free Software
Malware Analysis Using Free Software
 
Useful Shareware for Technical Communicators - STC New England Interchange co...
Useful Shareware for Technical Communicators - STC New England Interchange co...Useful Shareware for Technical Communicators - STC New England Interchange co...
Useful Shareware for Technical Communicators - STC New England Interchange co...
 
Super Easy Memory Forensics
Super Easy Memory ForensicsSuper Easy Memory Forensics
Super Easy Memory Forensics
 
CHAPTER 2 BASIC ANALYSIS.pdf
CHAPTER 2 BASIC ANALYSIS.pdfCHAPTER 2 BASIC ANALYSIS.pdf
CHAPTER 2 BASIC ANALYSIS.pdf
 
Threats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxThreats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in Linux
 
Anti-virus Mechanisms and Various Ways to Bypass Antivirus detection
Anti-virus Mechanisms and Various Ways to Bypass Antivirus detectionAnti-virus Mechanisms and Various Ways to Bypass Antivirus detection
Anti-virus Mechanisms and Various Ways to Bypass Antivirus detection
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Project in malware analysis:C2C
Project in malware analysis:C2CProject in malware analysis:C2C
Project in malware analysis:C2C
 
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
 
"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...
 
File000173
File000173File000173
File000173
 
Spsl unit1
Spsl   unit1Spsl   unit1
Spsl unit1
 
2nd unit part 1
2nd unit  part 12nd unit  part 1
2nd unit part 1
 
Encase Forensic
Encase ForensicEncase Forensic
Encase Forensic
 
Poking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And ProfitPoking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And Profit
 
Ceh v5 module 18 linux hacking
Ceh v5 module 18 linux hackingCeh v5 module 18 linux hacking
Ceh v5 module 18 linux hacking
 
Fuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 JuneFuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 June
 
DEF CON 23 - Ryan o'neil - advances in linux forensics with ecfs
DEF CON 23 - Ryan o'neil - advances in linux forensics with ecfsDEF CON 23 - Ryan o'neil - advances in linux forensics with ecfs
DEF CON 23 - Ryan o'neil - advances in linux forensics with ecfs
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 

Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files

  • 1. REMnux Tutorial-1: Statically Examine Portable Executables(PE) Files Rhydham Joshi M.S. in Software Engineering, San Jose State University Phone : (+1) 408-987-1991 | Email : rhydham.joshi@yahoo.com Blog : malwareforensics1.blogspot.com | Linkedin : www.linkedin.com/in/rhydhamjoshi
  • 2. Contents: • REMnux: • Introduction to REMnux • Entropy: • Use of Entropy for malware detection • Un-packing: • UPX • ByteHist • Density Scout • Anomaly Detection: • PEScanner • EXEScan • PEFrame • PEV • Investigation: • Pyew • Bokken • Disassemblers vs Debuggers vs Decompilers: • Commonly used tools • References
  • 3. REMnux: A Linux Toolkit for Reverse-Engineering and Analyzing Malware • REMnux is a free, lightweight Linux (Ubuntu distribution) toolkit for reverse-engineering malicious software. • REMnux provides the collection of some of the most common and effective tools used for reverse engineering malwares in categories like: 1) Investigate Linux malwares 2) Statically analyze windows executable file 3) Examine File properties and contents 4) Multiple sample processing 5) Memory Snapshot Examination 6) Extract and decode artifacts 7) Examine Documents 8) Browser Malware Examination 9) Network utilities • For more information about REMnux, navigate to my blog at: http://malwareforensics1.blogspot.com/2015/04/the-power-of-remnux-linux-toolkit-for.html
  • 4. Entropy • Entropy is a measure of the unpredictability of an information stream. A perfectly consistent stream of bits (all zeroes, or all ones) is totally predictable (has no entropy). A stream of completely unpredictable bits has maximum entropy. • Range of entropy for 8 byte value : 0 (No entropy) -> 8(Maximum entropy) • better is the encryption or packing, Higher will be the entropy level. Use of Entropy in detecting malware: • Entropy can be used is many different way, but quite commonly to detect encryption and compression, since truly random data is not common in typical user data. • Encrypted or packed data prevents an AV engine from seeing "inside" the executables and so the level of entropy will be high which may trigger an signal to malware investigator about it. • It is also very helpful in identifying files that have a high-amount of randomness which could indicate an encrypted container/volume that may go otherwise unnoticed.
  • 5. Unpacking -> UPX • UPX is distributed with full source code under the GNU General Public License v2+ for packing/unpacking executables. • UPX provides excellent compression ratio and very fast decompression. • It provides in-place decompression so the executable suffers from no memory overhead. • It is safe, universal and portable and supports various executable formats. • It command line utility available for win32/linux and it is used to pack the malware executables.
  • 6. • A tool for generating byte-usage-histograms for all types of files with a special focus on binary executables in PE-format (Windows). Features: • Makes byte-usage-histograms of any file of any size • Histograms are generated as sorted and unsorted diagrams • Sub-histograms for each section of binary executables (PE) • Quick overview with GUI navigation in case of sub-histograms • Percentage for the share in the total filesize for sub-histograms “The byte-distribution of unencrypted and unpacked clear text, database-files and executable binaries differs massively as compared to the encrypted and/or packed ones. By putting this "phenomenon" into a picture this difference can be easily visualized by histograms.” Unpacking -> ByteHist
  • 7. Unpacking -> ByteHist • The tall green bar on the most left side tells represents pixel-column for 0h byte-code and the most right side represents FFh byte-code. • Red section arranges the pixel-columns in descending order. • Section-wise distribution tells us about which section we need to analyze. This feature gives a reverser the possibility to instantly find out the section that's containing (if so) packed/encrypted data.
  • 8. Unpacking -> Density Scout • Density Scout is a tool that has been written for one purpose: finding (eventually unknown) malware on a potentially infected system. • Therefore it takes advantage of the typical approach of malware authors to protect their "products" with obfuscation like run-time-packing and - encryption. • It is based on the concept of Bytehist. • Density Scout's main focus is to scan a desired file-system-path by calculating the density of each file to finally print out a descending list. • Usually Microsoft Windows executables are not packed or encrypted in any way which throws the hits of malicious executables to the top of the list where you can easily focus on.
  • 9. Unpacking -> Density Scout Max Entropy for C:WindowsSystem32 folder in my system is 1.84094
  • 10. Anomaly detection -> PEScanner pescanner.py is a PE analyzer written in python. The script has the ability to detect: • Files with TLS entries • Files with resource directories • Suspicious IAT entries • Suspicious entry point sections • Sections with zero-length raw sizes • Sections with extremely low or high entropy • Invalid timestamps • File version information Among other things, this script is helpful to: • understand the behavior of an executable • classify malwares (UPX packed, trojan downloader, trojan dropper, ...)
  • 11. Anomaly detection -> PEScanner
  • 12. Anomaly Detection -> ExeScan • ExeScan is the FREE command-line tool to detect anomalies in PE (Portable Executable or EXE/DLL) files. • It instantly scans EXE/DLL file and reports all kind of abnormalities in the PE header fields such as checksum differences, header field sizes, non-ascii/empty section names, improper size of raw data etc. • Typically Malwares use packers/protectors to pack their EXE. • These packers modify PE header fields in EXE file to make reverse engineering of these malwares difficult. • E.g. : These anomalies in PE header can crash debugger thus preventing any attempt to reversing. Exe-scan becomes handy in such situations. • Features of EXE-Scan : * Instantly detect all kind of abnormalities in EXE/PE file. * Detect the type of Compiler/Packer used in the PE file. * Scan for commonly used malware APIs * Great for automation * Displays PE header and Import table structures * Generate detailed analysis report
  • 14. Anomaly Detection -> PEFrame • Dowload PEFrame in linux using following command: pip install https://github.com/guelfoweb/peframe/archive/master.zip • It lists different sections for anomaly detection like : • MD5 Hash Value, • XOR Discovered • Digital Signature • Packers • Anti Debug code • Anti VM tricks • Suspicious API • Suspicious Sections • Files, URL and Metadata names • Imports/exports of file • Strings • Dump
  • 16. Anomaly Detection -> Pev tool • Pev is a multiplatform toolkit to work with PE binaries. • Its main goal is to provide feature-rich tools for proper analyze binaries, specially the suspicious ones. Features: • Based on own PE library, called libpe • Support for PE32 and PE32+ (64-bit) files • Formatted output in text and CSV (other formats in development) Tools: • pesec: check security features in PE files, extract certificates and more • readpe: parse PE headers, sections, imports and exports • pescan: detect TLS callback functions, DOS stub modification, suspicious sections and more • pedis: disassembly a PE file section or function with support for Intel and AT&T syntax • pehash: calculate PE file hashes • pepack: detect if an executable is packed or not • pestr: search for hardcoded Unicode and ASCII strings simultaneously in PE files • peres: show and extract PE file resources
  • 21. Disassembler vs Debugger vs Decompiler Reversing tools for Windows (some may work on other platforms): • Jclasslib (bytecode viewer) • FrontEnd Plus (java bytecode decompiler) • Jad (java bytecode decompiler) • Fernflower (java bytecode decompiler) • OllyDbg (machine code debugger-disassembler) • IdaPro (machine code debugger-disassembler) • PEBrowse (machine code debugger-disassembler) • Boomerang (machine code decompiler)
  • 22. References: • Entropy for files: http://www.forensickb.com/2013/03/file-entropy- explained.html • UPX: http://upx.sourceforge.net/ • Bitehist: https://www.cert.at/downloads/software/bytehist_en.html • DensityScout : http://digital-forensics.sans.org/blog/2012/04/26/finding- unknown-malware-with-densityscout • PEScanner : http://sourceforge.net/projects/pescanner/ • EXE-Scan : http://securityxploded.com/exe-scan.php • PEFrame : http://www.tekdefense.com/news/2013/3/17/tektip-ep25-static- malware-analysis-with-peframe.html • PEV : http://pev.sourceforge.net/ • PYEW : https://github.com/joxeankoret/pyew • Bokken : https://inguma.eu/projects/bokken/wiki/Installation