Last active
March 2, 2018 09:45
-
-
Save foobarbaz-pl/88ac2cdb08beb569ab205eb238363ba9 to your computer and use it in GitHub Desktop.
Decode PL/SQL Developer Preference File Passwords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
c_gr_len constant pls_integer := 4; | |
l_enc varchar2(100) := '&encoded_pwd'; | |
l_dec varchar2(100); | |
l_key number; | |
l_val number; | |
l_mask number; | |
l_chars pls_integer; | |
begin | |
l_chars := length(l_enc) / 4 - 1; | |
l_key := to_number(substr(l_enc, | |
1, | |
c_gr_len)); | |
for l_i in 1 .. l_chars | |
loop | |
l_val := to_number(substr(l_enc, | |
l_i * 4 + 1, | |
c_gr_len)) - 1000; | |
l_mask := l_key + (10 * (l_i)); | |
l_dec := l_dec || chr(((l_val + l_mask) - BitAND(l_val, | |
l_mask) * 2) / 16); | |
end loop; | |
dbms_output.put_line(l_dec); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Passwords can be found in the following locations:
Script is based on Adam Caudill & Brandon Wilson research. https://adamcaudill.com/2016/02/02/plsql-developer-nonexistent-encryption/