SlideShare a Scribd company logo
Return Oriented Programming  (ROP) Based Exploits  - Part I
Return Oriented Programming  (ROP) Based Exploits  - Part I
Exploit - ex·ploitto use selfishly for one's own ends
Exploit DiscoveryBig space in computer security Exploits are discovered by Security Researchers and Hackers alikeZero day attacks are a result of newly created exploits or un-patched vulnerabilities
Exploit MitigationWindows XP Sp2 was the first widespread OS to incorporate exploit mitigationProtected stack metadata (Visual studio compiler/ GS flag)Protected heap metadata (RtlHeap Safe Unlinking)SafeSEH (Compile time execution handler registration)Software, Hardware enforced Data Execution Prevention (DEP)Windows Vista implements Address Space Layout Randomization (ASLR)
Break the mitigationBlackHat PresentationsSecurity ForumsBlogs
Whose responsibility is it to mitigate ?Heap ProtectionSEH Chain validationDEPASLRStack CookiesSafe SEH
DEP  - Data Execution PreventionWhen an attempt is made to execute code from a DEP protected data page,an access violation (STATUS_ACCESS_VIOLATION (0xc0000005)) will occur. In most cases, this will result in process termination (unhandled exception).
DEP  - Data Execution PreventionWithout DEP OnWith DEP On
ProblemWith DEP on, code from the stack won’t work
Work-AroundWe need to build a chain of instructions.  We need to jump from one part of the chain to the other part of the chain without ever executing a single bit from our DEP protected region.  Or, to use a better term, we need to return from one instruction to the address of the next instructionEach instruction (series of instructions) in our chain will be called a "gadget".  Each gadget will return to the next gadget ( = to the address of the next gadget, placed on the stack), or will call the next address directly.We will need to use existing instructions (instructions in executable areas within the process)and put them in such an order (and "chain" them together) so they would produce what we need and put data in registers and/or on the stack
LetterThe chocolate bombs you sent, bombs they are in size . Received them, yesterday. Planted the rose plant, bomb was delicious … had to mention again. Set to go for shopping, 5 p.m. tomorrow. The chocolate bombs you sent, bombs they are in size . Received them, yesterday. Planted the rose plant, bomb was delicious … had to mention again. Set to go for shopping, 5 p.m. tomorrow. ThebombsReceivedyesterday PlantedbombSet5 p.m. tomorrow
Don’t sleep yet
GadgetWe need to take a value from the stack, put it in EAX, and increase it with 0×80
GadgetWe need to take a value from the stack, put it in EAX, and increase it with 0×80-- - - - - - - - -- -- - - -  - --- -  - -- -- - - - - - - - -- -- - - -  - --- -  - -- -- - - - - - - - -- -- - - -  - --- -  - -- WindowsFunction_1()ADD EBX, 30TEST AL, ALPOP EAXRETPOP EAXRETADD EAX, 80POP EBXRET-- - - - - - - - -- -- - - -  - --- -  - -- -- - - - - - - - -- -- - - -  - --- -  - -- -- - - - - - - - -- -- - - -  - --- -  - -- WindowsFunction_2()INC EAXADD EAX, 80POP EBXRET-- - - - - - - - -- -- - - -  - --- -  - -- -- - - - - - - - -- -- - - -  - --- -  - -- -- - - - - - - - -- -- - - -  - --- -  - --
Gadget		  Stack address 	Stack value ESP points here -> 	  0010F730 		10026D56 (pointer to POP EAX + RET)   		  0010F734                           50505050 (this will be popped into EAX)   		  0010F738 		1002DC24 (pointer to ADD EAX,80  + POP EBX + RET)   		  0010F73C 		DEADBEEF (this will be popped into EBX, padding)
Windows Function Calls to bypass DEPVirtualAlloc(MEM_COMMIT + PAGE_READWRITE_EXECUTE) + copy memory.  This will allow you to create a new executable memory region, copy your shellcode to it, and execute itHeapCreate(HEAP_CREATE_ENABLE_EXECUTE) + HeapAlloc() + copy memory. SetProcessDEPPolicy()NtSetInformationProcess()VirtualProtect(PAGE_READ_WRITE_EXECUTE). This function will change the access protection level of a given memory page, allowing you to mark the location where your shellcode resides as executable.WriteProcessMemory()
Windows Function Calls to bypass DEPEach one of those functions requires the stack or registers to be set up in a specific way.when an API is called, it will assume that the parameters to the function are placed at the top of the stack (= at ESP)
How to chainDemo
Finding ROP gadgetsThere are 2 approaches to finding gadgets that will help you building the ROP chain :    You can specifically search for instructions and see if they are followed by a RET.      The instructions between the one you are looking for, and the RET instruction (which will     end the gadget) should not break the gadget.     You can look for all RET instructions and then walk back, see if the previous instructions     include the instruction you are looking for. pvefindaddr
First part of the ExploitTesting ROP with a Windows APIVirtualProtect()Demo
Now you can sleep 
Thank You
Imageshttp://s280.photobucket.com/albums/kk176/sabbath_X/?action=view&current=Pumpkin_ Grin_lll_by_midnightINK.jpg&newest=1http://www.indiamike.com/india/attachments/7595d1210760693-what-the-strange-questions-for-india-experts-chilli-and-lemon.jpghttp://www.animevice.com/profile/kao/all-images/84-142612/albert_wesker___reside nt_evil_by_megakay/83-203102/http://la-vie-bohem.deviantart.com/art/Yawn-115528201?q=boost%3Apopular+yawn+baby&qo=32http://SillyScreamingQueen.deviantart.com/art/Sleepy-54882830?q=boost%3Apopular+sleepy&qo=6
Ad

