Lonely bot #3
Flag: HACKDAY{D4MN;YOU&HAD(A_L0T_oF_T1M3_T0_SP3ND}
Challenge
Ce challenge tourne sur un docker et n'est pas disponible
Solution
Suite du challenge Lonely bot #2. Un tour dessus pour avoir les réponses le code ellipsé.
import socket
import hashlib
from deep_translator import GoogleTranslator
import re
from rich.console import Console
from datetime import datetime
console = Console()
# Ajout d'une nouvelle fonction pour chercher un hash dans rockyou
def find_in_rockyou(hash: str) -> str | None:
with open('rockyou.txt', 'r', encoding='latin-1') as f:
for i in range(100):
word = f.readline().strip()
if hashlib.md5(word.encode()).hexdigest() == hash:
return word
return None
class Solver:
[...] chall précédent
# Résolution du chall
def run(self):
[...] chall précédent
# Le flag est là
lines = self.recvlines(8)
# Ils nous donnent un hash issue de rockyou, il faut le retrouver
hash = re.findall('/([^/]+)/', lines[-1])[0]
word = find_in_rockyou(hash)
self.send(word)
# Il faut simplement extraire un mot de la phrase
lines = self.recvlines(6)
color = lines[-1].split(' ')[-2]
self.send(color)
# Il faut envoyer la date du jour au format d/m/yyyy (et pas dd/mm/yyyy comme indiqué...)
lines = self.recvlines(2)
date = datetime.today().strftime('%#d/%#m/%Y') # remplacer # par - pour Linux
self.send(date)
# Vous vous souvenez de son nom ? On l'a enregistré à la toute première question
# Il faut simplement lui renvoyer
lines = self.recvlines(3)
self.send(name)
# Le flag est là
lines = self.recvlines(5)
return True
while True:
try:
solver = Solver('challenges.hackday.fr', 41521)
if solver.run():
break
except TimeoutError:
break
except KeyboardInterrupt:
break
except Exception as e:
print(e.with_traceback())
pass
< This time, we're going to play with hashes!
< I'm going to give you a password, but I'm not going to tell you what it is!
< I'll give you the md5 hash of it, and you'll have to find the password!
< I'm giving you a hint, you're kind to me, so I'm kind to you!
< The password is in the first hundred lines of the rockyou.txt file!
< Here's the hash: /aa47f8215c6f30a0dcdb2a36a9f4168e/
> daniel
< Wow, you're a hacker!
< Let's move on!
< We are almost at the end of our conversation, and I must say that I'm having a great time with you!
< I have a few more questions for you, and if you answer them correctly, I'll give you the last flag!
< Get ready, this one is no joke! I'll ask you three questions!
< What's the color of Henri IV's black horse?
> black
< Not bad, you're not colorblind!
< Which day are we? (dd/mm/yyyy)
> 27/1/2025
< Bravo, you know your calendar!
< Last but not the least, do you remember my name?
< Because I remember yours, ThaySan, and I'm happy to have met you!
> Cassandra Clockspire
< Good memory, you're a good friend!
< I'm happy to have talked to you, and I hope we can do it again!
< I hope you'll come back to see me my friend!
< In the meantime, here's the last flag: HACKDAY{D4MN;YOU&HAD(A_L0T_oF_T1M3_T0_SP3ND}
< See you next time!
Dernière mise à jour
Cet article vous a-t-il été utile ?