Skip to content

Commit 861867f

Browse files
committedDec 9, 2020
weblogic_password.rb add aes256 support
1 parent 016fe27 commit 861867f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎crypto/weblogic_password.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
WEBLOGIC_MASTER_KEY = '0xccb97558940b82637c8bec3c770f86fa3a391a56'
1111
#RE = %r'([^>]+?)<\/[^>]+?>\s+?<[^>]+?>\{(AES|3DES)\}(.+?)<\/'
12-
RE = %r'([^>\s]+?)(?:<\/[^>]+?>\s+)+?<[^>]+?>\{(AES|3DES)\}(.+?)<\/'
13-
CipherRE = %r'()\{(AES|3DES)\}(.+?)$'
12+
RE = %r'([^>\s]+?)(?:<\/[^>]+?>\s+)+?<[^>]+?>\{(AES|AES256|3DES)\}(.+?)<\/'
13+
CipherRE = %r'()\{(AES|AES256|3DES)\}(.+?)$'
1414

1515

1616
class SerializedSystemIni < BinData::Record
@@ -104,6 +104,8 @@ def weblogic_decrypt(ini_file, accounts)
104104
case algo
105105
when 'AES'
106106
decrypt('aes-128-cbc', secret_key, data[0,16], data[16..-1])
107+
when 'AES256'
108+
decrypt('aes-256-cbc', secret_key, data[0,16], data[16..-1])
107109
when '3DES'
108110
decrypt('des3', secret_key, salt[0,4] * 2, data)
109111
end

0 commit comments

Comments
 (0)
Please sign in to comment.