QWXFB-2024/正式赛/Pwn/newbie_fmt/attachment/newbie_fmt.c

16 lines
310 B
C
Raw Permalink Normal View History

2024-09-16 11:35:04 +08:00
// gcc ./newbie_fmt.c -o ./pwn
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
int main () {
char dummpy[0x200];
char buf[8];
int fd = open("flag", O_RDONLY);
read(fd, dummpy+0x1a0, 0x30);
close(fd);
read(0, buf, 8);
printf(buf);
}