> For the complete documentation index, see [llms.txt](https://faresbltagy.gitbook.io/footprintinglabs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://faresbltagy.gitbook.io/footprintinglabs/footprinting-labs/lab-medium.md).

# Lab - Medium

## Let us commence 🚀

## Lab - Medium

First, we'll begin with reconnaissance to identify open ports.

<figure><img src="/files/P4sxjgU0BrOzvHPaXzxL" alt=""><figcaption><p>nmap scan</p></figcaption></figure>

After conducting the nmap scan, we've discovered several open ports. Let's now proceed to examine and engage with each one.

Port 2049 is accessible; let's explore the NFS server to discover potential opportunities.

**NFS** is a system designed for **client/server** that enables users to seamlessly access files over a network as though these files were located within a local directory.

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

Here, I attempted to enumerate available shares using "showmount" and discovered the directory named "TechSupport". Let's explore its contents.

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

I discovered several tickets, most of which were empty except for one. Let's examine its contents."

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

I discovered an email containing credentials for a user named 'Alex' along with the corresponding Operator. Let's attempt to establish a connection via the RDP server to explore further possibilities.

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

I have gained access to the target via RDP using Remmina. Feel free to utilize any tool of your preference. Let's explore the possibilities.

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

I conducted enumeration on the target and discovered a file titled "important.txt" within a directory labeled "devshare," yielding credentials for a user named "sa".&#x20;

Upon gaining access to the target through RDP, I found a Microsoft SQL Server. Let's attempt to access it using the credentials we've obtained.

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

When attempting to access the Microsoft SQL Server with the provided credentials, an error occurred, preventing successful login. Let's now attempt to access the Microsoft SQL Server with administrative privileges.

<figure><img src="/files/gl7BO1769x8cHPIokNmG" alt=""><figcaption><p>Right Click + Run as administrator</p></figcaption></figure>

I initiated the Microsoft SQL Server application by right-clicking and selecting 'Run as Administrator.' Upon entering the password and confirming with 'Yes,' the application successfully launched, allowing me to establish a connection.

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

Let's proceed to generate a new query to retrieve the password for the user "HTB."

<figure><img src="/files/M7Cfao6jGDp52pPQQWpD" alt=""><figcaption><p>SELECT * FROM accounts.dbo.devsacc where name = 'HTB'</p></figcaption></figure>

We have successfully obtained the password for the user 'HTB' and completed the lab. Thank you for taking the time to read this write-up


---

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

```
GET https://faresbltagy.gitbook.io/footprintinglabs/footprinting-labs/lab-medium.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.
