Hack the Box - MarketDump Challenge - Walkthrough

Introduction

Today we're going to be doing a CTF challenge walkthrough of the MarketDump challenge hosted at https://app.hackthebox.eu/challenges/66 . For this walkthrough, we'll be using a Kali Linux virtual machine as our attacking system. The challenge's description is as follows:

CHALLENGE DESCRIPTION

We have got informed that a hacker managed to get into our internal network after pivoiting through the web platform that runs in public internet. He managed to bypass our small product stocks logging platform and then he got our costumer database file. We believe that only one of our costumers was targeted. Can you find out who the customer was?

Initial Information and Clues

The downloaded file that accompanies this challenge is a file named MarketDump.zip, which is password protected (password = hackthebox). After unzipping the file, we find that the file in question is called MarketDump.pcapng, which we can analyze using Wireshark.

But before we open the file in Wireshark, we should review our information and figure out what kind of information we're looking for:

The challenge description states that the hacker got into the network through the public internet, which means we are looking for http packets. The description also references a costumer (sp?) database file, which means we're on the lookout for filenames in the traffic that refer to the strings “costumer”, or file extensions like ".db" or “.sql”.

With that in mind, we start up Wireshark:

start Wireshark
File -> Open -> MarketDump.pcapng



From here, we'll filter by http packets:


And then we'll attempt to find any string that contains “costumer”:

Ctrl+F to open the search bar
search string “costumer”


This looks like a pretty good place to start. We'll follow this packet's TCP stream:

Right-click on the packet -> Follow -> TCP Stream



It looks like we're on the right track. We should note the number of this stream, in case we need to reference it later.

If we scroll through the data in this window, eventually we find this:


This looks like it could be encrypted. We use the popular decrypting website, CyberChef, to see if it can figure out which encryption method it might be:

https://gchq.github.io/CyberChef/#recipe=Magic(3,false,false,'')&input=TlZDaWpGN242cGVNN2E3eUxZUFpyUGdIbVdVSGk5N0xDQXpYeFNFVXJhS21l


It turns out the string was encrypted using Base58, and our flag is this:

HTB{DonTRuNAsRoOt!MESsEdUpMarket}

Extra Credit

If we want to finding out the extent of the commands the hacker used to while inside the system, we can go back to our original TCP stream 1059, then back up a few entries to stream 1056, where the hacker gains their initial access to the web-host:


Summary

The challenge requires us to search through a pcap file in order to identify which customer's data was stolen. Within Wireshark, we were able to filter out non-http traffic, then searched for packets with the “costomer” string, leading us to a TCP stream which included an encrypted string. Using a webservice, we were able to decrypt the string and receive our flag.

Finish

Comments

Popular posts from this blog

TryHackMe - Windows PrivEsc - Walkthrough

TryHackMe - Reversing Elf - Walkthrough

TryHackMe - Web Enumeration - Walkthrough