mirror of
https://github.com/UzJu/Cloud-Bucket-Leak-Detection-Tools.git
synced 2025-11-05 10:44:04 +00:00
新增域名批量检测
自动判断扫描的URL是否为域名
This commit is contained in:
parent
1715fe6148
commit
ccedd85be3
10
README.en.md
10
README.en.md
@ -79,6 +79,13 @@ Enter the storage bucket address to automatically detect, the function is as fol
|
|||||||
+ 5、Detect whether the bucket can upload Objects
|
+ 5、Detect whether the bucket can upload Objects
|
||||||
+ 6、Batch detection function
|
+ 6、Batch detection function
|
||||||
|
|
||||||
|
## 4, domain name detection function
|
||||||
|
|
||||||
|
Many storage buckets have resolved the domain name, the new judgment of the CNAME of the domain name, and then take the CNAME to detect
|
||||||
|
|
||||||
|
**can now directly import a large number of domain name assets for detection, will automatically determine the CNAME of the domain name **
|
||||||
|
|
||||||
|

|
||||||
# 0x03 Ali cloud storage bucket utilization
|
# 0x03 Ali cloud storage bucket utilization
|
||||||
|
|
||||||
### 1、Implementation idea
|
### 1、Implementation idea
|
||||||
@ -116,6 +123,9 @@ First implement the `OssBucketCheckFromSDK` class
|
|||||||
|
|
||||||
> actually just delete this library, don't use it ^ ^
|
> actually just delete this library, don't use it ^ ^
|
||||||
|
|
||||||
|
**March 7, 2022**
|
||||||
|
|
||||||
|
+ New Domain Name Detection
|
||||||
# :cop:0xffffffff Disclaimer
|
# :cop:0xffffffff Disclaimer
|
||||||
|
|
||||||
Disclaimers
|
Disclaimers
|
||||||
|
|||||||
17
README.md
17
README.md
@ -1,5 +1,9 @@
|
|||||||
# :rooster:0x00 前言
|
# :rooster:0x00 前言
|
||||||
|
|
||||||
|
> 2022年3月7日
|
||||||
|
>
|
||||||
|
> 我觉得文档写的还不是很清楚,等有空更新一下文档完整的使用教程
|
||||||
|
|
||||||
**语言/Language**
|
**语言/Language**
|
||||||
|
|
||||||
English README: [English](README.en.md)
|
English README: [English](README.en.md)
|
||||||
@ -29,7 +33,6 @@ English README: [English](README.en.md)
|
|||||||
|
|
||||||
+ pip3 install oss2
|
+ pip3 install oss2
|
||||||
+ pip3 install colorlog
|
+ pip3 install colorlog
|
||||||
+ pip3 install logging
|
|
||||||
+ pip3 install argparse
|
+ pip3 install argparse
|
||||||
|
|
||||||
# :gun:0x02 使用方法
|
# :gun:0x02 使用方法
|
||||||
@ -89,6 +92,14 @@ python3 main.py -f filepath
|
|||||||
+ 5、检测存储桶是否可上传Object
|
+ 5、检测存储桶是否可上传Object
|
||||||
+ 6、批量检测功能
|
+ 6、批量检测功能
|
||||||
|
|
||||||
|
## 4、域名检测功能
|
||||||
|
|
||||||
|
很多存储桶都解析了域名,新增判断域名的CNAME,然后取CNAME来进行检测
|
||||||
|
|
||||||
|
**现在可以直接导入大量域名资产来进行检测,会自动判断域名的CNAME**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
# 0x03 阿里云存储桶利用
|
# 0x03 阿里云存储桶利用
|
||||||
|
|
||||||
### 1、实现思路
|
### 1、实现思路
|
||||||
@ -128,6 +139,10 @@ python3 main.py -f filepath
|
|||||||
|
|
||||||
> 其实是直接把这个库删了,不用了^ ^
|
> 其实是直接把这个库删了,不用了^ ^
|
||||||
|
|
||||||
|
**2022年3月7日**
|
||||||
|
|
||||||
|
+ 新增域名检测
|
||||||
|
|
||||||
# :cop:0xffffffff 免责声明
|
# :cop:0xffffffff 免责声明
|
||||||
|
|
||||||
免责声明
|
免责声明
|
||||||
|
|||||||
24
core/DnsResolution.py
Normal file
24
core/DnsResolution.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# @Author : UzJu@菜菜狗
|
||||||
|
# @Email : UzJuer@163.com
|
||||||
|
# @Software: PyCharm
|
||||||
|
# @Time : 2022/3/7 上午11:38
|
||||||
|
# @File : DnsResolution.py
|
||||||
|
|
||||||
|
|
||||||
|
import dns.resolver
|
||||||
|
import logging
|
||||||
|
|
||||||
|
module_logger = logging.getLogger("mainModule.Dns")
|
||||||
|
|
||||||
|
|
||||||
|
def GetDomainDnsResolution(domain):
|
||||||
|
try:
|
||||||
|
cname = dns.resolver.resolve(domain, 'CNAME')
|
||||||
|
for i in cname.response.answer:
|
||||||
|
for j in i.items:
|
||||||
|
return j.to_text()
|
||||||
|
except Exception as e:
|
||||||
|
return False
|
||||||
|
|
||||||
19
main.py
19
main.py
@ -16,6 +16,7 @@ from config import BannerInfo
|
|||||||
import requests
|
import requests
|
||||||
import argparse
|
import argparse
|
||||||
from core import aliyunOss
|
from core import aliyunOss
|
||||||
|
from core import DnsResolution
|
||||||
|
|
||||||
NowTime = datetime.datetime.now().strftime('%Y-%m-%d')
|
NowTime = datetime.datetime.now().strftime('%Y-%m-%d')
|
||||||
|
|
||||||
@ -87,14 +88,22 @@ if __name__ == '__main__':
|
|||||||
parser.add_argument('-aliyun', dest='aliyun', help='python3 -aliyun UzJu.oss-cn-beijing.aliyuncs.com')
|
parser.add_argument('-aliyun', dest='aliyun', help='python3 -aliyun UzJu.oss-cn-beijing.aliyuncs.com')
|
||||||
parser.add_argument('-f', '--file', dest='file', help='python3 -f/--file url.txt')
|
parser.add_argument('-f', '--file', dest='file', help='python3 -f/--file url.txt')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.aliyun:
|
if args.aliyun:
|
||||||
getTargetBucket = args.aliyun.split(".")
|
existDomain = DnsResolution.GetDomainDnsResolution(args.aliyun)
|
||||||
aliyunOss.CheckBucket(getTargetBucket[0], getTargetBucket[1])
|
if existDomain:
|
||||||
|
aliyunOss.CheckBucket(existDomain.split(".")[0], existDomain.split(".")[1])
|
||||||
|
else:
|
||||||
|
getTargetBucket = args.aliyun.split(".")
|
||||||
|
aliyunOss.CheckBucket(getTargetBucket[0], getTargetBucket[1])
|
||||||
if args.file:
|
if args.file:
|
||||||
with open(args.file, 'r') as f:
|
with open(args.file, 'r') as f:
|
||||||
for i in f.read().splitlines():
|
for i in f.read().splitlines():
|
||||||
getTargetBucket = i.split(".")
|
existDomain = DnsResolution.GetDomainDnsResolution(i)
|
||||||
aliyunOss.CheckBucket(getTargetBucket[0], getTargetBucket[1])
|
if existDomain:
|
||||||
|
aliyunOss.CheckBucket(existDomain.split(".")[0], existDomain.split(".")[1])
|
||||||
|
else:
|
||||||
|
getTargetBucket = i.split(".")
|
||||||
|
aliyunOss.CheckBucket(getTargetBucket[0], getTargetBucket[1])
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
logger.error("KeyError Out")
|
logger.error("KeyError Out")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user