Exploring the Portable Executable format

Ange Albertini
Ange AlbertiniReverse engineer - author of Corkami.com
Exploring
the Portable Executable
format
London, England
Ange Albertini 2013/09/13
Workshop package
(PoCs+docs)
http://www.xchg.info/corkami/workshop.zip
Recommended PE viewer:
http://icerbero.com/peinsider
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
a handmade PE
simple.exe
a first real example
working minimal
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
detailed
walkthrough
Exploring the Portable Executable format
DOS header
unused in PE mode
Exploring the Portable Executable format
PE header
PE signature
Exploring the Portable Executable format
Optional Header
NOT optional in executables
Exploring the Portable Executable format
DataDirectories
end of OptionalHeader
16 (max) * [RVA, Size]
each entry interpreted differently
Exploring the Portable Executable format
Sections
memory mapping
Exploring the Portable Executable format
Exploring the Portable Executable format
Imports
standard loader mechanism
NOT required
load DLL, locate APIs
Exploring the Portable Executable format
compiled PE
compiled.exe
closer to reality
extra non-critical structure
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
DLL
exports
relocations
Exploring the Portable Executable format
Exploring the Portable Executable format
driver
subsystem, checksum
low alignments mapping
different imports
Exploring the Portable Executable format
resources
structure
version, manifest/icon, APIs
Exploring the Portable Executable format
Exploring the Portable Executable format
Thread Local Storage
callback list
before EntryPoint & after ExitProcess
Exploring the Portable Executable format
.Net
different and integrated binary
2nd loader
Exploring the Portable Executable format
what about 64b?
very few changes
● 2 magic constants
● a few elements become QWord
○ ImageBase, Imports thunks, callbacks
● Exceptions have their own DataDirectory
○ no need for LoadConfig (SafeSEH)
and ARM
● a different magic constant
● still 16b DOS Stub !
● nothing special, PE wise
○ the beauty of ‘Portability’
trivial
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
Exploring the Portable Executable format
1 of 58

Recommended

Defending against Java Deserialization Vulnerabilities by
 Defending against Java Deserialization Vulnerabilities Defending against Java Deserialization Vulnerabilities
Defending against Java Deserialization VulnerabilitiesLuca Carettoni
18.4K views36 slides
OWASP AppSecCali 2015 - Marshalling Pickles by
OWASP AppSecCali 2015 - Marshalling PicklesOWASP AppSecCali 2015 - Marshalling Pickles
OWASP AppSecCali 2015 - Marshalling PicklesChristopher Frohoff
132.8K views84 slides
HTTP HOST header attacks by
HTTP HOST header attacksHTTP HOST header attacks
HTTP HOST header attacksDefconRussia
19.2K views29 slides
Derbycon - The Unintended Risks of Trusting Active Directory by
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryWill Schroeder
35.9K views51 slides
Bypass file upload restrictions by
Bypass file upload restrictionsBypass file upload restrictions
Bypass file upload restrictionsMukesh k.r
31.8K views14 slides
Hunting for Privilege Escalation in Windows Environment by
Hunting for Privilege Escalation in Windows EnvironmentHunting for Privilege Escalation in Windows Environment
Hunting for Privilege Escalation in Windows EnvironmentTeymur Kheirkhabarov
12K views99 slides

More Related Content

What's hot

Super Easy Memory Forensics by
Super Easy Memory ForensicsSuper Easy Memory Forensics
Super Easy Memory ForensicsIIJ
4.6K views151 slides
Understanding Windows Access Token Manipulation by
Understanding Windows Access Token ManipulationUnderstanding Windows Access Token Manipulation
Understanding Windows Access Token ManipulationJustin Bui
2.6K views63 slides
DNS exfiltration using sqlmap by
DNS exfiltration using sqlmapDNS exfiltration using sqlmap
DNS exfiltration using sqlmapMiroslav Stampar
34K views26 slides
Offzone | Another waf bypass by
Offzone | Another waf bypassOffzone | Another waf bypass
Offzone | Another waf bypassДмитрий Бумов
792 views39 slides
Java Deserialization Vulnerabilities - The Forgotten Bug Class by
Java Deserialization Vulnerabilities - The Forgotten Bug ClassJava Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug ClassCODE WHITE GmbH
18.2K views62 slides
Linux Kernel - Virtual File System by
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File SystemAdrian Huang
521 views33 slides

