Skip to content

bl4d3rvnner7/htb-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Python Code Style: Black Dependencies HTB HTML Output Tested PRs Welcome

GitHub Stars GitHub Forks GitHub Issues GitHub Last Commit

πŸ–₯️ HTB Module Parser

Convert any unlocked HackTheBox Academy module into a full offline HTML package - including images, assets, syntax highlighting, and a TOC sidebar. βš™οΈπŸ“˜

This tool was tested on 50+ modules without errors. Perfect for offline studying or archiving.

🎬 Tutorial & Cookie Guide (Resources)

  • ▢️ Video Tutorial Tutorial Vid.mp4

  • πŸͺ How to get your Cookie (Screenshot) Cookie Tutorial

Both files are located in the resources/ folder of the repository.


βš™οΈ How to Set Up & Use (Step-by-Step)

1️⃣ Install Requirements

Install the Python packages needed by the script:

pip install requests beautifulsoup4 markdown pygments

2️⃣ Get Your HTB Session Cookie

You must be logged in to academy.hackthebox.com to download module content.

Follow this mini-guide:

  1. Open Developer Tools (F12)
  2. Go to the Network tab
  3. Click any request from academy.hackthebox.com
  4. Find the Request Headers
  5. Copy the Cookie field
  6. Paste it into cookie.txt

βœ” Refer to the screenshot here: Cookie Tutorial

βœ” Or watch the video tutorial here: ▢️ Tutorial Vid.mp4

3️⃣ Run the Offline Module Generator

Basic usage:

python generate_offline.py --module <MODULE_ID>

Example:

python generate_offline.py --module 278

You can also provide your cookie manually:

python generate_offline.py --module 278 --cookie "auth_sid=..."

4️⃣ Where to Get the Module ID?

Check the module URL:

https://academy.hackthebox.com/beta/module/278

➑️ The number 278 is the module ID.

5️⃣ Output Structure

After parsing, you will get a folder like:

278. Web Requests/
│── index.html
│── style.css
│── pygments.css
└── assets/
      β”œβ”€β”€ 0.html
      β”œβ”€β”€ 1.html
      β”œβ”€β”€ 2.html
      β”œβ”€β”€ image1.png
      └── ...

Open:

index.html

Your module is now 100% offline and fully navigable.

🀝 Contributing

Pull requests are welcome. Feel free to expand compatibility, add new features, improve UI, or help optimize parsing.

Telegram Telegram Channel

About

Parse HTB modules into fully offline HTML with images, code highlighting, and sidebar navigation. πŸ“₯πŸ“š

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages