Clocky
Time is an illusion.
Recon
Let's sstart with a nmap scan
From the nmap scan we can see port 80 and 8000 gives forbidden. Visiting these ports will also give you a 403 forbidden. However we can see robots.txt is available on port 8000.
We can visit that and get our first flag.

We also get a disallow list for the extensions sql, zip, bak.
Feroxbuster revealed index.zip. Downloading it and unzipping it gave us 2 files app.py and flag2.txt.
We have our 2nd flag.

Port 8080 was accessible and we are met with a page that tells the time.

Since this room is based on time and the current time displayed on the page seems to be in London Time Zone.
Feroxbuster search on port 8080 revealed some directories:
and mainly a login page. i.e: /administrator. It also reveals /dashboard but that just redirects to /administrator.
Having a closer look at app.py we find an interesting block of code.
This code essentially checks if a username exists in the database, and if it does, it generates a token based on the current timestamp and the username, hashes it using SHA-1 and updates the corresponding token in the database. This process is typically used for generating and updating password reset tokens.
We can use this to make a small script that will generate the token for the username Administrator for us.
It is important to first use the forgot password page and then generate token at roughly the same time.
We can now access the password reset page for Administrator:
http://clocky.thm:8080/password_reset?token="Generated_Token"

We can see in the above image that the token we generated worked and we have successfully reset the password. We've also got our 3rd flag.

The page also has an input for location. Upon entering something it downloads a file. From app.py we know that there is an SQL database on localhost. Directly entering http://localhost/database.sql will download a file but the file will show a forbidden 403.
We need to do some URL bypass. The below link has a list of possible payloads we can use.
The above payload worked and we got a file which gave us Flag 4 and some other details.

Initial Access
We have a password for some user. From app.py we know found users Jane and Clarice.
The password worked for Clarice and we were able to SSH in and get Flag 5.
In the app folder we can view .env for another password.

We can use this password to login into mysql.

We can find few databases and some tables. We can also find the forgot password token.
The database mysql has alot of tables and the user table shows some users and hash. They seem to be poorly formated. Fortunately we can fix that and then use hash cat to obtain some passwords.

The below commad gives us a nice format to view the username and hash.

Privilege Escalation
We have obtained 5 hashes. Let us use hashcat to crack the hash and obtain the password for the user dev.

We can use this password to get root access and obtain the final flag.

Last updated
Was this helpful?