SlideShare a Scribd company logo
SELF INTRODUCTION
&
THE STORY THAT I TRIED TO MAKE
SAYONARA ROP CHAIN IN LINUX
2016/04/27
Lightning Talks
inaz2
ABOUT ME
• inaz2
• http://twitter.com/inaz2
• Security engineer & Python programmer
• AVTOKYO 2014 & 2015 speaker
• Weblog: Momoiro Technology
• http://inaz2.hatenablog.com/
• Written in Japanese but Google Translate will help us 
2
LOW LAYER AND ME
• Got in touch at Plaid CTF 2013 (year of ropasaurusrex)
• Tried to understand exploitation for 3 years
• “ROP Illmatic: Exploring Universal ROP on glibc x86-64”
(AVTOKYO 2014)
• Introduced Return-to-dl-resolve technique
• Introduced JIT-ROP techniques in Linux
• Wrote “roputils” library for writing stable exploit codes
• “Abusing Interrupts for Reliable Windows Kernel Exploitation”
(AVTOKYO 2015)
• Verified IDT overwrite techniques still work in 32 bit Windows
3
4
LOW LAYER AND ME
• Got in touch at Plaid CTF 2013 (year of ropasaurusrex)
• Tried to understand exploitation for 3 years
• “ROP Illmatic: Exploring Universal ROP on glibc x86-64”
(AVTOKYO 2014)
• Introduced Return-to-dl-resolve technique
• Introduced JIT-ROP techniques in Linux
• Wrote “roputils” library for writing stable exploit codes
• “Abusing Interrupts for Reliable Windows Kernel Exploitation”
(AVTOKYO 2015)
• Verified IDT overwrite techniques still work in 32 bit Windows
5
6
LOW LAYER AND ME
• Got in touch at Plaid CTF 2013 (year of ropasaurusrex)
• Tried to understand exploitation for 3 years
• “ROP Illmatic: Exploring Universal ROP on glibc x86-64”
(AVTOKYO 2014)
• Introduced Return-to-dl-resolve technique
• Introduced JIT-ROP techniques in Linux
• Wrote “roputils” library for writing stable exploit codes
• “Abusing Interrupts for Reliable Windows Kernel Exploitation”
(AVTOKYO 2015)
• Verified IDT overwrite techniques still work in 32 bit Windows
7
8
SAYONARA ROP CHAIN
• https://www.corelan.be/index.php/2011/07/03/universal-
depaslr-bypass-with-msvcr71-dll-and-mona-py/
• Universal ASLR & NX/DEP bypass in Windows x86
• Use gadgets in non-ASLR DLLs
• Metasploit also generates its variant by
generate_rop_payload()
9
10
TRYING TO MAKE LINUX
VERSION
• Return-to-dl-resolve technique works in x86 Linux (w/o PIE)
1. Send crafted symbol structure to fixed address (bss section etc.)
2. Call it by dl-resolve@plt with adjusted arguments
• We don’t have to do stack pivot
11
12
BUT IT WON’T WORKS ON X64
• On x64 Linux, code section and data section are not adjacent
• Code at 0x400000, data at 0x600000
• Symbol version check is enabled by default
• Fail to find VERSYM and raise SEGV
• We need to read the pointer link_map@got and overwrite
[link_map+0x1c8] to 0
13
14
RECAP
• I tried to make universal ROP chain for Linux
• For x86, succeeded by return-to-dl-resolve technique
• But for x64, we have to traverse link_map and patch
• Heavy task for ROP… Game Over \(^o^)/
15
REFERENCE
• Advanced return-into-lib(c) exploits (PaX case study) (Phrack 58)
• http://phrack.org/issues/58/4.html
• Return to Dynamic Linker (Codegate 2014 Junior)
• http://www.codegate.org/content/board/post_list.php?bid=48&q=Retu
rn+to+Dynamic+Linker
• How the ELF Ruined Christmas (USENIX Security 2015)
• https://www.usenix.org/conference/usenixsecurity15/technical-
sessions/presentation/di-frederico
16
THANK YOU!
@inaz2
17

