Assignment 2
Assignment 2
Name:Indraja Ushakumari
This room is intended to further the understanding of basic Linux command line
skills for beginners.This new room on Linux is all about how to use commands
like find, mv, scp, less, grep etc. Also, a great way of learning about how to
generate hash (md4, md5, sha1, sha256) and crack the passwords from hashes
using JohnTheRipper tool. Moreover, it also covers encryption and decryption
using gpg files where one can crack gpg encrypted files. It also focuses on
base64 string encoding and decoding.Lastly, it includes basics of reading SQL
databases in Linux.
------------------------------------------------------------------------------------------------------------
Ans: -group
3) What is the format for finding a file with the user named Francis and with a
size of 52 kilobytes in the directory /home/francis/ ?
Ans: 2019-10-11
Explanation :
5) Type: less [filename] to open the file. Then, before anything, type / before
typing: keyword followed by [ENTER]. Notice how that allowed us to search for
the first instance of that word in the entire document. For much larger documents
this can be useful and if there are many more instances of that word in the
document, we would be able to hit enter again to find the next instance in the
document.
Ans: ttitor
Explanation :
This question is related to the previous one where we are supposed to use less
command : less 2019-10-11 to view the file and search for the keyword by typing
/keyword and press [ENTER].
Ans: Flag{81726350827fe53g}
Explanation :
Use cat command to view the contents of that file it will tell you to find a directory
named ‘telephone numbers’.
This directory contains a file named ‘readME.txt’, that hints to find another file
with modified data. This could be done with the following command
We can use the less command to view and navigate to the flag.
1)Hypothetically, you find yourself in a directory with many files and want to move
all these files to the directory of /home/francis/logs. What is the correct command
to do this?
Ans: mv * /home/francis/logs
2)Hypothetically, you want to transfer a file from your /home/james/Desktop/ with
the name script.py to the remote machine (192.168.10.5) directory of
/home/john/scripts using the username of john. What would be the full command
to do this?
4)How would you copy the file named encryption keys to the directory of
/home/john/logs?
5)Find a file named readME_hint.txt inside topson's directory and read it. Using
the instructions it gives you, get the second flag.
Ans: Flag{234@i4s87u5hbn$3}
Explanation :
The file instructs to move the MoveMe.txt file to the march folder and then
execute a bash program to reveal the second flag.
We can see that there is a -MoveMe.txt and -march folder in our current directory
and we need to do as instructed using the following command
Now we need to execute the bash file inside march folder directory using
./-runMe.sh command and we will get the second flag.
TASK 4- Hashing Introduction
1)Download the hash file attached to this task and attempt to crack the MD5
hash. What is the password?
Ans : secret123
Explanation :
Download the file hash.txt.Copy the contents of the file and use
hash-identifier.Hash-identifier will check the hash-type of file contents.
The most possible type turns out to be md5. We can use crackstation to decrypt
the hash.
2)SSH as sarah using: sarah@[MACHINE_IP] and use the password:
rainbowtree1230x
Ans : md4
Explanation :
Again use hash-identifier to identify the hash type after logging as sarah.
The most possible hash type was md4.
Ans : admin
Explanation :
Ans : sha-1
Explanation :
Again use hash-identifier to identify the hash type after logging as sarah.
The most possible hash type was sha1.
5)Find a wordlist with the file extention of '.mnf' and use it to crack the hash with
the filename hashC.txt. What is the password?
Ans: unacvaolipatnuggi
Explanation :
first, find the file hashC.txt
Now we have both the hash and the wordlist which we will be using instead of
rockyou.txt and cracking the password, since this machine does not have john
installed we need those files inside our own machine. We can use the python
server for this purpose and then apply the following john command.
Ans: letmein
Explanation :
1) What is the name of the tool which allows us to decode base64 strings?
Ans : base64
Ans : john
Explanation :
Once you find the file, you’ll see that there’s a hash inside the file, copy the hash
and paste it to https://crackstation.net/ to get the final answer.
1) You wish to encrypt a file called history_logs.txt using the AES-128 scheme.
What is the full command to do this?
Ans : Flag{B07$f854f5ghg4s37}
Explanation :
gpg layer4.txt
it will prompt for passphrase, entering bob as passphrase will decrypt the file now
cat the file
It will lead you to find layer3.txt and decrypting it using passphrase james
find the file and decrypt it via the same steps we just did for layer4.txt
This leads to layer1.txt with the passphrase hacked. We then get our final flag by
decrypting layer1.txt.
TASK 7- Cracking encrypted gpg files
Ans : valamanezivonia
Explanation :
Now use the john tool to decrypt the hash using the wordlist.
Explanation :
After getting the password, simply run gpg personal.txt.gpg and enter the
passphrase valamanezivonia will successfully decrypt the file, use cat to open
the file to view the contents.
TASK 8- Reading SQL databases
1)Find a file called employees.sql and read the SQL database. (Sarah and
Sameer can log both into mysql using the password: password). Find the flag
contained in one of the tables. What is the flag?
Ans : Flag{13490AB8}
Explanation :
find the file employees.sql and go inside the directory where employees.sql
resides
run the command to open mysql:
mysql -u sarah -p
-u is used for user and -p will prompt for the password, enter the password
password will log you in to the mysql console
source employees.sql
use the employees database, for this, enter the command use employees;
It gives us a field for the first_name which we can use to search if Lobel is there
or not, for this, use the following command:
Ans : thegreatestpasswordever000
Explanation :
After reading the first chat we know that we need to find the next chat related to
sameer. Use grep command to find the chat in that directory.
Ans : ebqattle
Explanation :
3) Find the SSH password of the user James. What is the password?
Ans : vuimaxcullings
Explanation :
Michael said the backup file should be name with 2020–08–13, which will be in
/home/shared/”sql directory”
Now decrypt the file using the wordlist and then unzip the file.
cd into the file and notice that it has employees.sql database file, lets open mysql
as sarah and use the following commands:
Ans : Flag{6$8$hyJSJ3KDJ3881}
Explanation :
After logging in as james simply give a sudo su followed by james’ password you
will get root access.The root flag will be in the root directory.