Recommended

How Functions Work
How Functions Work
Saumil Shah
 
Operating Systems - A Primer
Operating Systems - A Primer
Saumil Shah
 
Advance ROP Attacks
Advance ROP Attacks
n|u - The Open Security Community
 
An introduction to ROP
An introduction to ROP
Saumil Shah
 
Dive into ROP - a quick introduction to Return Oriented Programming
Dive into ROP - a quick introduction to Return Oriented Programming
Saumil Shah
 
Course lecture - An introduction to the Return Oriented Programming
Course lecture - An introduction to the Return Oriented Programming
Jonathan Salwan
 
Introduction to Debuggers
Introduction to Debuggers
Saumil Shah
 
ROP 輕鬆談
ROP 輕鬆談
hackstuff
 
Exploit techniques - a quick review
Exploit techniques - a quick review
Ce.Se.N.A. Security
 
Mona cheatsheet
Mona cheatsheet
Ce.Se.N.A. Security
 
[2012 CodeEngn Conference 06] pwn3r - Secuinside 2012 CTF 예선 문제풀이
[2012 CodeEngn Conference 06] pwn3r - Secuinside 2012 CTF 예선 문제풀이
GangSeok Lee
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform Exploitation
Quinn Wilton
 
Virtual platform
Virtual platform
sean chen
 
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
Sheng-Hao Ma
 
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
CrowdStrike
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
National Cheng Kung University
 
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Ajin Abraham
 
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
Simen Li
 
2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2
LiviaLiaoFontech
 
Software to the slaughter
Software to the slaughter
Quinn Wilton
 
from Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Works
Zhen Wei
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
Kernel TLV
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
National Cheng Kung University
 
Runtime Symbol Resolution
Runtime Symbol Resolution
Ken Kawamoto
 
Unit 5
Unit 5
siddr
 
No instrumentation Golang Logging with eBPF (GoSF talk 11/11/20)
No instrumentation Golang Logging with eBPF (GoSF talk 11/11/20)
Pixie Labs
 
PHP 7 OPCache extension review
PHP 7 OPCache extension review
julien pauli
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Ajin Abraham
 