What's hot(20)

Super Easy Memory Forensics by IIJ
Super Easy Memory ForensicsSuper Easy Memory Forensics
Super Easy Memory Forensics
IIJ4.6K views
Understanding Windows Access Token Manipulation by Justin Bui
Understanding Windows Access Token ManipulationUnderstanding Windows Access Token Manipulation
Understanding Windows Access Token Manipulation
Justin Bui2.6K views
Java Deserialization Vulnerabilities - The Forgotten Bug Class by CODE WHITE GmbH
Java Deserialization Vulnerabilities - The Forgotten Bug ClassJava Deserialization Vulnerabilities - The Forgotten Bug Class
Java Deserialization Vulnerabilities - The Forgotten Bug Class
CODE WHITE GmbH18.2K views
Linux Kernel - Virtual File System by Adrian Huang
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
Adrian Huang521 views
Understanding a kernel oops and a kernel panic by Joseph Lu
Understanding a kernel oops and a kernel panicUnderstanding a kernel oops and a kernel panic
Understanding a kernel oops and a kernel panic
Joseph Lu2.4K views
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh... by CODE BLUE
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
PowerShell Inside Out: Applied .NET Hacking for Enhanced Visibility by Satosh...
CODE BLUE3.7K views
Intro to Pentesting Jenkins by Brian Hysell
Intro to Pentesting JenkinsIntro to Pentesting Jenkins
Intro to Pentesting Jenkins
Brian Hysell705 views
Windows Privilege Escalation by Riyaz Walikar
Windows Privilege EscalationWindows Privilege Escalation
Windows Privilege Escalation
Riyaz Walikar15.2K views
Directory Traversal & File Inclusion Attacks by Raghav Bisht
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion Attacks
Raghav Bisht1.2K views
Surviving the Java Deserialization Apocalypse // OWASP AppSecEU 2016 by Christian Schneider
Surviving the Java Deserialization Apocalypse // OWASP AppSecEU 2016Surviving the Java Deserialization Apocalypse // OWASP AppSecEU 2016
Surviving the Java Deserialization Apocalypse // OWASP AppSecEU 2016
Christian Schneider7.7K views
Fun with Network Interfaces by Kernel TLV
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
Kernel TLV5K views
Cryptography 101 for Java Developers - JavaZone2019 by Michel Schudel
Cryptography 101 for Java Developers - JavaZone2019Cryptography 101 for Java Developers - JavaZone2019
Cryptography 101 for Java Developers - JavaZone2019
Michel Schudel624 views
SeaweedFS introduction by chrislusf
SeaweedFS introductionSeaweedFS introduction
SeaweedFS introduction
chrislusf6.1K views
Red Team Methodology - A Naked Look by Jason Lang
Red Team Methodology - A Naked LookRed Team Methodology - A Naked Look
Red Team Methodology - A Naked Look
Jason Lang14.7K views
Building data flows with Celery and SQLAlchemy by Roger Barnes
Building data flows with Celery and SQLAlchemyBuilding data flows with Celery and SQLAlchemy
Building data flows with Celery and SQLAlchemy
Roger Barnes9K views

Viewers also liked

