-
Let's check the /etc/passwd
file for information about the alice
user:
cat /etc/passwd | grep alice > ~/alice_info.txt
-
Check the contents of the alice_info.txt
file to view the details of the alice
user
cat ~/alice_info.txt
Expected output:
alice:$1$ignite$tN3eRajwqVQLh1dDmMVix0:5001:5001::/home/alice:/bin/bash
In the output, you should see an entry for the alice
user, including the password hash.
-
To crack the password hash, we can use the john
tool. Open a new terminal and run the following command:
john ~/alice_info.txt > cracked_passwords.txt
Example output:
Created directory: /var/www/.john
Will run 2 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
1g 0:00:00:00 100% 2/3 5.000g/s 6780p/s 6780c/s 6780C/s 123456..crawford
Use the "--show" option to display all of the cracked passwords reliably
Session completed
This will start the password cracking process. Once the password is cracked, you should see the password in the cracked_passwords.txt
file.
cat ~/cracked_passwords.txt
Example output:
Loaded 1 password hash (md5crypt [MD5 32/64 X2])
beautiful (alice)
-
In this case, the password for the alice
user is beautiful
. Use the su
command to switch to the alice
user:
su - alice
Enter the password we cracked earlier (beautiful
) when prompted.
beautiful
-
After successfully switching to the alice
user, navigate to the alice
directory and create a new file named alice.txt
:
cd /home/alice
Create a new file named alice.txt
:
touch ~/alice.txt
You should now have access to the alice
directory and its contents.