More Related Content

PDF
Abusing Interrupts for Reliable Windows Kernel Exploitation (en)
PDF
Can We Prevent Use-after-free Attacks?
PDF
HTTPプロクシライブラリproxy2の設計と実装
PDF
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
PDF
Andrea Righi - Spying on the Linux kernel for fun and profit
PDF
MOVED: RDK/WPE Port on DB410C - SFO17-206
PDF
The Linux Block Layer - Built for Fast Storage
PDF
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Abusing Interrupts for Reliable Windows Kernel Exploitation (en)
Can We Prevent Use-after-free Attacks?
HTTPプロクシライブラリproxy2の設計と実装
CSW2017 Henry li how to find the vulnerability to bypass the control flow gua...
Andrea Righi - Spying on the Linux kernel for fun and profit
MOVED: RDK/WPE Port on DB410C - SFO17-206
The Linux Block Layer - Built for Fast Storage
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...

What's hot (20)

PDF
LMG Lightning Talks - SFO17-205
PDF
Использование KASan для автономного гипервизора
PDF
Статический анализ кода в контексте SSDL
PDF
Mirko Damiani - An Embedded soft real time distributed system in Go
PDF
Alessio Lama - Development and testing of a safety network protocol
PDF
Optimizing the Design and Implementation of KVM/ARM - SFO17-403
PDF
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
PDF
OpenWrt From Top to Bottom
PDF
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
PDF
Configuring Syslog by Octavio
PPTX
A Science Project: Swift Serial Chat
PDF
Using SoC Vendor HALs in the Zephyr Project - SFO17-112
PPTX
Burp Suite Extensions
PDF
Upstreaming 101 - SFO17-TR02
PDF
Deploy STM32 family on Zephyr - SFO17-102
PDF
Down by the Docker
PDF
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...
PDF
Kernel Recipes 2015: Greybus
PPTX
Injection on Steroids: Codeless code injection and 0-day techniques
PDF
BSD Sockets API in Zephyr RTOS - SFO17-108
LMG Lightning Talks - SFO17-205
Использование KASan для автономного гипервизора
Статический анализ кода в контексте SSDL
Mirko Damiani - An Embedded soft real time distributed system in Go
Alessio Lama - Development and testing of a safety network protocol
Optimizing the Design and Implementation of KVM/ARM - SFO17-403
Take a Jailbreak -Stunning Guards for iOS Jailbreak- by Kaoru Otsuka
OpenWrt From Top to Bottom
For the Greater Good: Leveraging VMware's RPC Interface for fun and profit by...
Configuring Syslog by Octavio
A Science Project: Swift Serial Chat
Using SoC Vendor HALs in the Zephyr Project - SFO17-112
Burp Suite Extensions
Upstreaming 101 - SFO17-TR02
Deploy STM32 family on Zephyr - SFO17-102
Down by the Docker
Luca Cipriani - Control your Embedded Linux remotely by using MQTT and a web ...
Kernel Recipes 2015: Greybus
Injection on Steroids: Codeless code injection and 0-day techniques
BSD Sockets API in Zephyr RTOS - SFO17-108
Ad

Viewers also liked (11)

