{"id":327,"date":"2011-02-02T08:00:57","date_gmt":"2011-02-02T08:00:57","guid":{"rendered":"http:\/\/www.oradba.ch\/?p=327"},"modified":"2014-05-16T07:37:18","modified_gmt":"2014-05-16T05:37:18","slug":"case-sensitive-passwords-and-strong-user-authentication-2","status":"publish","type":"post","link":"https:\/\/www.oradba.ch\/wordpress\/2011\/02\/case-sensitive-passwords-and-strong-user-authentication-2\/","title":{"rendered":"Case Sensitive Passwords and Strong User Authentication"},"content":{"rendered":"<p>With 11g R1 Oracle introduced case sensitive passwords for database accounts based on the SHA1 hash algorithm. This feature can easily be enabled with the init.ora parameter <em>SEC_CASE_SENSITIVE_LOGON<\/em>. As soon as this parameter is set to true, all new passwords will be case sensitive. Existing passwords will remain case insensitive until they are changed.<br \/>\nThe downside of this new feature is, that the passwords are also stored with the pre-11g database password hash. This is a potential security leak. The pre-11g password hash string from <em>USER$<\/em> can be used to crack the case insensitive version of the password. All kind of tools, utilities, password lists etc are available to do this. As soon as the case insensitive version of the password is known, the case sensitive password can be guessed.<\/p>\n<h3>Case Sensitiv Passwords<\/h3>\n<p>First of all lets have a look at the parameter of  an 11g R2 test database.<br \/>\n<code lang=\"sql\"><br \/>\nshow parameter sec_case_sensitive_logon<\/p>\n<p>NAME                      TYPE     VALUE<br \/>\n------------------------- -------- ---------<br \/>\nsec_case_sensitive_logon  boolean  TRUE<br \/>\n<\/code><br \/>\nThe Column <em>PASSWORD_VERSIONS<\/em> in DBA_USERS shows the Database version in which the password was created or changed. The user TEST_10G shows only 10g which means that this user has been created before the database has been migrated to 11g and was never changed.<br \/>\n<code lang=\"sql\"><br \/>\nSELECT username, password_versions<br \/>\nFROM dba_users<br \/>\nWHERE username LIKE 'TEST%';<\/p>\n<p>USERNAME        PASSWORD<br \/>\n--------------- --------<br \/>\nTEST            10G 11G<br \/>\nTEST_11G        10G 11G<br \/>\nTEST_10G        10G<br \/>\n<\/code><br \/>\nThe Password hashes for both the 11g (<em>SPARE4<\/em>) and pre-11g hashes (<em>PASSWORD<\/em>)<br \/>\n<code lang=\"sql\"><br \/>\nset linesize 120<br \/>\ncol name for a10<br \/>\ncol password for a16<br \/>\ncol spare4 for a50<br \/>\nselect name,password,spare4 from user$ where name like 'TEST%';<\/p>\n<p>NAME       PASSWORD         SPARE4<br \/>\n---------- ---------------- --------------------------------------------------<br \/>\nTEST       7A0F2B316C212D67 S:7D5C8604CDF7811E06DAA7C718ADB3684A883CE7521CF5C0<br \/>\n                            66721877D457<br \/>\nTEST_10G   48AFCE9CD794074D<br \/>\nTEST_11G   AE6FC028DF3997FC S:CFD77E59711BC61589C6631C1F824CFC0966972D01599EF6<br \/>\n                            ED1558A2046F<br \/>\n<\/code><br \/>\nAs you can see user TEST and TEST_11G have a pre-11g Hash and the long 11g Hash. The user TEST_10G only have a pre-11g Hash. This indicates that the user has been created before the database was migrated to 11g and the password never has been changed. Therefor the password for this user is case insensitive even when the parameter <em>SEC_CASE_SENSITIVE_LOGON<\/em> is set to true.<\/p>\n<p>To enable or disable case sensitive passwords just alter the init.ora parameter.<br \/>\n<code lang=\"sql\"><br \/>\nalter system set SEC_CASE_SENSITIVE_LOGON=true scope=spfile;<br \/>\nalter system set SEC_CASE_SENSITIVE_LOGON=false scope=spfile;<br \/>\n<\/code><\/p>\n<h3>Increase Security<\/h3>\n<h4>The Idea<\/h4>\n<p>The security can be increase when case sensitive password are used and logon&#8217;s are limited to the 11g authentication protocols. This can be achievement by setting the sqlnet parameter <em>SQLNET.ALLOWED_LOGON_VERSION<\/em> to 11. As soon as this has been done the pre-11g hashes can be removed from USER$. <\/p>\n<p>In detail the following steps are required to enable Oracle Database 11g exclusive mode and increase database security.<\/p>\n<ul>\n<li>Make sure all application&#8217;s and clients are supporting the 11g authentication protocols<\/li>\n<li>After migration \/ database creation enable <em>SEC_CASE_SENSITIVE_LOGON<\/em><\/li>\n<li>Change passwords on all database accounts. A minimum of 10 alphanumeric characters, special characters and mixed case is recommended<\/li>\n<li>Verify and test batch jobs or scripts to make sure the use of mixed chases is consistent<\/li>\n<li>Edit the <em>sqlnet.ora<\/em> parameter file and add the line <em>SQLNET.ALLOWED_LOGON_VERSION=11<\/em> or change it to <em>11<\/em><\/li>\n<li>Remove the old password hash values from <em>USER$<\/em><\/li>\n<\/ul>\n<h4>Remove the old password hash<\/h4>\n<p>To remove the old password hash values it is necessary to perform an update on a SYS table. Therefor a full backup of the database is highly recommended. As soon as you have a complete backup, connect to the Oracle Database with SYSDBA privileges to perform the following update.<br \/>\n<code lang=\"sql\"><br \/>\nupdate sys.user$ set password=NULL;<br \/>\ndelete from user_history$;<br \/>\ncommit;<br \/>\n<\/code><\/p>\n<p>From now the password column will be empty even when new user are created as you can see in the following example.<br \/>\n<code lang=\"sql\"><br \/>\nselect name,password,spare4 from user$ where name like 'TEST%';<br \/>\nNAME\t   PASSWORD\t         SPARE4<br \/>\n---------- ---------------- --------------------------------------------------<br \/>\nTEST\t\t\t            S:4C15788E25102B7B70713D3BD054EF2731E9664CA4FCFD67<br \/>\n\t\t\t                BA224E15C5CA<br \/>\nTEST_10G\t\t\t        S:35547B514FCA0C895259A4CAD1E50A88AFE086B9844ACF97<br \/>\n\t\t\t                A6B9E211490B<br \/>\nTEST_11G\t\t            S:CDE994528EF0CED53917790F412C1CE4280A05E5007CC0E1<br \/>\n\t\t\t                0407337B407<br \/>\ncreate user test_new identified by Test001;<\/p>\n<p>User created.<\/p>\n<p>select name,password,spare4 from user$ where name like 'TEST%';<\/p>\n<p>NAME\t   PASSWORD\t        SPARE4<br \/>\n---------- ---------------- --------------------------------------------------<br \/>\nTEST\t\t                S:4C15788E25102B7B70713D3BD054EF2731E9664CA4FCFD67<br \/>\n\t\t\t                BA224E15C5CA<br \/>\nTEST_10G\t\t            S:35547B514FCA0C895259A4CAD1E50A88AFE086B9844ACF97<br \/>\n\t\t\t                A6B9E211490B<br \/>\nTEST_11G\t\t            S:CDE994528EF0CED53917790F412C1CE4280A05E5007CC0E1<br \/>\n\t\t\t                0407337B407A<br \/>\nTEST_NEW\t\t            S:D4808E96184DE35110A5CDFC83A7C496402147338C77185D<br \/>\n\t\t\t                336748914299<br \/>\n<\/code><\/p>\n<h3>Conclusion<\/h3>\n<p>The sqlnet.ora parameter <em>SQLNET.ALLOWED_LOGON_VERSION<\/em> provides an easy way to increase the overall database password security for 11g environments (Database and Client \/ Applications), but it does not replace a well-defined password policy. If user have simple passwords like username=password they still can easily be guessed. <\/p>\n<h3>Reference<\/h3>\n<p>Metalink Notes related to Case Sensitive Passwords and the Oracle Database 11g Exclusive Mode.<\/p>\n<ul>\n<li><i>11g R1 New Feature: Case Sensitive Passwords and Strong User Authentication <a href=\"https:\/\/support.oracle.com\/CSP\/main\/article?cmd=show&#038;type=NOT&#038;id=429465.1\" target=\"_blank\">[429465.1]<\/a><\/i><\/li>\n<li><i>Instructions for Clearing pre-11g Database Password Hashes <a href=\"https:\/\/support.oracle.com\/CSP\/main\/article?cmd=show&#038;type=NOT&#038;id=463999.1\" target=\"_blank\">[463999.1]<\/a><\/i><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>With 11g R1 Oracle introduced case sensitive passwords for database accounts based on the SHA1 hash algorithm. This feature can easily be enabled with the init.ora parameter SEC_CASE_SENSITIVE_LOGON. As soon as this parameter is set to true, all new passwords will be case sensitive. Existing passwords will remain case insensitive until they are changed.<br \/>\nThe downside of this new feature is, that the passwords are also stored with the pre-11g database password hash. This is a potential security leak. The pre-11g password hash string from USER$ can be used to crack the case insensitive version of the password. All kind of tools, utilities, password lists etc are available to do this. As soon as the case insensitive version of the password is known, the case sensitive password can be guessed.<\/p>\n<p>To get rid of this security leak, the pre-11g database password hashes have to be cleared. This blog post shows how this can be done.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7,8,11],"tags":[18],"class_list":["post-327","post","type-post","status-publish","format-standard","hentry","category-11gr1","category-11gr2","category-security","tag-trivadiscontent"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1aErb-5h","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":7846,"url":"https:\/\/www.oradba.ch\/wordpress\/2020\/12\/security-best-practice-oracle-passwords-but-secure\/","url_meta":{"origin":327,"position":0},"title":"Security Best Practice: Oracle passwords, but secure!","author":"Stefan","date":"1. December 2020","format":false,"excerpt":"Beach view in Brighton at the UKOUG Techfest 2019 Today I held my presentation about Oracle security best practice \"Oracle passwords, but secure!\u201d at the virtual UKOUG event. Unfortunately, this year the beautiful view of Brighton beach and the active exchange with colleagues was missing. Ok, on the other hand\u2026","rel":"","context":"In &quot;12R2&quot;","block_context":{"text":"12R2","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12r2\/"},"img":{"alt_text":"Beach view in Brighton at the UKOUG Techfest 2019","src":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/31507FA5-AAFE-4D85-AB3A-3FF218CA4567.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":2443,"url":"https:\/\/www.oradba.ch\/wordpress\/2017\/11\/doag-2017-oracle-12c-release-2-datenbank-sicherheit-in-a-nutshell\/","url_meta":{"origin":327,"position":1},"title":"DOAG 2017 Oracle 12c Release 2 Datenbank-Sicherheit in a Nutshell","author":"Stefan","date":"24. November 2017","format":false,"excerpt":"Below you will find a list of the different demo scripts used during the DOAG training day 2017 Oracle 12c Release 2 Datenbank-Sicherheit in a Nutshell. In general the script do need a SCOTT or a HR demo schema. Some of the scripts may have more requirements eg. Kerberos configuration,\u2026","rel":"","context":"In &quot;12cR1&quot;","block_context":{"text":"12cR1","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12cr1\/"},"img":{"alt_text":"DOAG Konferenz 2017","src":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/2017-K-A-Banner-800x600_01-300x225.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1836,"url":"https:\/\/www.oradba.ch\/wordpress\/2014\/07\/secure-external-password-store-for-rman\/","url_meta":{"origin":327,"position":2},"title":"Secure External Password Store for RMAN","author":"Stefan","date":"22. July 2014","format":false,"excerpt":"The draft version of this blog post is lying around for some time in my inbox. I've never found time to finish it. But due to a task in a project it's about time to finish my notes on Oracle's Secure External Password Store. Ludovico, a work colleague has already\u2026","rel":"","context":"In &quot;11gR2&quot;","block_context":{"text":"11gR2","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/11gr2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1262,"url":"https:\/\/www.oradba.ch\/wordpress\/2013\/07\/oracle-12c-new-password-verify-function\/","url_meta":{"origin":327,"position":3},"title":"Oracle 12c new password verify function","author":"Stefan","date":"24. July 2013","format":false,"excerpt":"Even with Oracle Database 12c, the quality of the database passwords is not enforced by default. A password verify function with the corresponding password resource limits has to be developed individually. As a basis one can use the script to setup the default password resource limits. The script is provided\u2026","rel":"","context":"In &quot;12cR1&quot;","block_context":{"text":"12cR1","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/12cr1\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8912,"url":"https:\/\/www.oradba.ch\/wordpress\/2021\/11\/notes-on-oracle-password-security\/","url_meta":{"origin":327,"position":4},"title":"Notes on Oracle Password Security","author":"Stefan","date":"11. November 2021","format":false,"excerpt":"This morning I had the great opportunity to participate in the virtual event AUSOUG Connect 2021 with my lecture Security Best Practice: Oracle passwords, but secure!. For me it was a premiere and a pleasure to be part of an Oracle event in Australia. Oracle Password Security is a small\u2026","rel":"","context":"In &quot;Oracle Database&quot;","block_context":{"text":"Oracle Database","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/docker-labenv.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/docker-labenv.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/docker-labenv.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.oradba.ch\/wordpress\/wp-content\/uploads\/docker-labenv.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":711,"url":"https:\/\/www.oradba.ch\/wordpress\/2011\/12\/howto-change-sysman-password-in-12c-cloud-control\/","url_meta":{"origin":327,"position":5},"title":"Howto change SYSMAN password in 12C Cloud Control","author":"Stefan","date":"1. December 2011","format":false,"excerpt":"I was on leave for the past few weeks. After digging through tons of e-mails I finally found time to look into EM 12 Cloud Control. Unfortunately, I've forgotten my SYSMAN password and the EM 12c test installation is no longer running. As you say: \"Holidays where one forgets everything,\u2026","rel":"","context":"In &quot;11gR2&quot;","block_context":{"text":"11gR2","link":"https:\/\/www.oradba.ch\/wordpress\/category\/oracle-database\/11gr2\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/comments?post=327"}],"version-history":[{"count":4,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":1699,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/posts\/327\/revisions\/1699"}],"wp:attachment":[{"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/media?parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/categories?post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oradba.ch\/wordpress\/wp-json\/wp\/v2\/tags?post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}