Advanced exploit development
Advanced exploit development
Dan H
 
Return-Oriented Programming: Exploits Without Code Injection
Return-Oriented Programming: Exploits Without Code Injection
guest9f4856
 

More Related Content

What's hot (20)

Exploit techniques - a quick review
Exploit techniques - a quick review
Ce.Se.N.A. Security
 
Mona cheatsheet
Mona cheatsheet
Ce.Se.N.A. Security
 
[2012 CodeEngn Conference 06] pwn3r - Secuinside 2012 CTF 예선 문제풀이
[2012 CodeEngn Conference 06] pwn3r - Secuinside 2012 CTF 예선 문제풀이
GangSeok Lee
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform Exploitation
Quinn Wilton
 
Virtual platform
Virtual platform
sean chen
 
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
Sheng-Hao Ma
 
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
CrowdStrike
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
National Cheng Kung University
 
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Ajin Abraham
 
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
Simen Li
 
2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2
LiviaLiaoFontech
 
Software to the slaughter
Software to the slaughter
Quinn Wilton
 
from Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Works
Zhen Wei
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
Kernel TLV
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
National Cheng Kung University
 
Runtime Symbol Resolution
Runtime Symbol Resolution
Ken Kawamoto
 
Unit 5
Unit 5
siddr
 
No instrumentation Golang Logging with eBPF (GoSF talk 11/11/20)
No instrumentation Golang Logging with eBPF (GoSF talk 11/11/20)
Pixie Labs
 
PHP 7 OPCache extension review
PHP 7 OPCache extension review
julien pauli
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Ajin Abraham
 
Exploit techniques - a quick review
Exploit techniques - a quick review
Ce.Se.N.A. Security
 
[2012 CodeEngn Conference 06] pwn3r - Secuinside 2012 CTF 예선 문제풀이
[2012 CodeEngn Conference 06] pwn3r - Secuinside 2012 CTF 예선 문제풀이
GangSeok Lee
 
One Shellcode to Rule Them All: Cross-Platform Exploitation
One Shellcode to Rule Them All: Cross-Platform Exploitation
Quinn Wilton
 
Virtual platform
Virtual platform
sean chen
 
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
NTUSTxTDOH 資訊安全基礎工作坊 基礎逆向教育訓練
Sheng-Hao Ma
 
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
CrowdStrike
 
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Ajin Abraham
 
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
[嵌入式系統] MCS-51 實驗 - 使用 IAR (2)
Simen Li
 
2021.laravelconf.tw.slides2
2021.laravelconf.tw.slides2
LiviaLiaoFontech
 
Software to the slaughter
Software to the slaughter
Quinn Wilton
 
from Binary to Binary: How Qemu Works
from Binary to Binary: How Qemu Works
Zhen Wei
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
Kernel TLV
 
Runtime Symbol Resolution
Runtime Symbol Resolution
Ken Kawamoto
 
Unit 5
Unit 5
siddr
 
No instrumentation Golang Logging with eBPF (GoSF talk 11/11/20)
No instrumentation Golang Logging with eBPF (GoSF talk 11/11/20)
Pixie Labs
 
PHP 7 OPCache extension review
PHP 7 OPCache extension review
julien pauli
 
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Exploit Research and Development Megaprimer: Unicode Based Exploit Development
Ajin Abraham
 

Viewers also liked (6)

Advanced exploit development
Advanced exploit development
Dan H
 
Return-Oriented Programming: Exploits Without Code Injection
Return-Oriented Programming: Exploits Without Code Injection
guest9f4856
 
Sintsov advanced exploitation in win32
Sintsov advanced exploitation in win32
DefconRussia
 
Advanced Exploit Development (Updated on 28 January, 2016)
Advanced Exploit Development (Updated on 28 January, 2016)
Dan H
 
IOT Exploitation
IOT Exploitation
Cysinfo Cyber Security Community
 
Linux Exploit Research
Linux Exploit Research
Dan H
 
