To use HackTricks offline, you can either run a local Docker instance of the entire wiki or mirror the site using command-line tools. Running a local copy is generally preferred as it preserves the structure and search functionality better than a standard mirror. Option 1: Run HackTricks Locally (Docker)
This is the most reliable way to have a fully functional offline copy using mdbook.
Run Docker: Execute the command to pull and run the containerized HackTricks instance, allowing several minutes for the build process. Access: Visit http://localhost:3337 in your browser. Option 2: Mirroring with Wget
Create a static, offline HTML version using wget, which is useful for long-term storage without containers.
Command: wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://book.hacktricks.xyz/. Option 3: Official PDF/Ebook Copies The project occasionally releases PDF copies.
Check the HackTricks GitHub Issues or their Sponsor Page for information on obtaining official offline PDF/Ebook versions.
Method to read the material offline (ebook or PDF) #60 - GitHub
HackTricks Offline allows you to access the massive HackTricks knowledge base without an internet connection, which is essential for or pentesting in restricted environments. How to Get HackTricks Offline hacktricks offline
There are three primary ways to store the book for offline use: Official PDF & EPUB Versions The author, Carlos Polop , often provides downloadable formats. HackTricks GitHub Releases for generated PDF or EPUB files.
Note: These may occasionally be behind the live web version due to the frequency of updates. Using GitBook's Native Export
Since HackTricks is hosted on GitBook, you can use specialized tools to "scrape" or clone the documentation: Clone the Repo git clone https://github.com View Locally : Navigate to the directory and use a Markdown viewer (like ) to browse the
files directly. This is often the most reliable method as it preserves the folder structure. Browser-Based "Save for Offline" SingleFile Extension SingleFile
browser extension to save specific high-value pages as self-contained HTML files.
: A classic tool to "mirror" the entire site. Be cautious with this, as modern documentation sites like GitBook use dynamic loading which can make traditional crawling difficult. Recommended Setup for Pentesters For the best experience during an engagement: Clone the GitHub repository to your local machine. Use Obsidian to open the folder as a "Vault." This gives you a searchable, offline interface
with functional internal links and code snippets that are easy to copy-paste into your terminal. To use HackTricks offline , you can either
I'll help you create a portable, offline HTML document that bundles the most essential HackTricks cheatsheets for pentesting and CTFs. This is a self-contained file you can save and use without internet.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>HackTricks Offline - Pentesting Cheatsheet</title> <style> * margin: 0; padding: 0; box-sizing: border-box; body font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #0a0e17; color: #c9d1d9; line-height: 1.6; .container display: flex; max-width: 1400px; margin: 0 auto; .sidebar width: 280px; background: #0d1117; height: 100vh; position: sticky; top: 0; overflow-y: auto; border-right: 1px solid #30363d; padding: 20px 0; .sidebar h2 padding: 0 20px 15px; font-size: 1.2rem; color: #f0883e; border-bottom: 1px solid #30363d; margin-bottom: 15px; .sidebar ul list-style: none; .sidebar li margin: 5px 0; .sidebar a display: block; padding: 8px 20px; color: #8b949e; text-decoration: none; transition: all 0.2s; font-size: 0.9rem; .sidebar a:hover, .sidebar a.active background: #21262d; color: #f0883e; border-left: 3px solid #f0883e; padding-left: 17px; .content flex: 1; padding: 30px 40px; overflow-y: auto; max-height: 100vh; h1 color: #f0883e; margin-bottom: 10px; font-size: 2rem; .sub color: #8b949e; margin-bottom: 30px; border-bottom: 1px solid #30363d; padding-bottom: 15px; h2 color: #79c0ff; margin: 25px 0 15px 0; padding-bottom: 5px; border-bottom: 1px solid #30363d; h3 color: #d2a8ff; margin: 20px 0 10px 0; pre background: #161b22; padding: 15px; border-radius: 6px; overflow-x: auto; margin: 15px 0; border: 1px solid #30363d; font-size: 0.85rem; font-family: 'Courier New', monospace; code font-family: 'Courier New', monospace; background: #161b22; padding: 2px 5px; border-radius: 4px; font-size: 0.85rem; color: #ffa657; .note background: #1e2417; border-left: 4px solid #3fb950; padding: 12px 15px; margin: 15px 0; border-radius: 4px; .warning background: #2d1f1f; border-left: 4px solid #f85149; padding: 12px 15px; margin: 15px 0; border-radius: 4px; table width: 100%; border-collapse: collapse; margin: 15px 0; th, td border: 1px solid #30363d; padding: 8px 12px; text-align: left; th background: #21262d; @media (max-width: 800px) .sidebar display: none; .content padding: 20px; </style> </head> <body> <div class="container"> <div class="sidebar"> <h2>📚 HackTricks Offline</h2> <ul> <li><a href="#recon" class="active">🔍 Reconnaissance</a></li> <li><a href="#linux">🐧 Linux Privilege Escalation</a></li> <li><a href="#windows">🪟 Windows Privilege Escalation</a></li> <li><a href="#web">🌐 Web Pentesting</a></li> <li><a href="#reverse">🔄 Reverse Shells</a></li> <li><a href="#transfer">📁 File Transfer</a></li> <li><a href="#network">🌍 Network Scanning</a></li> <li><a href="#password">🔐 Password Attacks</a></li> <li><a href="#lateral">🕸️ Lateral Movement</a></li> <li><a href="#forensics">💾 Forensics</a></li> </ul> </div> <div class="content"> <h1>⚡ HackTricks Offline</h1> <div class="sub">Portable pentesting cheatsheet • No internet required • Updated essential commands</div><!-- Reconnaissance --> <section id="recon"> <h2>🔍 Reconnaissance</h2> <h3>Nmap Basic Scans</h3> <pre><code># Quick port scan (top 1000)nmap -sC -sV -T4 target.com
⭐ Overall Rating: 4.8/5 (Excellent for pentesters, CTF players, and security students)
HackTricks Offline is essentially the locally available, static version of the popular HackTricks GitHub repo and website (by Carlos Polop). It bundles a massive collection of pentesting, red teaming, and CTF techniques into a portable format.
OS detection + traceroute
nmap -O --traceroute target.com
For git clone
cd hacktricks && git pull
Set a cron job if you want it fully automatic. nmap -sC -sV -T4 target
When you are on a physical red team engagement, you might not have your laptop, but you have your phone.
Level 2 fails if you are on a Windows machine that has never seen Python, or if you cannot install pip due to corporate restrictions.
Enter the Hacktricks Docker Container.
Docker allows you to serve the entire Hacktricks suite offline on localhost.
http://localhost:8000 on your browser.Command to run offline:
docker run -d --name hacktricks -p 8000:8000 carlospolop/hacktricks
Because Docker uses layered file systems, the entire HTML, CSS, and JS are cached locally on your hard drive. You do not need an internet connection to spin up the container once the image is saved.
If you prefer a document you can grep through, convert the GitBook to PDF.