> For the complete documentation index, see [llms.txt](https://cybersec.th4ntis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cybersec.th4ntis.com/hackthebox/starting-point/tier-1/bike.md).

# Bike

## Initial Scan

```nmap
sudo nmap -T4 -Pn -sV -sC -v 10.129.245.220 -oA Bike
```

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2Flh8JoXJroZj4O38UK1M7%2Fimage.png?alt=media&amp;token=adea7260-5675-48e4-9aed-9908ce28cc8a" alt=""><figcaption></figcaption></figure>

## Task 1

What TCP ports does nmap identify as open? Answer with a list of ports seperated by commas with no spaces, from low to high. - Found in the initial Scan

Answer: 22,80

## Task 2

What software is running the service listening on the http/web port identified in the first question? - Also found in the initial scan

Answer: Node.js

## Task 3

What is the name of the Web Framework according to [Wappalyzer](https://www.wappalyzer.com/)? - Using Wappalyzer we can see.&#x20;

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FX2Fpk86PpW2vfSVcqfBn%2Fimage.png?alt=media&amp;token=a86dd9a9-43d7-46d4-a00f-9bb3bc9b94ec" alt=""><figcaption></figcaption></figure>

Answer: Express

## Task 4

What is the name of the vulnerability we test for by submitting {{7\*7}}? - Node.js servers often use a software called a Template Engine. Looking into vulnerabilities we see a common one.

Answer: Server side template injection

## Task 5

What is the templating engine being used within Node.JS?

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FMQziUhyJGzaiU3hRkOHe%2Fimage.png?alt=media&amp;token=70f5a2b2-fa2e-48b5-a5a5-df8756322620" alt=""><figcaption></figcaption></figure>

Answer: Handlebars

## Task 6

What is the name of the BurpSuite tab used to encode text?

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FU5qwMKvupXm90TubQv4d%2Fimage.png?alt=media&amp;token=1dcee365-80a4-42b6-a642-d03559ecce27" alt=""><figcaption></figcaption></figure>

Answer: Decoder

## Task 7

In order to send special characters in our payload in an HTTP request, we'll encode the payload. What type of encoding do we use?

Answer: URL

## Task 8

When we use [a payload from HackTricks](https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection#handlebars-nodejs) to try to run system commands, we get an error back. What is "not defined" in the response error?

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FV4rPmNvHfU6yCn0HgQkK%2Fimage.png?alt=media&amp;token=2c2d7a41-9d19-404e-96c5-0691418cdc43" alt=""><figcaption></figcaption></figure>

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FtR4NNV5RXJuK1Y6Ypuvp%2Fimage.png?alt=media&amp;token=e63509ee-8bee-440e-9ef2-788b08f9ea40" alt=""><figcaption></figcaption></figure>

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FL17BjlqwAMTTq1UefwG3%2Fimage.png?alt=media&amp;token=777f75c9-a024-47cc-b764-82be903a651f" alt=""><figcaption></figcaption></figure>

Answer: require

## Task 9

What variable is the name of the top-level scope in Node.JS?

Answer: Global

## Task 10

By exploiting this vulnerability, we get command execution as the user that the webserver is running as. What is the name of that user?

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FFJYMAZeotity0VabOOKV%2Fimage.png?alt=media&amp;token=1a7afa88-a329-4689-9887-840576ea19b0" alt=""><figcaption></figcaption></figure>

Answer: root

## Task 11

<figure><img src="https://667808901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTdW22AGCceN8oUXfdlKI%2Fuploads%2FWPsEnUcJGYynnsHUUqV6%2Fimage.png?alt=media&amp;token=ab60e21c-87c0-4fe8-9e44-df323a47ebb6" alt=""><figcaption></figcaption></figure>

Answer: 6b258d726d287462d60c103d0142a81c
