BUUCTF:[第一章 web入门]
### 题目:BUUCTF:[第一章 web入门]常见的搜集
打开靶机后提示:
> 敏感文件
Hello, CTFer!
信息搜集之所以重要,是因为其往往会带给我们一些意想不到的东西
hack fun
1. 首先通过工具对后台路径进行爆破,这里尝试使用dirsearch:
```shell
dirsearch -u http://9b4cfa03-5e03-4082-b4d4-8561f9c207c6.node4.buuoj.cn:81/ -w Documents/SecurityTools/Wordlist/ctf.txt
_|. _ ____ _|_ v0.4.3.post1
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 199
Output File: /Users/night/reports/http_9b4cfa03-5e03-4082-b4d4-8561f9c207c6.node4.buuoj.cn_81/__23-07-22_20-53-57.txt
Target: http://9b4cfa03-5e03-4082-b4d4-8561f9c207c6.node4.buuoj.cn:81/
Starting:
429 -568B- /_viminfo
429 -568B- /%3f.save
429 -568B- /%3f~2~
429 -568B- /%3f.save2
429 -568B- /%3f.save3
429 -568B- /%3f.save1
429 -568B- /.htaccess
429 -568B- /phpinfo.php
429 -568B- /robots.txt
429 -568B- /%3f.bak
429 -568B- /.bash_history
429 -568B- /%3f.back
429 -568B- /%3f.bak_Edietplus
429 -568B- /.git/
429 -568B- /.svn/
429 -568B- /.index.php.swp
429 -568B- /index.php.swp
429 -568B- /index.php.bak_Edietplus
429 -568B- /index.php.bak
429 -568B- /.index.php~
429 -568B- /index.php.~
429 -568B- /index.php.~1~
429 -568B- /index.php
429 -568B- /index.php.txt
429 -568B- /index.php.zip
429 -568B- /login.php
429 -568B- /index.php~
429 -568B- /register.php
429 -568B- /index.php.rar
429 -568B- /www.zip
429 -568B- /t.php
429 -568B- /www.7z
429 -568B- /web.rar
429 -568B- /www.tar
429 -568B- /web.zip
429 -568B- /test.php
429 -568B- /register
429 -568B- /www.rar
429 -568B- /index.php.7z
429 -568B- /upload.php
429 -568B- /www.tar.gz
429 -568B- /index.php.tar.gz
429 -568B- /web.7z
429 -568B- /web.tar.gz
429 -568B- /web.tar
429 -568B- /qq.txt
429 -568B- /plus
429 -568B- /log.txt
429 -568B- /wwwroot.rar
429 -568B- /dede
429 -568B- /admin
429 -568B- /Fckeditor
429 -568B- /edit
429 -568B- /ewebeditor
429 -568B- /bbs
429 -568B- /manage
429 -568B- /flag
429 -568B- /web_Fckeditor
429 -568B- /Editor
429 -568B- /login/
429 -568B- /shopadmin
429 -568B- /manager/
429 -568B- /webadmin
429 -568B- /web/
429 -568B- /database/
429 -568B- /manage/
429 -568B- /shopadmin/
429 -568B- /edit/
429 -568B- /login
429 -568B- /admin/daili/webedit
429 -568B- /admin/WebEditor
429 -568B- /tmp/
429 -568B- /admin/
429 -568B- /wp-includes/
429 -568B- /editor/
429 -568B- /user/
429 -568B- /test/
429 -568B- /home/
429 -568B- /administrator/
429 -568B- /users/
429 -568B- /houtai/
429 -568B- /backdoor/
429 -568B- /flag/
429 -568B- /upload/
429 -568B- /download/
429 -568B- /downloads/
429 -568B- /root.zip
429 -568B- /flag.php
429 -568B- /wwwroot.zip
429 -568B- /.ds_store
429 -568B- /root.rar
429 -568B- /uploads/
429 -568B- /backup.rar
429 -568B- /backup.zip
429 -568B- /4dmin.php
429 -568B- /admin.php
429 -568B- /4dm1n.php
429 -568B- /f1ag.php
429 -568B- /f14g.php
429 -568B- /adm1n.php
429 -568B- /fl4g.php
429 -568B- /admin1.php
429 -568B- /admin2.php
429 -568B- /adminlogin.php
429 -568B- /administrator.php
429 -568B- /home.php
429 -568B- /log.php
429 -568B- /logs.php
429 -568B- /config.php
429 -568B- /member.php
429 -568B- /users.php
429 -568B- /user.php
429 -568B- /robots.php
429 -568B- /info.php
429 -568B- /backdoor.php
429 -568B- /fm.php
429 -568B- /example.php
429 -568B- /a.sql
429 -568B- /mysql.bak
429 -568B- /b.sql
429 -568B- /db.sql
429 -568B- /mysql.sql
429 -568B- /bdb.sql
429 -568B- /ddb.sql
429 -568B- /dump.sql
429 -568B- /rss.xml
429 -568B- /users.sql
429 -568B- /backup.sql.gz
429 -568B- /data.sql
429 -568B- /backup.sql.bz2
429 -568B- /flag.txt
429 -568B- /backup.sql
429 -568B- /crossdomain.xml
429 -568B- /1.txt
429 -568B- /wp-config.php
429 -568B- /configuration.php
429 -568B- /sites/default/settings.php
429 -568B- /config.inc.php
429 -568B- /conf/_basic_config.php
429 -568B- /framework/conf/config.php
429 -568B- /config/site.php
429 -568B- /system/config/default.php
429 -568B- /mysite/_config.php
429 -568B- /config/config_global.php
429 -568B- /typo3conf/localconf.php
429 -568B- /config/config_ucenter.php
429 -568B- /lib
429 -568B- /data/config.php
429 -568B- /data/common.inc.php
429 -568B- /data/config.inc.php
429 -568B- /includes/config.php
429 -568B- /404.php
429 -568B- /caches/configs/database.php
429 -568B- /index.html
429 -568B- /phpmyadmin/
429 -568B- /phpsso_server/caches/configs/database.php
429 -568B- /phpMyAdmin/
429 -568B- /phpsso_server/caches/configs/system.php
429 -568B- /include/config.inc.php
429 -568B- /caches/configs/system.php
Task Completed
```
2. 观察后,发现index.php~,robots比较可疑。访问/index.php~
> 敏感文件
Hello, CTFer!
信息搜集之所以重要,是因为其往往会带给我们一些意想不到的东西
hack fun
flag2:s_v3ry_im
很明显,flag并不完整,去robots.txt看看,得到提示
> User-agent: *
Disallow:
/flag1_is_her3_fun.txt
继续访问/flag1_is_her3_fun.txt
> flag1:n1book{info_1
得到Flag1、2但是发现并不完整,疑似存在flag3。对.index.php.swp和index.php.swp进行访问,发现前者中的响应中包含flag3
```html
HTTP/1.1 200 OK
Server: openresty
Date: Sat, 22 Jul 2023 13:11:49 GMT
Content-Type: application/octet-stream
Content-Length: 12288
Connection: close
Accept-Ranges: bytes
Etag: "3000-596a4415d74c0"
Last-Modified: Wed, 06 Nov 2019 02:24:59 GMT
b0VIM 8.0.Â]óº'*venenofhappy~venenof/Desktop/åºé¢/backup/index.phputf-8
U3210#"! Utp=adTd=ð²XS3ê°T
P
ëÆŲRÙ|qpbaXWV=<&é
ã
â
È
¦
L
9
ì ³ 4 ò¾H¹wtsd</body></html> <script src="./Bootswatch_ Sketchy_files/custom.js"></script> <script src="./Bootswatch_ Sketchy_files/bootstrap.min.js"></script> <script src="./Bootswatch_ Sketchy_files/popper.min.js"></script> <script src="./Bootswatch_ Sketchy_files/jquery.min.js"></script> </div> </div> </div> <?php echo 'flag3:p0rtant_hack}';?> <p>hack fun</p> <hr class="my-4"> <p class="lead">ä¿¡æ¯æéä¹æ以éè¦ï¼æ¯å ä¸ºå ¶å¾å¾ä¼å¸¦ç»æ们ä¸äºææ³ä¸å°çä¸è¥¿</p> <h1 class="display-3">Hello, CTFer!</h1> <div class="jumbotron"> <div class="bs-component"> </div> <h1 id="containers">æææ件</h1> <div class="page-header"> <div class="col-lg-12"> <div class="row"> ================================================== --> <!-- Containers <div class="container"><body> </script> })(); var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s); ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; (function() { _gaq.push(['_trackPageview']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_setDomainName', "bootswatch.com"]); _gaq.push(['_setAccount', 'UA-23019901-1']); var _gaq = _gaq || []; <script type="text/javascript" async="" src="./Bootswatch_ Sketchy_files/ga.js"></script><script> <link rel="stylesheet" href="./Bootswatch_ Sketchy_files/custom.min.css"> <link rel="stylesheet" href="./Bootswatch_ Sketchy_files/bootstrap.css" media="screen"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>æææ件</title> <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><!-- saved from url=(0031)https://bootswatch.com/sketchy/ --><!DOCTYPE html>
```
> <?php echo 'flag3:p0rtant_hack}';?>
3.拼接Flag得到
> n1book{info_1s_v3ry_imp0rtant_hack}
### 知识点:
.swp 文件是由 Vim 文本编辑器创建的临时文件。当使用 Vim 打开一个文件进行编辑时,Vim 会创建一个 .swp 文件以存储文件的编辑状态。这样,即使系统崩溃或者 Vim 意外关闭,仍然可以从 .swp 文件恢复你的编辑进度。
一旦正常关闭 Vim 并保存了你的文件,对应的 .swp 文件就会被自动删除。但是,如果 Vim 没有被正常关闭,.swp 文件可能会被留下。如果在打开一个文件时发现存在相应的 .swp 文件,Vim 会提醒你并提供一些选项,如恢复编辑状态或删除 .swp 文件。
VIM再第一次意外退出时生成的文件为\*swp,第二次为:\*swo,第三次\*swn,以此类推
### 题目:[第一章 web入门]粗心的小李
1. 打开靶机后获得提示:
> Git测试
Hello, CTFer!
当前大量开发人员使用git进行版本控制,对站点自动部署。如果配置不当,可能会将.git文件夹直接部署到线上环境。这就引起了git泄露漏洞。
小李好像不是很小心,经过了几次迭代更新就直接就把整个文件夹放到线上环境了:(
very easy
2. 开始对网站进行信息搜集
```shell
dirsearch -u http://599360f4-5099-4343-a3b6-cbe92ad9eb2d.node4.buuoj.cn:81 -w Documents/SecurityTools/Wordlist/ctf.txt
_|. _ ____ _|_ v0.4.3.post1
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 199
Output File: /Users/night/reports/http_599360f4-5099-4343-a3b6-cbe92ad9eb2d.node4.buuoj.cn_81/_23-07-22_21-34-14.txt
Target: http://599360f4-5099-4343-a3b6-cbe92ad9eb2d.node4.buuoj.cn:81/
Starting:
200 - 73B- /.git/description
200 -137B- /.git/config
200 -145B- /.git/index
200 - 23B- /.git/HEAD
301 -392B- /.git->http://599360f4-5099-4343-a3b6-cbe92ad9eb2d.node4.buuoj.cn:81/.git/
```
3. 发现确实存在git泄露
使用(https://github.com/lijiejie/GitHack)工具进行操作
```shell
~ python3 GitHack/GitHack.py http://599360f4-5099-4343-a3b6-cbe92ad9eb2d.node4.buuoj.cn:81/.git/
[+] Download and parse index file ...
[+] index.html
index.html
```
> cat index.html
```html
<!DOCTYPE html>
<!-- saved from url=(0031)https://bootswatch.com/sketchy/ -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Git测试</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="./Bootswatch_ Sketchy_files/bootstrap.css" media="screen">
<link rel="stylesheet" href="./Bootswatch_ Sketchy_files/custom.min.css">
<script type="text/javascript" async="" src="./Bootswatch_ Sketchy_files/ga.js"></script><script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-23019901-1']);
_gaq.push(['_setDomainName', "bootswatch.com"]);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script'); s.parentNode.insertBefore(ga, s);
})();
</script>
<body>
<div class="container">
<!-- Containers
================================================== -->
<div class="row">
<div class="col-lg-12">
<div class="page-header">
<h1 id="containers">Git测试</h1>
</div>
<div class="bs-component">
<div class="jumbotron">
<h1 class="display-3">Hello, CTFer!</h1>
<p class="lead">当前大量开发人员使用git进行版本控制,对站点自动部署。如果配置不当,可能会将.git文件夹直接部署到线上环境。这就引起了git泄露漏洞。</p>
<hr class="my-4">
<p>小李好像不是很小心,经过了几次迭代更新就直接就把整个文件夹放到线上环境了:(</p>
<p>n1book{git_looks_s0_easyfun}</p>
</div>
</div>
</div>
<script src="./Bootswatch_ Sketchy_files/jquery.min.js"></script>
<script src="./Bootswatch_ Sketchy_files/popper.min.js"></script>
<script src="./Bootswatch_ Sketchy_files/bootstrap.min.js"></script>
<script src="./Bootswatch_ Sketchy_files/custom.js"></script>
</body></html>
```
Flag:n1book{git_looks_s0_easyfun}
过来学习学习 学习一下大佬{:1_921:} 来学习,感谢分享{:1_921:} n1book的题目? 挺适合我这种新人,支持大佬 skywalker0123 发表于 2023-7-23 08:18
n1book的题目?
对的,是从0到1CTFer那本书的 什么也不懂过来学习学习! 写的不错,学习一下 每天学习一点。感谢楼主