Giter Site home page Giter Site logo

htb_bountyhunter's Introduction

HTB_BountyHunter

Hello everyone, here we will consider the solution of the BountyHunter machine, which can be found on the special platform Hack The Box. Well, below is a description of the machine itself and its specific parameters, including the ip-address. изображение

Machine solution (GET USER)

  1. First you need to go to the site itself and study it carefully. We have a rather primitive service that can provide information about vulnerabilities. But the trouble is, the service does not work correctly, or rather, the functionality of providing data on vulnerabilities does not work. Screenshot from 2021-10-19 18-29-33 AND BUG Service Screenshot from 2021-10-19 18-30-23
  2. Well, now you need to do some exploration and see what this site is fraught with.

To begin with, you can use the nmap tool, you need to find out which ports are open (look outside) and analyze the overall picture of the service structure

~$ nmap -Pn -A 10.10.11.100

Screenshot from 2021-10-19 18-41-06

The fact that ports 22 and 80 are open is good news, as an option for the future it is possible to brute force port 22 of ssh, but this is a bad idea. I think it's better to find ssh credentials information somewhere...

Now I want to look diffrent possible paths which include this service And I'm going to use dirsearch tool, which you can easily find on github - https://github.com/maurosoria/dirsearch

~$ ./dirsearch.py -u 10.10.11.100

That's what i get btw:

Screenshot from 2021-10-19 18-52-09

There are a couple of interesting local files here, db.php is empty, but we find something interesting in the README ...

Screenshot from 2021-10-19 18-56-46

  1. We have collected some information for a more successful injection on the server. Well, what interested me the most was the submit.php path. I decided to use Burp Suite to intercept and modify server requests. How example i tried look on this page:

I gues we can find here xml

Screenshot from 2021-10-21 00-19-01

Next step is to research Bounty Report System:

I push POST request on the server and get this Responce

Screenshot from 2021-10-21 00-25-42

Data is base64 encoded xml, the next step I am convinced of this

изображение

  1. Now we need to figure out how to exploit the xxe vulnerability associated with the injection of additional parameters into the xml, which the server will then return to us.

    For more information about XXE look here:

    And so, I tried to implement DOCTYPE foo ENTITY for / etc / passwd. I could not successfully run xxe through Burp Suite, so I decided to use the developer's console in the browser. But in any case, I suggest that you try to write your own xxe and remember to encode the xml in base64, then add new data, send a request and see what the server will give you. In my case, I used pure xml code and return secret (btoa (xml))

    Screenshot from 2021-10-20 10-42-08

I find here user development maybe he will be usefull in future

Here I used xxe to locally connect to the db.php file...

Screenshot from 2021-10-20 10-44-41

Well done! We find xml data in base64. Only what we need just decrypt and look on it!

  1. Decrypt our Data. Here is some very interesting information

Screenshot_1

I tried to connect server by 22 ssh port using bounty and admin names but it didn't work. Then I remembered about development user and entering password from xml data

Screenshot from 2021-10-21 01-18-33

~$ cat user.txt  

We have out user flag, well done!

htb_bountyhunter's People

Contributors

sakyra01 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.