@@ -378,6 +378,16 @@ def _encode64(value, count):
378378
379379 return "%s%s$%s" % (magic , salt , hash_ )
380380
381+ def joomla_passwd (password , salt , ** kwargs ):
382+ """
383+ Reference: https://stackoverflow.com/a/10428239
384+
385+ >>> joomla_passwd(password='testpass', salt='WZGO7gQEl1UHHKeT7mN9n1VNtHj7xhC')
386+ 'd5875f832ce9d83c21a14075019d3d24:WZGO7gQEl1UHHKeT7mN9n1VNtHj7xhC'
387+ """
388+
389+ return "%s:%s" % (md5 ("%s%s" % (password , salt )).hexdigest (), salt )
390+
381391def wordpress_passwd (password , salt , count , prefix , ** kwargs ):
382392 """
383393 Reference(s):
@@ -448,6 +458,7 @@ def _encode64(input_, count):
448458 HASH .SHA384_GENERIC : sha384_generic_passwd ,
449459 HASH .SHA512_GENERIC : sha512_generic_passwd ,
450460 HASH .CRYPT_GENERIC : crypt_generic_passwd ,
461+ HASH .JOOMLA : joomla_passwd ,
451462 HASH .WORDPRESS : wordpress_passwd ,
452463 HASH .APACHE_MD5_CRYPT : unix_md5_passwd ,
453464 HASH .UNIX_MD5_CRYPT : unix_md5_passwd ,
@@ -796,7 +807,7 @@ def dictionaryAttack(attack_dict):
796807 if re .match (hash_regex , hash_ ):
797808 item = None
798809
799- if hash_regex not in (HASH .CRYPT_GENERIC , HASH .WORDPRESS , HASH .UNIX_MD5_CRYPT , HASH .APACHE_MD5_CRYPT , HASH .APACHE_SHA1 ):
810+ if hash_regex not in (HASH .CRYPT_GENERIC , HASH .JOOMLA , HASH . WORDPRESS , HASH .UNIX_MD5_CRYPT , HASH .APACHE_MD5_CRYPT , HASH .APACHE_SHA1 ):
800811 hash_ = hash_ .lower ()
801812
802813 if hash_regex in (HASH .MYSQL , HASH .MYSQL_OLD , HASH .MD5_GENERIC , HASH .SHA1_GENERIC , HASH .APACHE_SHA1 ):
@@ -811,6 +822,8 @@ def dictionaryAttack(attack_dict):
811822 item = [(user , hash_ ), {'salt' : hash_ [0 :2 ]}]
812823 elif hash_regex in (HASH .UNIX_MD5_CRYPT , HASH .APACHE_MD5_CRYPT ):
813824 item = [(user , hash_ ), {'salt' : hash_ .split ('$' )[2 ], 'magic' : '$%s$' % hash_ .split ('$' )[1 ]}]
825+ elif hash_regex in (HASH .JOOMLA ,):
826+ item = [(user , hash_ ), {'salt' : hash_ .split (':' )[- 1 ]}]
814827 elif hash_regex in (HASH .WORDPRESS ,):
815828 if ITOA64 .index (hash_ [3 ]) < 32 :
816829 item = [(user , hash_ ), {'salt' : hash_ [4 :12 ], 'count' : 1 << ITOA64 .index (hash_ [3 ]), 'prefix' : hash_ [:12 ]}]
0 commit comments