Advanced exploit development
Advanced exploit development
Dan H
 
Return-Oriented Programming: Exploits Without Code Injection
Return-Oriented Programming: Exploits Without Code Injection
guest9f4856
 
Sintsov advanced exploitation in win32
Sintsov advanced exploitation in win32
DefconRussia
 
Advanced Exploit Development (Updated on 28 January, 2016)
Advanced Exploit Development (Updated on 28 January, 2016)
Dan H
 
Linux Exploit Research
Linux Exploit Research
Dan H
 
Ad

Similar to Return Oriented Programming (ROP) Based Exploits - Part I (20)

[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
Moabi.com
 
CyberLink LabelPrint 2.5 Exploitation Process
CyberLink LabelPrint 2.5 Exploitation Process
Thomas Gregory
 
Writing Metasploit Plugins
Writing Metasploit Plugins
amiable_indian
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Vincenzo Iozzo
 
Heap overflows for humans – 101
Heap overflows for humans – 101
Craft Symbol
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation
Moabi.com
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis
Moabi.com
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis
Moabi.com
 
Unix executable buffer overflow
Unix executable buffer overflow
Ammarit Thongthua ,CISSP CISM GXPN CSSLP CCNP
 
Taking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) Family
Ben Hall
 
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
JongWon Kim
 
Computer Science Assignment Help
Computer Science Assignment Help
Programming Homework Help
 
Playing With (B)Sqli
Playing With (B)Sqli
Chema Alonso
 
Exploit Development: EzServer Buffer Overflow oleh Tom Gregory
Exploit Development: EzServer Buffer Overflow oleh Tom Gregory
zakiakhmad
 
Exploit Development with Python
Exploit Development with Python
Thomas Gregory
 
Low Level Exploits
Low Level Exploits
hughpearse
 
Buffer Overflow - Smashing the Stack
Buffer Overflow - Smashing the Stack
ironSource
 
SEH overwrite and its exploitability
SEH overwrite and its exploitability
FFRI, Inc.
 
Code Red Security
Code Red Security
Amr Ali
 
ruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Ruby
Carlos Duarte do Nascimento
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
Moabi.com
 
CyberLink LabelPrint 2.5 Exploitation Process
CyberLink LabelPrint 2.5 Exploitation Process
Thomas Gregory
 
Writing Metasploit Plugins
Writing Metasploit Plugins
amiable_indian
 
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Post Exploitation Bliss: Loading Meterpreter on a Factory iPhone, Black Hat U...
Vincenzo Iozzo
 
Heap overflows for humans – 101
Heap overflows for humans – 101
Craft Symbol
 
[HITB Malaysia 2011] Exploit Automation
[HITB Malaysia 2011] Exploit Automation
Moabi.com
 
[Kiwicon 2011] Post Memory Corruption Memory Analysis
[Kiwicon 2011] Post Memory Corruption Memory Analysis
Moabi.com
 
[Ruxcon 2011] Post Memory Corruption Memory Analysis
[Ruxcon 2011] Post Memory Corruption Memory Analysis
Moabi.com
 
Taking advantage of the Amazon Web Services (AWS) Family
Taking advantage of the Amazon Web Services (AWS) Family
Ben Hall
 
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
Penetration Testing for Easy RM to MP3 Converter Application and Post Exploit
JongWon Kim
 
Playing With (B)Sqli
Playing With (B)Sqli
Chema Alonso
 
Exploit Development: EzServer Buffer Overflow oleh Tom Gregory
Exploit Development: EzServer Buffer Overflow oleh Tom Gregory
zakiakhmad
 
Exploit Development with Python
Exploit Development with Python
Thomas Gregory
 
Low Level Exploits
Low Level Exploits
hughpearse
 
Buffer Overflow - Smashing the Stack
Buffer Overflow - Smashing the Stack
ironSource
 
SEH overwrite and its exploitability
SEH overwrite and its exploitability
FFRI, Inc.
 
