当前位置:   article > 正文

web--信息泄漏_missing required dependencies to run. do you want

missing required dependencies to run. do you want dirsearch to automatically

信息泄漏

### 目录遍历

开启题目,点击开始寻找 flag,发现进入了另外一个目录下。

image-20220520105749866

试着点了几个目录,发现下面还有一层目录,但是很容易就发现问题了。

image-20220520105935708

image-20220520105956243

每个 第一层目录下还有第二层,都是 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')
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

找出返回的数据长度,长度越长说明返回的内容越多。

image-20220520110719823

image-20220520105704347

PHPINFO

phpinfo() 是php环境配置信息的页面,里面注明了当前环境的版本信息、开启的模块等等敏感信息。

顶栏php的版本信息

image-20220520171439384

php的当前系统环境信息,包括 操作系统信息、

image-20220520171512569

一点一点看看就找到flag了,当然如果是冲着flag来的就直接 ctrl + f

image-20220520172206474

备份文件泄漏

网站源码泄漏

开启靶机,直接用 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21

提供一下此次扫描文件使用的字典和代码

#!/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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

image-20220520180915401

下载源码,找了一下 发现没有找到flag

image-20220520175732061

最终访问txt文件名就得到了flag

image-20220520175817851

bak文件

找 index.php 源代码,还是一样,扫描下源代码

image-20220520181055858

如果不是很复杂的备份文件的话 dirsearch 还是很厉害的

 python3 dirsearch.py -u http://challenge-1a178c346247e62e.sandbox.ctfhub.com:10800/ -e tar,zip,tar.gz,rar -x 503
  • 1

image-20220520181316898

拿到flag

image-20220520181445993

vim 缓存

象征性的截个图

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/726630
推荐阅读
相关标签