PDF
Abusing Interrupts for Reliable Windows Kernel Exploitation (ja)
PDF
proxy2: HTTPS pins and needles
PDF
WinDbg Primer
PDF
Protecting Passwords
PDF
Why is Security Management So Hard?
PDF
Making a Proxy for Fun and Profit
PDF
How to apt-get from the internal network: remote sshd with kneesocks
PDF
Sniffing BitTorrent DHT ~人はBTで何を落とすのか~
PPT
バイオメトリクス認証Hacks(AVtokyo2008 After Party: KA – E – DA - MA(Biometrics Authenti...
PDF
アプリカティブファンクターとHaskell 2014版
PDF
ROP Illmatic: Exploring Universal ROP on glibc x86-64 (ja)
Abusing Interrupts for Reliable Windows Kernel Exploitation (ja)
proxy2: HTTPS pins and needles
WinDbg Primer
Protecting Passwords
Why is Security Management So Hard?
Making a Proxy for Fun and Profit
How to apt-get from the internal network: remote sshd with kneesocks
Sniffing BitTorrent DHT ~人はBTで何を落とすのか~
バイオメトリクス認証Hacks(AVtokyo2008 After Party: KA – E – DA - MA(Biometrics Authenti...
アプリカティブファンクターとHaskell 2014版
ROP Illmatic: Exploring Universal ROP on glibc x86-64 (ja)
Ad

Similar to Self Introduction & The Story that I Tried to Make Sayonara ROP Chain in Linux (20)

PPTX
Ice Age melting down: Intel features considered usefull!
PDF
RubyStack: the easiest way to deploy Ruby on Rails
PPTX
Advanced SOHO Router Exploitation XCON
PPTX
Metasploit & Windows Kernel Exploitation
PDF
ESIL - Universal IL (Intermediate Language) for Radare2
PPTX
Hot to build continuously processing for 24/7 real-time data streaming platform?
PDF
One Shellcode to Rule Them All: Cross-Platform Exploitation
PPTX
Pune-Cocoa: Blocks and GCD
PDF
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
PDF
Is That A Penguin In My Windows?
PDF
RISC V in Spacer
PDF
ITCamp 2017 - Raffaele Rialdi - A Deep Dive Into Bridging Node-js with .NET Core
PPTX
Practical Windows Kernel Exploitation
PDF
Introduction to multicore .ppt
PDF
Open Source Cyber Weaponry
PDF
LCU14 310- Cisco ODP v2
PDF
IPv6 Security
PDF
cadec-2017-golang
PDF
CNIT 127 14: Protection Mechanisms
PDF
seL4 on RISC-V/lowRISC - ORCONF'15
Ice Age melting down: Intel features considered usefull!
RubyStack: the easiest way to deploy Ruby on Rails
Advanced SOHO Router Exploitation XCON
Metasploit & Windows Kernel Exploitation
ESIL - Universal IL (Intermediate Language) for Radare2
Hot to build continuously processing for 24/7 real-time data streaming platform?
One Shellcode to Rule Them All: Cross-Platform Exploitation
Pune-Cocoa: Blocks and GCD
ITCamp 2017 - Raffaele Rialdi - Adopting .NET Core in Mainstream Projects
Is That A Penguin In My Windows?
RISC V in Spacer
ITCamp 2017 - Raffaele Rialdi - A Deep Dive Into Bridging Node-js with .NET Core
Practical Windows Kernel Exploitation
Introduction to multicore .ppt
Open Source Cyber Weaponry
LCU14 310- Cisco ODP v2
IPv6 Security
cadec-2017-golang
CNIT 127 14: Protection Mechanisms
seL4 on RISC-V/lowRISC - ORCONF'15

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
Teaching material agriculture food technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Empathic Computing: Creating Shared Understanding
PDF
cuic standard and advanced reporting.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Teaching material agriculture food technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
20250228 LYD VKU AI Blended-Learning.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
“AI and Expert System Decision Support & Business Intelligence Systems”
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Empathic Computing: Creating Shared Understanding
cuic standard and advanced reporting.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Network Security Unit 5.pdf for BCA BBA.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Unlocking AI with Model Context Protocol (MCP)
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Self Introduction & The Story that I Tried to Make Sayonara ROP Chain in Linux

  • 1. SELF INTRODUCTION & THE STORY THAT I TRIED TO MAKE SAYONARA ROP CHAIN IN LINUX 2016/04/27 Lightning Talks inaz2
  • 2. ABOUT ME • inaz2 • http://twitter.com/inaz2 • Security engineer & Python programmer • AVTOKYO 2014 & 2015 speaker • Weblog: Momoiro Technology • http://inaz2.hatenablog.com/ • Written in Japanese but Google Translate will help us  2
  • 3. LOW LAYER AND ME • Got in touch at Plaid CTF 2013 (year of ropasaurusrex) • Tried to understand exploitation for 3 years • “ROP Illmatic: Exploring Universal ROP on glibc x86-64” (AVTOKYO 2014) • Introduced Return-to-dl-resolve technique • Introduced JIT-ROP techniques in Linux • Wrote “roputils” library for writing stable exploit codes • “Abusing Interrupts for Reliable Windows Kernel Exploitation” (AVTOKYO 2015) • Verified IDT overwrite techniques still work in 32 bit Windows 3
  • 4. 4
  • 5. LOW LAYER AND ME • Got in touch at Plaid CTF 2013 (year of ropasaurusrex) • Tried to understand exploitation for 3 years • “ROP Illmatic: Exploring Universal ROP on glibc x86-64” (AVTOKYO 2014) • Introduced Return-to-dl-resolve technique • Introduced JIT-ROP techniques in Linux • Wrote “roputils” library for writing stable exploit codes • “Abusing Interrupts for Reliable Windows Kernel Exploitation” (AVTOKYO 2015) • Verified IDT overwrite techniques still work in 32 bit Windows 5
  • 6. 6
  • 7. LOW LAYER AND ME • Got in touch at Plaid CTF 2013 (year of ropasaurusrex) • Tried to understand exploitation for 3 years • “ROP Illmatic: Exploring Universal ROP on glibc x86-64” (AVTOKYO 2014) • Introduced Return-to-dl-resolve technique • Introduced JIT-ROP techniques in Linux • Wrote “roputils” library for writing stable exploit codes • “Abusing Interrupts for Reliable Windows Kernel Exploitation” (AVTOKYO 2015) • Verified IDT overwrite techniques still work in 32 bit Windows 7
  • 8. 8
  • 9. SAYONARA ROP CHAIN • https://www.corelan.be/index.php/2011/07/03/universal- depaslr-bypass-with-msvcr71-dll-and-mona-py/ • Universal ASLR & NX/DEP bypass in Windows x86 • Use gadgets in non-ASLR DLLs • Metasploit also generates its variant by generate_rop_payload() 9
  • 10. 10
  • 11. TRYING TO MAKE LINUX VERSION • Return-to-dl-resolve technique works in x86 Linux (w/o PIE) 1. Send crafted symbol structure to fixed address (bss section etc.) 2. Call it by dl-resolve@plt with adjusted arguments • We don’t have to do stack pivot 11
  • 12. 12
  • 13. BUT IT WON’T WORKS ON X64 • On x64 Linux, code section and data section are not adjacent • Code at 0x400000, data at 0x600000 • Symbol version check is enabled by default • Fail to find VERSYM and raise SEGV • We need to read the pointer link_map@got and overwrite [link_map+0x1c8] to 0 13
  • 14. 14
  • 15. RECAP • I tried to make universal ROP chain for Linux • For x86, succeeded by return-to-dl-resolve technique • But for x64, we have to traverse link_map and patch • Heavy task for ROP… Game Over \(^o^)/ 15
  • 16. REFERENCE • Advanced return-into-lib(c) exploits (PaX case study) (Phrack 58) • http://phrack.org/issues/58/4.html • Return to Dynamic Linker (Codegate 2014 Junior) • http://www.codegate.org/content/board/post_list.php?bid=48&q=Retu rn+to+Dynamic+Linker • How the ELF Ruined Christmas (USENIX Security 2015) • https://www.usenix.org/conference/usenixsecurity15/technical- sessions/presentation/di-frederico 16