Code Red Security
Code Red Security
Amr Ali
 
ruby2600 - an Atari 2600 emulator written in Ruby
ruby2600 - an Atari 2600 emulator written in Ruby
Carlos Duarte do Nascimento
 
Ad

More from n|u - The Open Security Community (20)

Hardware security testing 101 (Null - Delhi Chapter)
Hardware security testing 101 (Null - Delhi Chapter)
n|u - The Open Security Community
 
Osint primer
Osint primer
n|u - The Open Security Community
 
SSRF exploit the trust relationship
SSRF exploit the trust relationship
n|u - The Open Security Community
 
Nmap basics
Nmap basics
n|u - The Open Security Community
 
Metasploit primary
Metasploit primary
n|u - The Open Security Community
 
Api security-testing
Api security-testing
n|u - The Open Security Community
 
Introduction to TLS 1.3
Introduction to TLS 1.3
n|u - The Open Security Community
 
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
n|u - The Open Security Community
 
Talking About SSRF,CRLF
Talking About SSRF,CRLF
n|u - The Open Security Community
 
Building active directory lab for red teaming
Building active directory lab for red teaming
n|u - The Open Security Community
 
Owning a company through their logs
Owning a company through their logs
n|u - The Open Security Community
 
Introduction to shodan
Introduction to shodan
n|u - The Open Security Community
 
Cloud security
Cloud security
n|u - The Open Security Community
 
Detecting persistence in windows
Detecting persistence in windows
n|u - The Open Security Community
 
Frida - Objection Tool Usage
Frida - Objection Tool Usage
n|u - The Open Security Community
 
OSQuery - Monitoring System Process
OSQuery - Monitoring System Process
n|u - The Open Security Community
 
DevSecOps Jenkins Pipeline -Security
DevSecOps Jenkins Pipeline -Security
n|u - The Open Security Community
 
Extensible markup language attacks
Extensible markup language attacks
n|u - The Open Security Community
 
Linux for hackers
Linux for hackers
n|u - The Open Security Community
 
Android Pentesting
Android Pentesting
n|u - The Open Security Community
 
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
Gibson 101 -quick_introduction_to_hacking_mainframes_in_2020_null_infosec_gir...
n|u - The Open Security Community
 

Recently uploaded (20)

Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
High Availability On-Premises FME Flow.pdf
High Availability On-Premises FME Flow.pdf
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
War_And_Cyber_3_Years_Of_Struggle_And_Lessons_For_Global_Security.pdf
biswajitbanerjee38
 
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
vertical-cnc-processing-centers-drillteq-v-200-en.pdf
AmirStern2
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Seminar: Evolving Landscape of Post-Quantum Cryptography.pptx
FIDO Alliance
 
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Seminar: Perspectives on Passkeys & Consumer Adoption.pptx
FIDO Alliance
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 

