# HackTheBox-BountyHunter
## NMAP
```bash
PORT STATE SERVICE REASON VERSION
22/tcp open ssh syn-ack ttl 63 OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
80/tcp open http syn-ack ttl 63 Apache httpd 2.4.41 ((Ubuntu))
|_http-favicon: Unknown favicon MD5: 556F31ACD686989B1AFCF382C05846AA
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Bounty Hunters
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
```
## PORT 80 (HTTP)
We can see this is just an html being used on the webserver , going to portal it says that it's under development
Which takes us to Bounty reporting system
But when we submit details to the reporting system it just doesn't get saved
So here let's try to run `gobuster` and fuzz for files and directories
We can't visit `/assets` as it's forbidden for us
Checking the `/resources` folder we do see some files
From `README.txt` it seems that reporting system isn't connected to database also it says about disabling the test account maybe we can login somewhere but for now I don't think there's a login page.
Moving on and checking the the `bountylog.js` we can see a url which points to `tracker_diRbPr00f314.php`
So let's use `burp suite` and try intercepting that reporting system to see if it's actually sending data somewhere
This is making a POST request to that page and sending the data as base64 encoded
So this means here we need to do what is called `XXE(XML Xternal Entity)`, what XXE basically allows us to read local files like `/etc/passwd` and sensitive files like php file's source code that the browser doesn't reveal we can steal some information that can be either passwords or some sensitive data . An application that parses XML input . we can add a variable which is called `Entity` that we define inside a `DTD` which is Document Type Definiation which looks like this
```xml
```
The DOCTYPE declaration is where we declare elements, attributes, entities, and notations.
So in DTD we define an entity
```xml
```
This is an external Entity as we are accessing something which isn't declared in the current xml and they are defined with `SYSTEM` keyword
If we combine this together it will look like this
```xml
]>
```
Now in this scenario our xml input looks like this
```xml