> ## Documentation Index
> Fetch the complete documentation index at: https://rootea.es/llms.txt
> Use this file to discover all available pages before exploring further.

# Nightmare

> Verified writeups for the Nightmare machine of Hack The Box

# Nightmare

<p className="machine-summary"><span className="prompt"><code>\$ tldr</code></span> OpenSSH SFTP misconfig → command injection → Ubuntu Xenial kernel</p>

<div className="machine-meta">
  | ·                | ·                                                                                                                                                                                                                                                                                                                                |
  | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Operating system | Linux                                                                                                                                                                                                                                                                                                                            |
  | Difficulty       | Insane                                                                                                                                                                                                                                                                                                                           |
  | Vector           | <span className="vbadge vbadge-web">Web</span>                                                                                                                                                                                                                                                                                   |
  | IP               | `10.10.10.66`                                                                                                                                                                                                                                                                                                                    |
  | Retirement date  | —                                                                                                                                                                                                                                                                                                                                |
  | Skills           | HTML Injection XSS Injection SQL Injection (SQLI) - Error Based OpenSSH \<= 6.6 SFTP misconfiguration universal exploit (RCE) Script Modification Binary Analysis \[GHIDRA/Radare2] In-depth analysis with Radare2 \[Tips and tricks] Command Injection - User Pivoting Ubuntu Xenial Privilege Escalation - Kernel Exploitation |
</div>

## Writeups

| Language | Author      | Format | Link                                                |
| -------- | ----------- | ------ | --------------------------------------------------- |
| 🇪🇸 ES  | **S4vitar** | Vídeo  | [Open](https://www.youtube.com/watch?v=nBDnCjRxmO8) |
| 🇬🇧 EN  | **IppSec**  | Vídeo  | [Open](https://www.youtube.com/watch?v=frh-jYaUvrU) |

## Skill resources

Curated documentation for each technique listed in the *Skills* column above. Sources: HackTricks, GTFOBins, PortSwigger, etc.

| Skill                       | Source      | Link                                                                                       |
| --------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| OS Command Injection        | PortSwigger | [Open](https://portswigger.net/web-security/os-command-injection)                          |
| SQL Injection               | HackTricks  | [Open](https://book.hacktricks.wiki/en/pentesting-web/sql-injection/index.html)            |
| SQL Injection               | PortSwigger | [Open](https://portswigger.net/web-security/sql-injection)                                 |
| Port Forwarding / Pivoting  | HackTricks  | [Open](https://book.hacktricks.wiki/en/generic-hacking/tunneling-and-port-forwarding.html) |
| Remote Code Execution (RCE) | HackTricks  | [Open](https://book.hacktricks.wiki/en/pentesting-web/command-injection.html)              |
| Cross-Site Scripting (XSS)  | HackTricks  | [Open](https://book.hacktricks.wiki/en/pentesting-web/xss-cross-site-scripting/index.html) |
| Cross-Site Scripting (XSS)  | PortSwigger | [Open](https://portswigger.net/web-security/cross-site-scripting)                          |

## Related skills worth mastering

Local File Inclusion (LFI) · Remote File Inclusion (RFI) · Shellshock (CVE-2014-6271) · Server-Side Request Forgery

## If you liked this machine, try

* [Holiday](/en/htb/machines/linux/dificil/holiday) — Linux, Hard
* [ScriptKiddie](/en/htb/machines/linux/facil/scriptkiddie) — Linux, Easy
* [Union](/en/htb/machines/linux/medio/union) — Linux, Medium
* [Toolbox](/en/htb/machines/windows/facil/toolbox) — Windows, Easy
* [Oz](/en/htb/machines/linux/dificil/oz) — Linux, Hard

***

## Comments & tips

Did the official writeup not work? Found a smarter trick? Share it here — comments live in [GitHub Discussions](https://github.com/FFuson/HTB_Writeups/discussions).

<div className="rootea-giscus-wrap" data-giscus-term="machine:nightmare" data-giscus-lang="en" />

*Last updated: 2026-07-20*

<script type="application/ld+json">
  {`{"@context":"https://schema.org","@type":"TechArticle","headline":"Nightmare — HTB Writeup Index","name":"Nightmare","url":"https://rootea.es/en/htb/machines/linux/insano/nightmare","inLanguage":"en","datePublished":"2026-07-20","dateModified":"2026-07-20","about":{"@type":"Thing","name":"Hack The Box (HTB)"},"keywords":"OS Command Injection, SQL Injection, SQL Injection, Port Forwarding / Pivoting, Remote Code Execution (RCE), Cross-Site Scripting (XSS), Cross-Site Scripting (XSS)","isPartOf":{"@type":"WebSite","name":"rootea.es","url":"https://rootea.es"},"author":{"@type":"Organization","name":"rootea.es"},"proficiencyLevel":"Insano"}`}
</script>

<script type="application/ld+json">
  {`{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://rootea.es/en"},{"@type":"ListItem","position":2,"name":"Linux","item":"https://rootea.es/en/htb/machines/linux/insano/index"},{"@type":"ListItem","position":3,"name":"Insane","item":"https://rootea.es/en/htb/machines/linux/insano/index"},{"@type":"ListItem","position":4,"name":"Nightmare","item":"https://rootea.es/en/htb/machines/linux/insano/nightmare"}]}`}
</script>
