Weblogic更改、破解、重置密码

1.更改密码

1.1 在浏览器输入:http://ip:7001/console,打开之后输入用户名和密码,登录到weblogic控制台,并按下面执行:
1.2 登录进来之后点击安全领域-myrealm 

1.3 找到用户和组-选择weblogic用户

1.4 点击口令,并输入新的密码之后点击保存

1.5 在weblogic控制台页面改了密码之后,还需要登录服务器修改每一个serve(包括adminserver)boot.properties文件内的密码,然后重启服务,文件内容会自动加密。

2.破解密码

如果忘记weblogic的登陆密码,可以通过下边操作进行破解密码

2.1 对于解决weblogic控制台账号重置的方法是利用解密脚本:wlsdecrypt.py对boot.properties进行反编译。(创建一个wlsdecrypt.py文件)
#Jython script for displaying de-cryted WebLogic boo.properties files
# to run,change to a weblogic domain directory and execute

import os
from java.io import FileInputStream
from java.util import Properties
from weblogic.management import EncryptionHelper
from weblogic.security.service import SecurityManager
from weblogic.security.subject import SubjectManager

##################################################
# Main
##################################################
def main():
#	for arg in sys.argv:
#		if arg.count(arg.strip()):
#			printUsageAndExit()
	saltFilePath=os.path.join('security','SerializedSystemIni.dat')
	if not os.path.exists(saltFilePath):
		print "Error: The Script must be run from a weblogic domain directory or a directory containing '%s'" % saltFilePath
		printUsageAndExit()
	try:
		open(saltFilePath,'r').close()
	except IOError:
		print "Error: The file '%s' is not readable - check file permissions " % saltFilePath
		printUsageAndExit()
	processBootFiles(os.curdir,descryptPropsFile)
	
#
#Decrypt (Note,to encrypt just use:EncryptionHelper.encrypt(text))
#
def decrypt(text):
	getKernelIdMethod = SecurityManager.getDeclaredMethod('getKernelIdentity',None)
	getKernelIdMethod.accessible=1
	return EncryptionHelper.decrypt(text,getKernelIdMethod.invoke(SecurityManager,None))

#
#process boot files
#
def processBootFiles(rootPath,processFunc):
	if not os.path.isdir(rootPath):
		return
	fileNames = os.listdir(rootPath)
	for fileName in fileNames:
		path = os.path.join(rootPath,fileName)
	if os.path.isfile(path):
		if fileName == 'boot.properties':
			processFunc(path)
		elif os.path.isdir(path):
			processBootFiles(path,processFunc)
	processFunc("./boot.properties")

#
#Decrypt Props File
#
def descryptPropsFile(filepath):
	print 
	print '-------Decrypting %s ------' % filepath
	try:
		properties = Properties()
		file = FileInputStream(filepath)
		properties.load(file)
		file.close()
		for entry in properties.entrySet():
			print '%s = %s' %(entry.key.strip(),java.lang.String(decrypt(entry.value.strip())))
	except IOError:
		print "Error : Unable to read file '%s' ---check file permissions" %filepath
		print


###################################
#print usage and exit
###################################
def printUsageAndExit():
	print 
	print 'wlsdecrypt.py'
	print '-------------'
	print 
	print "Jython script for displaying de-cryptde boot.properties files from a weblogic domian.before running the script ,change directory to the directory that contains a weblogic domain "
	print 
	print 'Example Usage'


#
#invoke main
#
main()
2.2 将该脚本放置domain下,复制一份server下的boot.properties到domain下,在domain下执行:

11g

{WLS_HOME}/wlserver_10.3/common/bin/wlst.sh  wlsdecrypt.py

12c

{WLS_HOME}/oracle_common/common/bin/wlst.sh  wlsdecrypt.py

3.重置密码

3.1 备份DefaultAuthenticatorInit.ldift

cd  {DOMAIN_HOME}/security

mv  DefaultAuthenticatorInit.ldift  DefaultAuthenticatorInit.ldift.bak

3.2 生成DefaultAuthenticatorInit.ldift文件

11g

 cd  DOMAIN_HOME/security

JAVA_HOME/bin/java - cp  {WLS_HOME}/wlserver_10.3/server/lib/weblogic.jar weblogic.security.utils.AdminAccount weblogic weblogic123 . (注意:命令的末尾有一个句号,句号前有一个空格weblogic是用户、weblogic123是密码

12c

 cd  DOMAIN_HOME/security

JAVA_HOME/bin/java - cp  {WLS_HOME}/wlserver/server/lib/weblogic.jar weblogic.security.utils.AdminAccount weblogic weblogic123 . (注意:命令的末尾有一个句号,句号前有一个空格weblogic是用户、weblogic123是密码

3.3 删除 {DOMAIN_HOME}/servers/AdminServer/data/ldap/该文件夹,原有用户全部丢失(注意备份)
3.4 修改{DOMAIN_HOME}/servers/AdminServer/security/boot.properties 用户密码信息(注意备份)
3.5 重启验证
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

运维小白菜

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值