the PE format 2011/01/17 by
the PE format 2011/01/17the PE format 2011/01/17
the PE format 2011/01/17Ange Albertini
5K views6 slides
Protection by
ProtectionProtection
ProtectionSanjay Sharma
1.5K views29 slides
PE102 - a Windows executable format overview (booklet V1) by
PE102 - a Windows executable format overview (booklet V1)PE102 - a Windows executable format overview (booklet V1)
PE102 - a Windows executable format overview (booklet V1)Ange Albertini
2K views5 slides
Pe Format by
Pe FormatPe Format
Pe FormatHexxx
1.8K views14 slides
PE Packers Used in Malicious Software - Part 1 by
PE Packers Used in Malicious Software - Part 1PE Packers Used in Malicious Software - Part 1
PE Packers Used in Malicious Software - Part 1amiable_indian
5.6K views39 slides
PE Trojan Detection Based on the Assessment of Static File Features by
PE Trojan Detection Based on the Assessment of Static File FeaturesPE Trojan Detection Based on the Assessment of Static File Features
PE Trojan Detection Based on the Assessment of Static File FeaturesAntiy Labs
566 views17 slides

Viewers also liked(17)

PE102 - a Windows executable format overview (booklet V1) by Ange Albertini
PE102 - a Windows executable format overview (booklet V1)PE102 - a Windows executable format overview (booklet V1)
PE102 - a Windows executable format overview (booklet V1)
Ange Albertini2K views
Pe Format by Hexxx
Pe FormatPe Format
Pe Format
Hexxx1.8K views
PE Packers Used in Malicious Software - Part 1 by amiable_indian
PE Packers Used in Malicious Software - Part 1PE Packers Used in Malicious Software - Part 1
PE Packers Used in Malicious Software - Part 1
amiable_indian5.6K views
PE Trojan Detection Based on the Assessment of Static File Features by Antiy Labs
PE Trojan Detection Based on the Assessment of Static File FeaturesPE Trojan Detection Based on the Assessment of Static File Features
PE Trojan Detection Based on the Assessment of Static File Features
Antiy Labs566 views
PE File Format and Packer - Inc0gnito 2016 by Hajin Jang
PE File Format and Packer - Inc0gnito 2016PE File Format and Packer - Inc0gnito 2016
PE File Format and Packer - Inc0gnito 2016
Hajin Jang2K views
TASBot - the perfectionist by Ange Albertini
TASBot - the perfectionistTASBot - the perfectionist
TASBot - the perfectionist
Ange Albertini2.1K views
Trusting files (and their formats) by Ange Albertini
Trusting files (and their formats)Trusting files (and their formats)
Trusting files (and their formats)
Ange Albertini524 views
Preserving arcade games - 31c3 by Ange Albertini
Preserving arcade games -  31c3Preserving arcade games -  31c3
Preserving arcade games - 31c3
Ange Albertini1.7K views
Funky file formats - 31c3 by Ange Albertini
Funky file formats - 31c3Funky file formats - 31c3
Funky file formats - 31c3
Ange Albertini2.2K views

Similar to Exploring the Portable Executable format

Whirlwind tour of the Runtime Dynamic Linker by
Whirlwind tour of the Runtime Dynamic LinkerWhirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic LinkerGonçalo Gomes
232 views24 slides
Logging & Metrics with Docker by
Logging & Metrics with DockerLogging & Metrics with Docker
Logging & Metrics with DockerStefan Zier
2.3K views35 slides
IOC + Javascript by
IOC + JavascriptIOC + Javascript
IOC + JavascriptBrian Cavalier
5.5K views120 slides
Implementing a build manager in Ada by
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in AdaStephane Carrez
142 views22 slides
2019 11-bgphp by
2019 11-bgphp2019 11-bgphp
2019 11-bgphpdantleech
440 views67 slides
Log forwarding at Scale by
Log forwarding at ScaleLog forwarding at Scale
Log forwarding at ScaleEduardo Silva Pereira
1K views44 slides

Similar to Exploring the Portable Executable format(20)

