Working with Web Services — Linux Fundamentals Module — HTB Walkthrough

The Malware Mender
2 min readJul 30, 2024

--

TIER 0 MODULE: LINUX FUNDAMENTALS

SECTION: Working with Web Service

For this section, you necessarily do not need to connect to the pwnbox.

If you are not registered in HTB Academy, then use this link to register now: https://referral.hackthebox.com/mzxKOJt

1. Find a way to start a simple HTTP server inside Pwnbox or your local VM using “npm”. Submit the command that starts the web server on port 8080 (use the short argument to specify the port number).

First of all, npm is a package manager of NodeJS. When you click on the hint (HTB Academy) it says:

In short, it is not required to install npm in this case (it assumes that it is already installed). Or if not use the command:

sudo apt install node-http-server

Once installed, check it’s manual page, then run the command and specify the port with -p flag.

Answer: http-server -p 8080

2. Find a way to start a simple HTTP server inside Pwnbox or your local VM using “php”. Submit the command that starts the web server on the localhost (127.0.0.1) on port 8080.

We can see the manual page, of php.

According to this manual page, we can start a webserver with syntax php -S addr:port.

So the required IP and port is 127.0.0.1 and port is 8080.

Answer: php -S 127.0.0.1:8080

Still stuck? Watch video!

☣️ HAPPY ETHICAL HACKING ☣️

DISCLAIMER: THIS CONTENT DOES NOT BELONG TO ME, I AM JUST WRITING A WALK-THROUGH OF A FREE MODULE OF HACK THE BOX ACADEMY. (WRITING WALKTHROUGHS OF FREE MODULES IS PERMITTED BY HTB ACADEMY)

The Malware Mender Walkthroughs

--

--

The Malware Mender
The Malware Mender

No responses yet