
Questo exploit è stato sviluppato durante un'attività di penetration test contro Oracle OAM 11.1.2.3.0. È stato sviluppato sulla base della descrizione tecnica di sec-consult
https://www.sec-consult.com/en/blog/2018/05/oracle-access-managers-identity-crisis/
L'exploit dipende da python-paddingoracle; può essere scaricato da qui
https://github.com/mwielgoszewski/python-paddingoracle
# python oracle-oam-exploit.py -h
####### # # # #######
# # # # ## ## # # # ##### # #### # #####
# # # # # # # # # # # # # # # # # #
# # # # # # # ##### ## # # # # # # #
# # ####### # # # ## ##### # # # # #
# # # # # # # # # # # # # # #
####### # # # # ####### # # # ###### #### # #
Oracle Padding Oracle
coded by: Mostafa Soliman
usage: oracle-oam-exploit.py [-h] [-e ENCRYPT] [-d DECRYPT] [-v] URL
positional arguments:
URL Target resource URL
optional arguments:
-h, --help show this help message and exit
-e ENCRYPT, --encrypt ENCRYPT
Encrypt plain text data
-d DECRYPT, --decrypt DECRYPT
Decrypt base64 encode cipher text
-v, --verb Show decrypt block info
L'exploit riceve l'URL della risorsa che richiede l'autenticazione Oracle OAM. Esegue i seguenti passaggi:
Il pentester può specificare qualsiasi valore cifrato (encquery, encreplay, cookie) che desidera decifrare usando il flag -d.
Il pentester può specificare qualsiasi valore in chiaro che desidera cifrare usando il flag -e.
Eseguendo il reverse engineering dell'SDK Oracle OAM possiamo vedere che il cookie è composto dalla seguente struttura:
Salt= ACL= AuthId= Ip= TCT= SessionId= userId= validate=BASE64Encode(MD5(Salt+AuthId+Ip+ACL+TCT+SessionId))
Quindi, per costruire un cookie, ottieni un cookie valido in chiaro usando il flag -d, modificalo e poi cifralo di nuovo usando -e.
