# Lookup

Per risolvere questa challenge dobbiamo ottenere due flag:

* User flag
* Root flag

## Enumeration

Partiamo con la fase di enumeration

```bash
$ nmap -sV -sC <IP>

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 21:d4:44:b1:43:e3:a2:ca:51:b6:2f:dd:5a:ff:45:98 (RSA)
|   256 51:57:da:91:fd:9c:38:ec:24:b2:21:d7:f5:e0:cf:69 (ECDSA)
|_  256 68:dc:d7:0b:94:e6:c4:d1:62:ca:8b:a1:c2:d1:e9:6d (ED25519)
80/tcp open  http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Rick is sup4r cool
|_http-server-header: Apache/2.4.41 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
```

Let's check port 80 on our browser.

<figure><img src="/files/PbnyS685RLI4p7bD7ksc" alt=""><figcaption><p>Source code for the page</p></figcaption></figure>

{% code overflow="wrap" %}

```bash
ffuf -u http://lookup.thm/login.php -X POST -d "username=admin&password=FUZZ" -w /home/kali/Documents/Hacking_stuff/SecLists/Passwords/xato-net-10-million-passwords-1000000.txt -H "Content-Type: application/x-www-form-urlencoded" -fs 62 
________________________________________________

password123    [Status: 200, Size: 74, Words: 10, Lines: 1, Duration: 66ms]

```

{% endcode %}

La risposta è diversa in dimensione ma se proviamo ad inserire la combinazione admin:password123 viene restituito nuovamente errore in fase di login.

Questo potrebbe suggerire che forse abbiamo trovato la password giusta ma per lo username sbagliato.


---

# 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://lorenzo-bruno7.gitbook.io/lorenzo-bruno/tryhackme/quickstart/writeups/lookup.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.
