Hgame
WEEK1
1.换头大作战
题目地址题目首先是这样一个界面,既然让我提交,那自然要提交试试,随便填个1进去提交试试。
提交完提示:
request method is error.I think POST is better
既然让我POST,果断调出HACKBAR,同时注意到url后面多了个want变量,自然想到去POST这个want。
构造want=1,RUN,得到下图:需要localhost,第一想法是改hosts文件,可惜没用。接下来自然只能抓包,添加X-Forwarded-For了。于是使用burpsuite抓一个POST包,如图:
再在此处添加X-Forwarded-For: (此处有空格)127.0.0.1,接着GO,得到下图结果:
显然需要改代理,需要使用WATERFOX的代理,于是将上图的User-Agent更改为:
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Waterfox/50.0
再GO,得到下图:显然要更改refer,要改到B站,于是添加 Referer:(此次有空格) www.bilibili.com,再GO,得到下图:
这里我们修改Cookies,将admin的值改为1,再GO,终得hgame{hTTp_HeaDeR_iS_Ez}
2.very easy web
显然这是个代码审计题,一眼看到包含了个flag.php,看看能不能取巧访问以下,嘿嘿,可惜啥也没有!
只能审计代码了,一个GET,一个URLDecode,显然这要应用url二次解码的漏洞。大致意思就是给id传个值,该值不能包含在“vidar”中,但是解码之后和vidar相同。
构造?id=%2576idar,第一个%25经过get第一次解析之后变为%,此时读取到的id值为%76idar,再解码之后即相等。得到flag。
hgame{urlDecode_Is_GoOd}
3.can u find me?
点开一看就让我找入口,毫不犹豫看看源代码。找到一个f12.php,进入之后又让我找password,这一顿好找,首先查看源码,啥也没有。审查元素看看,看看网络头,惊喜出现了,还真找到了password,如图:按他的要求,post这个password,出现一个超链接,进入下一步
click me to get flag
进去之后同样是各种查看,在网络这里发现一个状态码为302的跳转前目录文件,如图:
这只能抓包看看了,于是抓取之前那个超链接,抓到跳转之前的状态。成功得到flag。
hgame{f12_1s_aMazIng111}
WEEK2
下面这些都遇到了或大或小的障碍,这里只写出部分思路
1.easy_php
看标题,where is my robots. 这给得不到有用信息的我提供个思路,访问robots.txt,结果得到img/index.php,接着访问它,得到源码:
<?php
error_reporting(0);
$img = $_GET['img'];
if(!isset($img))
$img = '1';
$img = str_replace('../', '', $img);
include_once($img.".php");
highlight_file(__FILE__);
个人审计完认为,其实就是在easyphp目录下给img传个值,在=再访问该文件即可,所以我构造了:
http://118.24.25.25:9999/easyphp/flag.php?img=flag
结果回显:maybe_you_should_think_think
到此,以失败结束!!!
2.php trick
进入之后直接上源码
<?php
//admin.php
highlight_file(__FILE__);
$str1 = (string)@$_GET['str1'];
$str2 = (string)@$_GET['str2'];
$str3 = @$_GET['str3'];
$str4 = @$_GET['str4'];
$str5 = @$_GET['H_game'];
$url = @$_GET['url'];
if( $str1 == $str2 ){
die('step 1 fail');
}
if( md5($str1) != md5($str2) ){
die('step 2 fail');
}
if( $str3 == $str4 ){
die('step 3 fail');
}
if ( md5($str3) !== md5($str4)){
die('step 4 fail');
}
if (strpos($_SERVER['QUERY_STRING'], "H_game") !==false) {
die('step 5 fail');
}
if(is_numeric($str5)){
die('step 6 fail');
}
if ($str5<9999999999){
die('step 7 fail');
}
if ((string)$str5>0){
die('step 8 fial');
}
if (parse_url($url, PHP_URL_HOST) !== "www.baidu.com"){
die('step 9 fail');
}
if (parse_url($url,PHP_URL_SCHEME) !== "http"){
die('step 10 fail');
}
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
$output = curl_exec($ch);
curl_close($ch);
if($output === FALSE){
die('step 11 fail');
}
else{
echo $output;
}
step 1 fail
这里我构造以下payload全部绕过,结果就是不给flag,我也不知道为啥!!!
http://118.24.3.214:3001/?str1=QNKCDZO&str2=s878926199a&str3[]={1}&str4[]={2}&H+game[]=1&url=http://www.baidu.com/