Files
AngelSword/information/options_method.py
Lucifer1993 cf215699b9 update
2018-10-31 11:40:59 +08:00

38 lines
1.2 KiB
Python
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: options方法开启
referer: unknow
author: Lucifer
description: robots.txt是爬虫标准文件可从文件里找到屏蔽了哪些爬虫搜索的目录
'''
import sys
import requests
import warnings
from termcolor import cprint
class options_method_BaseVerify:
def __init__(self, url):
self.url = url
def run(self):
headers = {
"User-Agent":"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; en-us) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50"
}
vulnurl = self.url
try:
req = requests.options(vulnurl, headers=headers, timeout=10, verify=False)
if r"OPTIONS" in req.headers['Allow']:
cprint("[+]存在options方法开启...(敏感信息)"+"\tpayload: "+vulnurl+"\tAllow:"+req.headers['Allow'], "green")
else:
cprint("[-]不存在options_method漏洞", "white", "on_grey")
except:
cprint("[-] "+__file__+"====>可能不存在漏洞", "cyan")
if __name__ == "__main__":
warnings.filterwarnings("ignore")
testVuln = options_method_BaseVerify(sys.argv[1])
testVuln.run()