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

Next Generation War: EDR vs RED TEAM
Next Generation War: EDR vs RED TEAMNext Generation War: EDR vs RED TEAM
Next Generation War: EDR vs RED TEAMBGA Cyber Security
 
Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging Sam Bowne
 
Computer Malware and its types
Computer Malware and its typesComputer Malware and its types
Computer Malware and its typesJatin Kumar
 
CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3Sam Bowne
 
The rise of malware(ransomware)
The rise of malware(ransomware)The rise of malware(ransomware)
The rise of malware(ransomware)phexcom1
 
Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Ahmed El-Arabawy
 
ELF(executable and linkable format)
ELF(executable and linkable format)ELF(executable and linkable format)
ELF(executable and linkable format)Seungha Son
 
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 AnalysisSam Bowne
 
Basic Malware Analysis
Basic Malware AnalysisBasic Malware Analysis
Basic Malware AnalysisAlbert Hui
 
랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나
랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나
랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나Amazon Web Services Korea
 
Black Hat 2015 Arsenal: Noriben Malware Analysis
Black Hat 2015 Arsenal: Noriben Malware AnalysisBlack Hat 2015 Arsenal: Noriben Malware Analysis
Black Hat 2015 Arsenal: Noriben Malware AnalysisBrian Baskin
 
Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking AuthenticationSam Bowne
 
Basic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareBasic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareNatraj G
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Sam Bowne
 

What's hot (20)

Next Generation War: EDR vs RED TEAM
Next Generation War: EDR vs RED TEAMNext Generation War: EDR vs RED TEAM
Next Generation War: EDR vs RED TEAM
 
Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging Practical Malware Analysis: Ch 8: Debugging
Practical Malware Analysis: Ch 8: Debugging
 
Find and locate
Find and locateFind and locate
Find and locate
 
Computer Malware and its types
Computer Malware and its typesComputer Malware and its types
Computer Malware and its types
 
CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3CNIT 126: Ch 2 & 3
CNIT 126: Ch 2 & 3
 
The rise of malware(ransomware)
The rise of malware(ransomware)The rise of malware(ransomware)
The rise of malware(ransomware)
 
Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files
 
ELF(executable and linkable format)
ELF(executable and linkable format)ELF(executable and linkable format)
ELF(executable and linkable format)
 
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
 
Basic Malware Analysis
Basic Malware AnalysisBasic Malware Analysis
Basic Malware Analysis
 
Piracy and Types
Piracy and TypesPiracy and Types
Piracy and Types
 
랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나
랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나
랜섬웨어(Ransomware)와 AWS 클라우드 보안 - 신용녀 (AWS 솔루션즈아키텍트) :: 특별 보안 웨비나
 
How fun of privilege escalation Red Pill2017
How fun of privilege escalation  Red Pill2017How fun of privilege escalation  Red Pill2017
How fun of privilege escalation Red Pill2017
 
Threat Modelling
Threat ModellingThreat Modelling
Threat Modelling
 
Black Hat 2015 Arsenal: Noriben Malware Analysis
Black Hat 2015 Arsenal: Noriben Malware AnalysisBlack Hat 2015 Arsenal: Noriben Malware Analysis
Black Hat 2015 Arsenal: Noriben Malware Analysis
 
ZFS
ZFSZFS
ZFS
 
Ch 6: Attacking Authentication
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking Authentication
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Basic Dynamic Analysis of Malware
Basic Dynamic Analysis of MalwareBasic Dynamic Analysis of Malware
Basic Dynamic Analysis of Malware
 
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
 

Viewers also liked

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 & AnomaliesRhydham Joshi
 
Malware Analysis and Defeating using Virtual Machines
Malware Analysis and Defeating using Virtual MachinesMalware Analysis and Defeating using Virtual Machines
Malware Analysis and Defeating using Virtual Machinesintertelinvestigations
 
Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Rhydham Joshi
 
Volatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseVolatile IOCs for Fast Incident Response
Volatile IOCs for Fast Incident ResponseTakahiro Haruyama
 
Return Address – The Silver Bullet
Return Address – The Silver BulletReturn Address – The Silver Bullet
Return Address – The Silver Bulletsecurityxploded
 
[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 StartGangSeok Lee
 
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 commandsRhydham Joshi
 
Malware analysis - What to learn from your invaders
Malware analysis - What to learn from your invadersMalware analysis - What to learn from your invaders
Malware analysis - What to learn from your invadersTazdrumm3r
 
Reverse Engineering.pptx
Reverse Engineering.pptxReverse Engineering.pptx
Reverse Engineering.pptxSameer Sapra
 
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 DigitalJunior Abreu
 
Final Project Report Nadar
Final Project Report NadarFinal Project Report Nadar
Final Project Report NadarMaher Nadar
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareTakahiro Haruyama
 
Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Anomalies Detection: Windows OS - Part 1
Anomalies Detection: Windows OS - Part 1Rhydham Joshi
 
about tcpreplay-edit
about tcpreplay-editabout tcpreplay-edit
about tcpreplay-edit@ otsuka752
 

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

Malware Static Analysis
Malware Static AnalysisMalware Static Analysis
Malware Static AnalysisHossein Yavari
 
Introduction to Malware Analysis
Introduction to Malware AnalysisIntroduction to Malware Analysis
Introduction to Malware AnalysisAndrew McNicol
 
Concepts of Malicious Windows Programs
Concepts of Malicious Windows ProgramsConcepts of Malicious Windows Programs
Concepts of Malicious Windows ProgramsNatraj G
 
Malware Analysis Using Free Software
Malware Analysis Using Free SoftwareMalware Analysis Using Free Software
Malware Analysis Using Free SoftwareXavier Mertens
 
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...Ed Marshall
 
Super Easy Memory Forensics
Super Easy Memory ForensicsSuper Easy Memory Forensics
Super Easy Memory ForensicsIIJ
 
CHAPTER 2 BASIC ANALYSIS.pdf
CHAPTER 2 BASIC ANALYSIS.pdfCHAPTER 2 BASIC ANALYSIS.pdf
CHAPTER 2 BASIC ANALYSIS.pdfManjuAppukuttan2
 
Threats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxThreats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxAmitesh Bharti
 
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 detectionNeel Pathak
 
Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Project in malware analysis:C2C
Project in malware analysis:C2CProject in malware analysis:C2C
Project in malware analysis:C2CFabrizio Farinacci
 
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"
Вячеслав Кабак "Microsoft Sysinternals-Useful Utilities"EPAM Systems
 
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an..."Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...
"Automated Malware Analysis" de Gabriel Negreira Barbosa, Malware Research an...SegInfo
 
2nd unit part 1
2nd unit  part 12nd unit  part 1
2nd unit part 1Pavan Illa
 
Encase Forensic
Encase ForensicEncase Forensic
Encase ForensicMegha Sahu
 
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 Profitssusera432ea1
 
Fuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 JuneFuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 Junenullowaspmumbai
 

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

Malware Static Analysis
Malware Static AnalysisMalware Static Analysis
Malware Static Analysis
 
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
 

Recently uploaded

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 

Recently uploaded (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 

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