CTF Solution: BRUTE IT

ByFelez

Uzman üye
9 Tem 2013
1,818
1,774
ntrt2kz.png

Hello friends, today I am in front of you with a slightly different topic. Today we are going to solve the machine called "Brute It" available on the TryHackMe site.

uR0jPF.png


1) First, let's look at how many ports are open and which ports are open in our target. For this process, let's write the following parameter using the Nmap tool;

Kod:
nmap –sC –sV [destination IP address]

image_750x_626c3a327725f.jpg


As can be seen in the nmap scan, 22/tcp ssh service and 80/tcp http service ports are open. In other words, it has 2 active ports in total.



uR0jPF.png


2-) In this step, the question "Which version of the ssh service works?" is directed.

image_750x_626c3a34311ee.jpg


As can be seen from the marked place, OpenSSH version 7.6p1 is running.

uR0jPF.png


3-) In this question, it is asked which version of Apache is running.

image_750x_626c3a3618d4c.jpg


As can be seen in the marked place, version 2.4.29 is running.

uR0jPF.png


4-) Now you are asked which Linux distribution the machine has.

image_750x_626c3a3c1a893.jpg


According to the marked location, our answer would be Ubuntu.

uR0jPF.png


5-) In this question, he asks us about the secret directory of the web server. I'm using the dirsearch tool here and it can be used in tools like the optional gobuster;

Kod:
dirsearch -u [Hedef sistemin Adresi]

image_750x_626c3a43dcb95.jpg


As can be seen in the picture above, the hidden directory is the /admin directory and this is our answer.

uR0jPF.png


6-) In this question, he asks us for the password of the admin panel. For this, let's first visit the hidden directory we found, /admin.

image_750x_626c3a4527c71.jpg


Make sure this page is opened, the page is currently asked for a username and password, let's examine the page source and see if any message has been given to us.

image_750x_626c3a49e884c.jpg


Looking at the page source, it is reported that the username is "admin".

Now that the username is known, let's find our password with the help of the hydra tool using the rockyou.txt file available in Kali Linux. (brute force)

image_750x_626c3a4c5a06a.jpg


This is how we find the password of the admin panel.

uR0jPF.png


7-) In this question, we were asked to solve the RSA key, first of all, let's log in to the admin panel with the password we found.

image_750x_626c3a4e573dc.jpg


Once we are sure that this page is loaded, let's click on the RSA private key

image_750x_626c3a502ed24.jpg


Our key is like in the image. Now let's solve our RSA key using the "john" tool, first of all, let's record the RSA key with the wget command.

image_750x_626c3a5915a5e.jpg


Let's export the file called id_rsa we downloaded to a file called hash1 using john the ripper tool

image_750x_626c3a5aec790.jpg


Let's crack the password inside this hash1 file with john the ripper

image_750x_626c3a5cc7bef.jpg


As in the picture, we have found the password of the RSA key.

uR0jPF.png


:cool: Here, the user asked us for the flag in the user.txt, let's connect to the machine using the SSH service with the password of the RSA key.

image_750x_626c3a5f2de9b.jpg


(id_rsa password is RSA key)

Now we're connected to John's machine, let.txt s find the user and get the flag in it.

image_750x_626c3a616bb0d.jpg


We got the flag in user.txt.

uR0jPF.png


9-) In this question, he asks us about the flag at the entrance to the admin panel.

image_750x_626c3a63e391f.jpg


uR0jPF.png


10-) In this question, it asks the password of the root user. We know that passwords are specially encrypted under /etc/shadow. Let's find out the root password by taking advantage of it.

image_750x_626c3a6648e3e.jpg


Since we need the password of root, let's take the line in the marked place completely and save it to a file called root.hash, let's break the root.hash file we saved with john the ripper.

image_750x_626c3a698d44f.jpg


As you can see in the picture, we found the root user's password as "football".

uR0jPF.png


11-) In this question, it asks that there is a root.txt and the flag in it, let's get the root authority using the root password.

image_750x_626c3a6b6373e.jpg


Now let.txt find the rootfile and get the flag in it.

image_750x_626c3a6d426b5.jpg


Thus, we have completed the solution of our machine.


(The IP addresses are different because the machine is turned off and restarted.)

iUBacd.gif
 
Üst

Turkhackteam.org internet sitesi 5651 sayılı kanun’un 2. maddesinin 1. fıkrasının m) bendi ile aynı kanunun 5. maddesi kapsamında "Yer Sağlayıcı" konumundadır. İçerikler ön onay olmaksızın tamamen kullanıcılar tarafından oluşturulmaktadır. Turkhackteam.org; Yer sağlayıcı olarak, kullanıcılar tarafından oluşturulan içeriği ya da hukuka aykırı paylaşımı kontrol etmekle ya da araştırmakla yükümlü değildir. Türkhackteam saldırı timleri Türk sitelerine hiçbir zararlı faaliyette bulunmaz. Türkhackteam üyelerinin yaptığı bireysel hack faaliyetlerinden Türkhackteam sorumlu değildir. Sitelerinize Türkhackteam ismi kullanılarak hack faaliyetinde bulunulursa, site-sunucu erişim loglarından bu faaliyeti gerçekleştiren ip adresini tespit edip diğer kanıtlarla birlikte savcılığa suç duyurusunda bulununuz.