Return Oriented Programming (ROP) Based Exploits - Part I

  • 2. Return Oriented Programming (ROP) Based Exploits - Part I
  • 3. Exploit - ex·ploitto use selfishly for one's own ends
  • 4. Exploit DiscoveryBig space in computer security Exploits are discovered by Security Researchers and Hackers alikeZero day attacks are a result of newly created exploits or un-patched vulnerabilities
  • 5. Exploit MitigationWindows XP Sp2 was the first widespread OS to incorporate exploit mitigationProtected stack metadata (Visual studio compiler/ GS flag)Protected heap metadata (RtlHeap Safe Unlinking)SafeSEH (Compile time execution handler registration)Software, Hardware enforced Data Execution Prevention (DEP)Windows Vista implements Address Space Layout Randomization (ASLR)
  • 6. Break the mitigationBlackHat PresentationsSecurity ForumsBlogs
  • 7. Whose responsibility is it to mitigate ?Heap ProtectionSEH Chain validationDEPASLRStack CookiesSafe SEH
  • 8. DEP - Data Execution PreventionWhen an attempt is made to execute code from a DEP protected data page,an access violation (STATUS_ACCESS_VIOLATION (0xc0000005)) will occur. In most cases, this will result in process termination (unhandled exception).
  • 9. DEP - Data Execution PreventionWithout DEP OnWith DEP On
  • 10. ProblemWith DEP on, code from the stack won’t work
  • 11. Work-AroundWe need to build a chain of instructions. We need to jump from one part of the chain to the other part of the chain without ever executing a single bit from our DEP protected region. Or, to use a better term, we need to return from one instruction to the address of the next instructionEach instruction (series of instructions) in our chain will be called a "gadget". Each gadget will return to the next gadget ( = to the address of the next gadget, placed on the stack), or will call the next address directly.We will need to use existing instructions (instructions in executable areas within the process)and put them in such an order (and "chain" them together) so they would produce what we need and put data in registers and/or on the stack
  • 12. LetterThe chocolate bombs you sent, bombs they are in size . Received them, yesterday. Planted the rose plant, bomb was delicious … had to mention again. Set to go for shopping, 5 p.m. tomorrow. The chocolate bombs you sent, bombs they are in size . Received them, yesterday. Planted the rose plant, bomb was delicious … had to mention again. Set to go for shopping, 5 p.m. tomorrow. ThebombsReceivedyesterday PlantedbombSet5 p.m. tomorrow
  • 14. GadgetWe need to take a value from the stack, put it in EAX, and increase it with 0×80
  • 15. GadgetWe need to take a value from the stack, put it in EAX, and increase it with 0×80-- - - - - - - - -- -- - - - - --- - - -- -- - - - - - - - -- -- - - - - --- - - -- -- - - - - - - - -- -- - - - - --- - - -- WindowsFunction_1()ADD EBX, 30TEST AL, ALPOP EAXRETPOP EAXRETADD EAX, 80POP EBXRET-- - - - - - - - -- -- - - - - --- - - -- -- - - - - - - - -- -- - - - - --- - - -- -- - - - - - - - -- -- - - - - --- - - -- WindowsFunction_2()INC EAXADD EAX, 80POP EBXRET-- - - - - - - - -- -- - - - - --- - - -- -- - - - - - - - -- -- - - - - --- - - -- -- - - - - - - - -- -- - - - - --- - - --
  • 16. Gadget   Stack address Stack value ESP points here -> 0010F730 10026D56 (pointer to POP EAX + RET)   0010F734 50505050 (this will be popped into EAX)   0010F738 1002DC24 (pointer to ADD EAX,80  + POP EBX + RET)   0010F73C DEADBEEF (this will be popped into EBX, padding)
  • 17. Windows Function Calls to bypass DEPVirtualAlloc(MEM_COMMIT + PAGE_READWRITE_EXECUTE) + copy memory. This will allow you to create a new executable memory region, copy your shellcode to it, and execute itHeapCreate(HEAP_CREATE_ENABLE_EXECUTE) + HeapAlloc() + copy memory. SetProcessDEPPolicy()NtSetInformationProcess()VirtualProtect(PAGE_READ_WRITE_EXECUTE). This function will change the access protection level of a given memory page, allowing you to mark the location where your shellcode resides as executable.WriteProcessMemory()
  • 18. Windows Function Calls to bypass DEPEach one of those functions requires the stack or registers to be set up in a specific way.when an API is called, it will assume that the parameters to the function are placed at the top of the stack (= at ESP)
  • 20. Finding ROP gadgetsThere are 2 approaches to finding gadgets that will help you building the ROP chain : You can specifically search for instructions and see if they are followed by a RET.  The instructions between the one you are looking for, and the RET instruction (which will end the gadget) should not break the gadget. You can look for all RET instructions and then walk back, see if the previous instructions include the instruction you are looking for. pvefindaddr
  • 21. First part of the ExploitTesting ROP with a Windows APIVirtualProtect()Demo
  • 22. Now you can sleep 