Jan 07, 2024, 10:50 AM
|
Bizness - HTB
by paven - Saturday January 6, 2024 at 01:03 PM
|
(Jan 07, 2024, 10:45 AM)0xfd9aac Wrote:(Jan 07, 2024, 10:41 AM)AZUR Wrote:(Jan 07, 2024, 10:28 AM)peRd1 Wrote:(Jan 07, 2024, 10:25 AM)R3DEY3 Wrote: Still slightly confused about decrypting the hash, specifically the hashcat command I have the full hash, converted it to hex and trying to figure out the salt etc. Am I missing something or am I just stupid?The salt is there in its initial form. Just need to use that right as it is. The hash needs to be reconverted to hex, then cracked. bro im 14 i can't fucking read java and i was trying other privesc
Jan 07, 2024, 10:53 AM
(Jan 07, 2024, 10:41 AM)AZUR Wrote:(Jan 07, 2024, 10:28 AM)peRd1 Wrote:(Jan 07, 2024, 10:25 AM)R3DEY3 Wrote: Still slightly confused about decrypting the hash, specifically the hashcat command I have the full hash, converted it to hex and trying to figure out the salt etc. Am I missing something or am I just stupid?The salt is there in its initial form. Just need to use that right as it is. The hash needs to be reconverted to hex, then cracked. This is the code I used to crack the password since python do not support SHA like in java it is referred as sha1 in python import hashlib import base64 import os def cryptBytes(hash_type, salt, value): if not hash_type: hash_type = "SHA" if not salt: salt = base64.urlsafe_b64encode(os.urandom(16)).decode('utf-8') hash_obj = hashlib.new(hash_type) hash_obj.update(salt.encode('utf-8')) hash_obj.update(value) hashed_bytes = hash_obj.digest() result = f"${hash_type}${salt}${base64.urlsafe_b64encode(hashed_bytes).decode('utf-8').replace('+', '.')}" return result def getCryptedBytes(hash_type, salt, value): try: hash_obj = hashlib.new(hash_type) hash_obj.update(salt.encode('utf-8')) hash_obj.update(value) hashed_bytes = hash_obj.digest() return base64.urlsafe_b64encode(hashed_bytes).decode('utf-8').replace('+', '.') except hashlib.NoSuchAlgorithmException as e: raise Exception(f"Error while computing hash of type {hash_type}: {e}") hash_type = "SHA1" salt = "d" search = "$SHA1$d$uP0_QaVBpDWFeo8-dRzDqRwXQ2I=" wordlist = '/usr/share/wordlists/rockyou.txt' with open(wordlist,'r',encoding='latin-1') as password_list: for password in password_list: value = password.strip() hashed_password = cryptBytes(hash_type, salt, value.encode('utf-8')) # print(hashed_password) if hashed_password == search: print(f'Found Password:{value}, hash:{hashed_password}')
Jan 07, 2024, 11:22 AM
(Jan 07, 2024, 10:53 AM)Kli Wrote:(Jan 07, 2024, 10:41 AM)AZUR Wrote:(Jan 07, 2024, 10:28 AM)peRd1 Wrote:(Jan 07, 2024, 10:25 AM)R3DEY3 Wrote: Still slightly confused about decrypting the hash, specifically the hashcat command I have the full hash, converted it to hex and trying to figure out the salt etc. Am I missing something or am I just stupid?The salt is there in its initial form. Just need to use that right as it is. The hash needs to be reconverted to hex, then cracked. This worked, although I'm confused on how you would do this using cyberchef + hashcat. Any step by step guide?
Jan 07, 2024, 02:28 PM
Thanks for the clarification guys
Jan 07, 2024, 04:34 PM
Jan 07, 2024, 04:53 PM
(Jan 07, 2024, 11:22 AM)haventdiedyet Wrote:(Jan 07, 2024, 10:53 AM)Kli Wrote:(Jan 07, 2024, 10:41 AM)AZUR Wrote:(Jan 07, 2024, 10:28 AM)peRd1 Wrote:(Jan 07, 2024, 10:25 AM)R3DEY3 Wrote: Still slightly confused about decrypting the hash, specifically the hashcat command I have the full hash, converted it to hex and trying to figure out the salt etc. Am I missing something or am I just stupid?The salt is there in its initial form. Just need to use that right as it is. The hash needs to be reconverted to hex, then cracked. this is a trick with base64.urlsafe_b64encode(). it replaces / by _ and + by - , thus the b64 is invalid and the hash length is not 40. Hashcat mode is 120. this one cracks just fine : b8fd3f41a541a435857a8f3e751cc3a91c174362:d
Jan 08, 2024, 03:15 AM
(Jan 07, 2024, 10:41 AM)AZUR Wrote:The hash format is $SHA$salt$xxxx, concealed within this hash, where the salt is 'd'.(Jan 07, 2024, 10:28 AM)peRd1 Wrote:(Jan 07, 2024, 10:25 AM)R3DEY3 Wrote: Still slightly confused about decrypting the hash, specifically the hashcat command I have the full hash, converted it to hex and trying to figure out the salt etc. Am I missing something or am I just stupid?The salt is there in its initial form. Just need to use that right as it is. The hash needs to be reconverted to hex, then cracked.
Jan 09, 2024, 05:04 PM
To everyone who is searching for password. here is some hint. <logo><machine> no spaces. This is a big and only hint you need if you force your mind to see what is present in front of your eyes.
Happy Rooting!!!!
Jan 10, 2024, 07:00 AM
Imagine there was no hint, this box wouldn't be called easy.
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| [FREE] 300+ Writeups PDF HackTheBox/HTB premium retired | 376 | 93,783 |
2 hours ago Last Post: Sukon |
||
| [FREE] CPTS • CWES • CDSA • CWEE Exam Hint | 233 | 32,357 |
2 hours ago Last Post: Sukon |
||
| [FREE] CPTS 12 FLAGS | 74 | 2,380 |
2 hours ago Last Post: Sukon |
||
| [MEGALEAK] HackTheBox ProLabs, Fortress, Endgame - Alchemy, 250 Flags, leak htb-bot | 89 | 8,103 |
7 hours ago Last Post: Xploitd |
||
|
|
[FREE] HackTheBox All Cheatsheets | 10 | 633 |
11 hours ago Last Post: chufoni |
|