Changes in Oracle Database 12c Password Hashes - Trustwave - SpiderLabs - Trustwave
Changes in Oracle Database 12c Password Hashes - Trustwave - SpiderLabs - Trustwave
us/)
SpiderLabs Blog
Attracting more than a half-million annual readers, this is the
security community's go-to destination for technical breakdowns
of the latest threats, critical vulnerability disclosures and cutting-
edge research.
share
(https://twitter.com/share?
(https://www.linkedin.com/shareArticle?
(https://www.facebook.com/sharer/sharer.php
Oracle has made improvements to user password hashes
url=https://www.trustwave.com/en-
within Oraclemini=true&url=https://www.trustwave.com/en-
u=https://www.trustwave.com/en-
Database 12c. By using a PBKDF2-based
SHA512 hashing algorithm, instead of simple SHA1 hash,
us/resources/blogs/spiderlabs-
us/resources/blogs/spiderlabs-
us/resources/blogs/spiderlabs-
password hashing is more secure. With this post, I'll explain
blog/changes-
blog/changes-
blog/changes-
some of the changes and their security implications.
in- in- in-
With Oracle Database 11g, the spare4 column from the
oracle- oracle- oracle-
sys.user$ table stores user password hashes.
database-
database-
database-
This is an example of the sys.user$.spare4 entry for user
12c- 12c- 12c-
' demo ' with password ' epsilon ' (pluggable database):
password-
password-
password-
S:8F2D65FB5547B71C8DA3760F10960428CD307B1C6271691FC55C1
hashes/&text=Changes
hashes/&title=Changes
hashes/)
F56554A;H:DC9894A01797D91D92ECA1DA66242209;T:23D1F8CAC9
in in
001F69630ED2DD8DF67DD3BE5C470B5EA97B622F757FE102D8BF14B
We use cookies to provide you a relevant user experience, analyze our traffic, and provide social
Oracle Oracle GOT IT
media features. Privacy Policy (https://www.trustwave.com/en-us/legal-documents/privacy-policy/)
EDC94A3CC046D10858D885DB656DC0CBF899A79CD8C76B788744844
Database
Database
CADE54EEEB4FDEC478FB7C7CBFBBAC57BA3EF22C
12c
12c
Step-by-step:
password
password
hashes+-
hashes)
SQL> create user demo identified by epsilon;
+Trustwave)
User created.
SPARE4
-------------------------------------------------------
-------------------------
S:8F2D65FB5547B71C8DA3760F10960428CD307B1C6271691FC55C1
F56554A;H:DC9894A01797D91D92ECA1DA66242209;T:23D1F8CAC9
001F69630ED2DD8DF67DD3BE5C470B5EA97B622F757FE102D8BF14B
EDC94A3CC046D10858D885DB656DC0CBF899A79CD8C76B788744844
CADE54EEEB4FDEC478FB7C7CBFBBAC57BA3EF22C
PASSWORD
-------------------------------------------------------
-------------------------
2B7983437FE9FEB6
The spare4 column's value has three parts (" S: ", " H: ", and
" T: ") separated by semicolons.
8F2D65FB5547B71C8DA3760F10960428CD307B1C6271691FC55C1F5
DC9894A01797D91D92ECA1DA66242209
23D1F8CAC9001F69630ED2DD8DF67DD3BE5C470B5EA97B622F757FE
102D8BF14BEDC94A3CC046D10858D885DB656DC0CBF899A79CD8C76
B788744844CADE54EEEB4FDEC478FB7C7CBFBBAC57BA3EF22C
The S part
bytes))
(Visit http://marcel.vandewaters.nl/oracle/security/password-
hashes
(http://marcel.vandewaters.nl/oracle/security/password-
hashes)for more detail.)
hash is 8F2D65FB5547B71C8DA3760F10960428CD307B1C
salt is 6271691FC55C1F56554A
import hashlib
sha1 = hashlib.sha1()
sha1.update("epsilon")
sha1.update('\x62\x71\x69\x1f\xc5\x5c\x1f\x56\x55\x4a'
)
We use cookies to provide you a relevant user experience, analyze our traffic, and provide social
sha1.hexdigest().upper()
media features. Privacy Policy (https://www.trustwave.com/en-us/legal-documents/privacy-policy/)
That calculation produces:
The H part
import hashlib
m = hashlib.md5()
m.update('DEMO:XDB:epsilon')
m.hexdigest().upper()
'DC9894A01797D91D92ECA1DA66242209'
# sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 12a
H:DC9894A01797D91D92ECA1DA66242209;T:E3243B98974159CC24
FD2C9A8B30BA62E0E83B6CA2FC7C55177C3A7F82602E3BDD17CEB9B
9091CF9DAD672B8BE961A9EAC4D344BDBA878EDC5DCB5899F689EBD
8DD1BE3F67BFF9813A464382381AB36B
Note that the spare4 value no longer has the S: part, only
the H: and T: components are there.
5F 56 46 52 5F 44 41 54-41 20 00 00 00 20 38 44
_VFR_DATA.....8D
44 31 42 45 33 46 36 37-42 46 46 39 38 31 33 41
D1BE3F67BFF9813A
34 36 34 33 38 32 33 38-31 41 42 33 36 42 15 48
464382381AB36B.H
E3243B98974159CC24FD2C9A8B30BA62E0E83B6CA2FC7C55177C3A7
F82602E3BDD17CEB9B9091CF9DAD672B8BE961A9EAC4D344BDBA878
AUTH_PBKDF2_SPEEDY_KEY
t.update(key_64bytes)
We use cookies to provide you a relevant user experience, analyze our traffic, and provide social
media features. Privacy Policy (https://www.trustwave.com/en-us/legal-documents/privacy-policy/)
t.update(AUTH_VFR_DATA)
t.hexdigest().upper() # First 64 bytes of spare4.T:
value if password is correct
This produces:
E3243B98974159CC24FD2C9A8B30BA62E0E83B6CA2FC7C55177C3A7
F82602E3BDD17CEB9B9091CF9DAD672B8BE961A9EAC4D344BDBA878
EDC5DCB5899F689EBD
Summing up
We use cookies to provide you a relevant user experience, analyze our traffic, and provide social
media features. Privacy Policy (https://www.trustwave.com/en-us/legal-documents/privacy-policy/)
(/en- (/en-
us/resources/blogs/spiderlabs- us/resources/blogs/spiderlabs-
blog/playdate-with-bots- blog/unc-path-injection-with-
microsoft-sql-honeypots/) microsoft-access/)
English
(https://www.linkedin.com/company/trustwave)
(https://twitter.com/Trustwave)
(https://www.facebook.com/Trustwave/)
(https://www.youtube.com/channel/UC2CCq
Fv83NOdjhqA)
We use cookies to provide you a relevant user experience, analyze our traffic, and provide social
media features. Privacy Policy (https://www.trustwave.com/en-us/legal-documents/privacy-policy/)
Leadership Team (/en-us/company/about-us/leadership/)
Our History (/en-us/company/about-us/our-history/)
Careers (https://jobs.jobvite.com/trustwave)
Contact (/en-us/company/contact/)
Support (/en-us/company/support/)
Legal (/en-us/legal-documents/)
Terms of Use (/en-us/legal-documents/terms-of-use/)
Privacy Policy (/en-us/legal-documents/privacy-policy/)
Copyright © 2022 Trustwave Holdings, Inc. All rights reserved.
We use cookies to provide you a relevant user experience, analyze our traffic, and provide social
media features. Privacy Policy (https://www.trustwave.com/en-us/legal-documents/privacy-policy/)