Skip to main content
  1. Posts/

Armaxis

·2 mins
S3N
Author
S3N
Embrace The Unseen
Table of Contents
Machine Info
PlatformHackTheBox
CategoryWeb
DifficultyVery Easy

In this challenge we have two available ports:

  • The first one it’s the Web itself
  • The second one it’s a mail Inbox, used to receive password change tokens

Our mail is test@email.htb.

First Vulnerability - Insecure Direct Object Reference
#

We are able to change the password of the admin account. This is made by requesting a password change token and using it against the admin account. The admin account is hardcoded in the given code, as we can see:

armaxis1

Let’s register the an account with test@email.htb and request a token to change the password.

armaxis2

Let’s catch the reset-password request with Burp

armaxis3

There is no validation in the email field in correlation with the requested token, so we can change the password of a privileged account.

armaxis4

Login as a privileged user allows us to use a new function called Dispatch Weapon. Let’s see how we can abuse this.

This form is made to add weapons to a list.

armaxis8

Second Vulnerability - Local File Inclusion via Markdown / HTML Injection
#

The vulnerability resides in this line in the markdown.js file, which executes a command with the input of the url variable without any sanitization:

armaxis9

Abusing markdown, we can curl inside the server to fetch files like the flag.txt. We could also leverage this to HTML Injection, as <> tags are interpreted.

armaxis5

The flag will be embeded in the HTML and will not actually display in the content in the chart. All we have to do is click the link and open the plain-text flag.

armaxis6

There we go!

armaxis7