[HarekazeCTF2019]baby_rop2

题目链接:[HarekazeCTF2019]baby_rop2

下载附件后,使用 IDA 反编译,定位到主要函数,如下。

int __fastcall main(int argc, const char **argv, const char **envp)
{
  char buf[28]; // [rsp+0h] [rbp-20h] BYREF
  int v5; // [rsp+1Ch] [rbp-4h]

  setvbuf(stdout, 0LL, 2, 0LL);
  setvbuf(stdin, 0LL, 2, 0LL);
  printf("What's your name? ");
  v5 = read(0, buf, 0x100uLL);
  buf[v5 - 1] = 0;
  printf("Welcome to the Pwn World again, %s!\n", buf);
  return 0;
}

解题思路:

  1. 栈溢出泄露 LIBC 基址。
  2. 调用 One_GadGet 获取 Shell。
posted @ 2025-09-06 13:11  imtaieee  阅读(16)  评论(0)    收藏  举报