Whirlwind tour of the Runtime Dynamic Linker by Gonçalo Gomes
Whirlwind tour of the Runtime Dynamic LinkerWhirlwind tour of the Runtime Dynamic Linker
Whirlwind tour of the Runtime Dynamic Linker
Gonçalo Gomes232 views
Logging & Metrics with Docker by Stefan Zier
Logging & Metrics with DockerLogging & Metrics with Docker
Logging & Metrics with Docker
Stefan Zier2.3K views
Implementing a build manager in Ada by Stephane Carrez
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
Stephane Carrez142 views
2019 11-bgphp by dantleech
2019 11-bgphp2019 11-bgphp
2019 11-bgphp
dantleech440 views
01 linux-quick-start by Nguyen Vinh
01 linux-quick-start01 linux-quick-start
01 linux-quick-start
Nguyen Vinh814 views
(phpconftw2012) PHP as a Middleware in Embedded Systems by sosorry
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
sosorry1.9K views
Mender.io | Develop embedded applications faster | Comparing C and Golang by Mender.io
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io677 views
Extending JBoss EPP and Site Publisher your way by rafaelliu
Extending JBoss EPP and Site Publisher your wayExtending JBoss EPP and Site Publisher your way
Extending JBoss EPP and Site Publisher your way
rafaelliu740 views
Introduction to Performance APIs by Shogo Sensui
Introduction to Performance APIsIntroduction to Performance APIs
Introduction to Performance APIs
Shogo Sensui566 views
From gcc to the autotools by Thierry Gayet
From gcc to the autotoolsFrom gcc to the autotools
From gcc to the autotools
Thierry Gayet604 views
Fix: static code analysis into our project by noelchris3
Fix: static code analysis into our project Fix: static code analysis into our project
Fix: static code analysis into our project
noelchris31K views
Creating user-mode debuggers for Windows by Mithun Shanbhag
Creating user-mode debuggers for WindowsCreating user-mode debuggers for Windows
Creating user-mode debuggers for Windows
Mithun Shanbhag417 views
Binary art - Byte-ing the PE that fails you (extended offline version) by Ange Albertini
Binary art - Byte-ing the PE that fails you (extended offline version)Binary art - Byte-ing the PE that fails you (extended offline version)
Binary art - Byte-ing the PE that fails you (extended offline version)
Ange Albertini23.8K views
Improving build solutions dependency management with webpack by NodeXperts
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
NodeXperts248 views
Gutenberg Extended by Sören Wrede
Gutenberg ExtendedGutenberg Extended
Gutenberg Extended
Sören Wrede1.8K views

More from Ange Albertini

Technical challenges with file formats by
Technical challenges with file formatsTechnical challenges with file formats
Technical challenges with file formatsAnge Albertini
43 views54 slides
Relations between archive formats by
Relations between archive formatsRelations between archive formats
Relations between archive formatsAnge Albertini
15 views37 slides
Abusing archive file formats by
Abusing archive file formatsAbusing archive file formats
Abusing archive file formatsAnge Albertini
29 views95 slides
TimeCryption by
TimeCryptionTimeCryption
TimeCryptionAnge Albertini
97 views98 slides
You are *not* an idiot by
You are *not* an idiotYou are *not* an idiot
You are *not* an idiotAnge Albertini
77 views50 slides
Improving file formats by
Improving file formatsImproving file formats
Improving file formatsAnge Albertini
351 views78 slides

More from Ange Albertini(20)

Technical challenges with file formats by Ange Albertini
Technical challenges with file formatsTechnical challenges with file formats
Technical challenges with file formats
Ange Albertini43 views
Relations between archive formats by Ange Albertini
Relations between archive formatsRelations between archive formats
Relations between archive formats
Ange Albertini15 views
An introduction to inkscape by Ange Albertini
An introduction to inkscapeAn introduction to inkscape
An introduction to inkscape
Ange Albertini1.3K views
The challenges of file formats by Ange Albertini
The challenges of file formatsThe challenges of file formats
The challenges of file formats
Ange Albertini288 views
An overview of potential leaks via PDF by Ange Albertini
An overview of potential leaks via PDFAn overview of potential leaks via PDF
An overview of potential leaks via PDF
Ange Albertini904 views
Hide Android applications in images by Ange Albertini
Hide Android applications in imagesHide Android applications in images
Hide Android applications in images
Ange Albertini6.3K views
Let's play with crypto! v2 by Ange Albertini
Let's play with crypto! v2Let's play with crypto! v2
Let's play with crypto! v2
Ange Albertini1.1K views

Recently uploaded

December 2023 - Meat on the Bones by
December 2023 - Meat on the BonesDecember 2023 - Meat on the Bones
December 2023 - Meat on the BonesNZSG
28 views11 slides
The Truth About Customer Journey Mapping by
The Truth About Customer Journey MappingThe Truth About Customer Journey Mapping
The Truth About Customer Journey MappingAggregage
117 views39 slides
Basic of Air Ticketing & IATA Geography by
Basic of Air Ticketing & IATA GeographyBasic of Air Ticketing & IATA Geography
Basic of Air Ticketing & IATA GeographyMd Shaifullar Rabbi
69 views27 slides
Accounts Class 12 project cash flow statement and ratio analysis by
Accounts Class 12 project cash flow statement and ratio analysisAccounts Class 12 project cash flow statement and ratio analysis
Accounts Class 12 project cash flow statement and ratio analysisJinendraPamecha
50 views42 slides
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck by
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deckPitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deckHajeJanKamps
663 views18 slides
HSI CareFree Service Plan 2023 (2).pdf by
HSI CareFree Service Plan 2023 (2).pdfHSI CareFree Service Plan 2023 (2).pdf
HSI CareFree Service Plan 2023 (2).pdfHomeSmart Installations
43 views1 slide

Recently uploaded(20)

December 2023 - Meat on the Bones by NZSG
December 2023 - Meat on the BonesDecember 2023 - Meat on the Bones
December 2023 - Meat on the Bones
NZSG28 views
The Truth About Customer Journey Mapping by Aggregage
The Truth About Customer Journey MappingThe Truth About Customer Journey Mapping
The Truth About Customer Journey Mapping
Aggregage117 views
Accounts Class 12 project cash flow statement and ratio analysis by JinendraPamecha
Accounts Class 12 project cash flow statement and ratio analysisAccounts Class 12 project cash flow statement and ratio analysis
Accounts Class 12 project cash flow statement and ratio analysis
JinendraPamecha50 views
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck by HajeJanKamps
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deckPitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck
HajeJanKamps663 views
2023 Photo Contest.pptx by culhama
2023 Photo Contest.pptx2023 Photo Contest.pptx
2023 Photo Contest.pptx
culhama35 views
Imports Next Level.pdf by Bloomerang
Imports Next Level.pdfImports Next Level.pdf
Imports Next Level.pdf
Bloomerang150 views
Top 10 IT Tasks Small Businesses Can Entrust to Offshore Professionals by altafhsayyednimetler
Top 10 IT Tasks Small Businesses Can Entrust to Offshore ProfessionalsTop 10 IT Tasks Small Businesses Can Entrust to Offshore Professionals
Top 10 IT Tasks Small Businesses Can Entrust to Offshore Professionals
Why are KPIs(key performance indicators) important? by Epixel MLM Software
Why are KPIs(key performance indicators) important? Why are KPIs(key performance indicators) important?
Why are KPIs(key performance indicators) important?
Navigating EUDR Compliance within the Coffee Industry by Peter Horsten
Navigating EUDR Compliance within the Coffee IndustryNavigating EUDR Compliance within the Coffee Industry
Navigating EUDR Compliance within the Coffee Industry
Peter Horsten46 views
Top 10 Web Development Companies in California by TopCSSGallery
Top 10 Web Development Companies in CaliforniaTop 10 Web Development Companies in California
Top 10 Web Development Companies in California
TopCSSGallery76 views
Monthly Social Media Update November 2023 copy.pptx by Andy Lambert
Monthly Social Media Update November 2023 copy.pptxMonthly Social Media Update November 2023 copy.pptx
Monthly Social Media Update November 2023 copy.pptx
Andy Lambert33 views
PMU Launch - Guaranteed Slides by pmulaunch
PMU Launch - Guaranteed SlidesPMU Launch - Guaranteed Slides
PMU Launch - Guaranteed Slides
pmulaunch18 views

Exploring the Portable Executable format