Skip to content
LinuxUser255Public

About

This repo is a mirror. Devel;opment is on GitLab. Opcode is a fully offline, single-container local reference site that aggregates and normalizes web-app security material from PayloadsAllTheThings, HackTricks, HTB-Scripts, Web-Security-Academy, and your own notes into one fast searchable library for use during engagements.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Opcode

Latest Release

Opcode logo


combines:

Runs locally on your machine, in Docker

Features

- A searchable offline resource library for web-app pentesting.

- Find payloads, code, tips n tricks fast

- Easy Docker instructions below



Opcode pulls the web-app material out of PayloadsAllTheThings, HackTricks, HTB-Scripts, and Web-Security-Academy plus your own notes, normalizes it, and serves it as one fast local site you can search during an engagement — instead of keeping six browser tabs open or grepping through cloned repos.

It runs in a single Docker container on your machine. It never touches the internet: no scanning, no telemetry, no CDN assets, no outbound requests of any kind. It is a reference library, not a tool that does anything to a target.

Screenshots

Search — one box over all 800 entries. Punctuation-dense payload queries work verbatim, and every hit carries its category and source.

Searching for RCE across the whole corpus

Entry pages — upstream markdown rendered with syntax highlighting, a copy button on every fence, and the page's own attribution.

The PayloadsAllTheThings Command Injection page

Filter by category — Commands, Payloads, or Tools, each with a live count taken from the corpus itself.

The category filter open, showing per-category counts

Filter by tool — only tools the corpus actually covers ever appear here; the list is built from the entries, never hardcoded.

The tool filter open, listing burp, sqlmap, ffuf, nmap and others

About — per-source entry counts, upstream licenses, and the statement of modification that ingestion requires.

The About page showing sources, licenses and entry counts

What's in it

800 entries, all web-app focused:

Category Count What it is
Payloads 461 Vulnerability classes — SQLi, XSS, SSRF, SSTI, XXE, CSRF, deserialization, file upload, IDOR … — plus PortSwigger lab notes and solvers
Commands 275 Web recon and exploitation steps, web servers and stacks (IIS, Tomcat, WordPress …)
Tools 64 Per-tool cheat sheets and scripts — ffuf, gobuster, nmap, ripgrep, and more

Sourced from PayloadsAllTheThings (129), HackTricks (262), HTB-Scripts (72), Web-Security-Academy-Series (331), and pages written for Opcode itself (6). Counts are from the snapshot committed on 2026-10-14; they move whenever upstream is re-synced.

What you can do with it

  • Search everything at once — substring matching over titles, bodies, tags and tool names. Punctuation-safe, so '; DROP, ${jndi:ldap://} and {{7*7}} all work as literal queries. Press / to jump to the box.
  • Filter by category and tool, combined with a query. The tool list is built from what's actually in the corpus, never hardcoded.
  • Browse by category and vulnerability class.
  • Copy any command with one click — every code block has a copy button and GitHub-style syntax highlighting.
  • Add your own cheat sheets — drop a markdown file in authored/ and re-ingest. See authored/README.md.

Every entry shows where it came from: source repository, original file path, license, and a link upstream.

Two surfaces only — search and browse. No drills, no flashcards, no quizzes, no chat, no progress tracking. Opcode stores nothing you type.

Contents


Build and run with Docker

Requirements: Docker with Compose v2, git, and python3 (with the venv module — on Debian/Ubuntu, sudo apt install python3-venv).

The short version

The control menu is the one entry point for everything in this section. Run it and pick what you need:

./scripts/opcode.sh

On a fresh clone choose First-time setup. Day to day you will mostly use Update — which pulls upstream, re-syncs content/, rebuilds the image and restarts, all in one step — and Status, a one-line check of whether the running app is still in sync with content/. The menu also follows logs and stops the app. It does no work of its own: every item runs the matching script or make target documented below, so anything it does you can also do by hand.

Prefer to run the first build directly?

./scripts/setup.sh        # or: make setup

That does all three steps below: clones the source repositories as siblings, creates the virtualenv, generates content/, builds the image, and waits until the app answers on http://localhost:8775.

It is safe to re-run. It looks before it clones: an existing checkout is left completely alone — never pulled, never overwritten — and a clone whose directory is spelled differently (HackTricks rather than hacktricks) is detected and used where it is, rather than a second copy being fetched beside it. Finished steps are skipped.

--skip-clone uses only what is already on disk; --no-docker stops after generating content. ./scripts/setup.sh --help lists everything.

Because it never pulls, the setup script is for the first build only. Bringing upstream changes into an existing setup is make resync — see Re-sync.

The rest of this section is what the script does, in case you want to run the steps yourself or something goes wrong.

1. Get the source repositories

Opcode reads these at build time to generate its content. Clone them as siblings of this repo — the two public ones are all you need to get a useful corpus:

cd ..
git clone https://github.com/swisskyrepo/PayloadsAllTheThings.git
git clone https://github.com/HackTricks-wiki/hacktricks.git
cd opcode

That gives you 397 entries. The last two are personal repositories hosted on GitLab; add them if you have access:

git clone https://gitlab.com/LinuxUser255/HTB-Scripts.git                 # +72 entries
git clone https://gitlab.com/LinuxUser255/Web-Security-Academy-Series.git # +331 entries

Clone these two from GitLab, not from their GitHub copies: GitLab is where they are developed, the GitHub repositories are mirrors, and the re-sync step refuses to pull a clone whose origin is not the registered repository (SSH or HTTPS, either is fine).

Each default is the directory name a plain git clone produces, so a sibling layout needs no configuration at all:

~/Projects/PayloadsAllTheThings
~/Projects/hacktricks
~/Projects/HTB-Scripts
~/Projects/Web-Security-Academy-Series
~/Projects/opcode          <- you are here

Names are matched case-sensitively on Linux, so they must match the slugs above exactly.

Already have them elsewhere? Point Opcode at them with environment variables in your shell, from the project root, before you run make ingest in step 2:

# applies to just this one command
PAYLOADS_SRC=/path/to/PayloadsAllTheThings make ingest

# or for the rest of this terminal session
export PAYLOADS_SRC=/path/to/PayloadsAllTheThings
export HACKTRICKS_SRC=/path/to/hacktricks
make ingest

# or, if all the repos live in one directory, set the parent once
HACKING_ROOT=/opt/sec make ingest

HACKING_ROOT is where Opcode looks when the individual variables are unset; it defaults to this repo's parent directory. The full set is PAYLOADS_SRC, HACKTRICKS_SRC, HTB_SCRIPTS_SRC, WSA_SRC.

These are read by ingest.py on your machine — not by Docker. Ingestion runs on the host and bakes its results into content/; the container never opens a source repository, which is what makes the image self-contained. Setting these in the Dockerfile, in docker-compose.yml, or in a .env file has no effect — .env is read by Compose for its own ${PORT} substitution, never by python ingest.py.

A source that isn't on disk is skipped with a warning — Opcode builds fine with only some of them (without HackTricks, for example, you get 538 entries instead of 800).

2. Generate the content

make venv      # one-time: create .venv and install dependencies
make ingest    # walk the sources and write content/

No make? The equivalent:

python3 -m venv .venv
.venv/bin/pip install -r requirements-dev.txt
.venv/bin/python ingest.py

This writes content/entries/**.yaml and refreshes TODO.md. It takes a few seconds and is safe to re-run.

3. Build the image and start it

docker compose up --build -d

Then open http://localhost:8775.

Everyday commands

docker compose up --build -d     # build and start  (make up)
docker compose down              # stop, keep data  (make down)
docker compose logs -f           # follow logs      (make logs)
docker compose ps                # check status
curl localhost:8775/health       # {"entries":800,"ok":true}

Change the port with PORT=9000 docker compose up -d.

After changing content

content/ is baked into the image, so a content change needs a rebuild:

make resync                      # pull upstream and re-sync content/
make ingest                      # or: re-read the clones and authored/ as they are
docker compose up --build -d     # (make rebuild)

The rebuild does not touch your data volume, and the app reseeds itself on boot — there is no separate seed step to remember. Forgetting the rebuild is the classic trap: content/ updates but the running container keeps serving the old snapshot. The control menu's Update runs the re-sync and the rebuild together so the two cannot drift apart.

Starting over

docker compose down -v           # also deletes the app-data volume
docker compose up --build -d     # rebuilds and reseeds from content/

Nothing is lost: the database is just a cache of content/.

Running without Docker

make ingest
make seed        # SQLite goes under ./data (the Makefile sets DATA_PATH)
make run

Scope of this build

This pass covers web-application material only: web vulnerability classes, web recon/exploitation commands, and web-focused tooling.

Everything else in the source repositories — Active Directory, network services, binary exploitation, mobile, cloud, forensics, crypto — was walked, classified, and deliberately deferred. It is inventoried in TODO.md with a file count per area, regenerated on every ingest. Nothing is silently dropped.

To widen scope, move an area's name into the matching allowlist in ingestion/webscope.py and re-run python ingest.py. Taxonomy, zsh normalization, attribution, and re-sync all apply to whatever is in scope.

Where content comes from

Opcode reads four cloned repositories at ingest time. By default it looks for them as siblings of this repo:

Path Contributes Pulled from Override with
../PayloadsAllTheThings Payloads (129) GitHub PAYLOADS_SRC
../hacktricks Commands (262) GitHub HACKTRICKS_SRC
../HTB-Scripts Tools and Commands (72) GitLab HTB_SCRIPTS_SRC
../Web-Security-Academy-Series Payloads (331) GitLab WSA_SRC

Or point HACKING_ROOT at the directory holding them all. A source that is not on disk is skipped with a warning.

authored/ is the fifth source — content written for Opcode itself, which lives in this repo and needs no clone.

HTB-Scripts is ingested whole: every file under Cloud, Exploits, Scanning, Shells, Utils, and Web is web-app material, so no scope filter applies. Markdown cheat sheets land in Commands; scripts land in Tools.

Writing your own content

Pages written for Opcode live in authored/ — ingestion input, deliberately not inside content/, which is generated output that ingest.py rebuilds from scratch. Anything authored inside content/ would be destroyed by a rebuild and reported as stale in the meantime.

The containing directory sets the default category (authored/Tools/…), and a YAML frontmatter block declares the rest. Authored pages have no upstream path to infer metadata from, so they state it explicitly:

---
title: ffuf
category: Tools
tool: ffuf
vuln_class: Content Discovery
canonical: true
tags: [fuzzing, content-discovery, recon]
---

# ffuf

Fast web fuzzer...

canonical: true marks a page as the reference for its tool. Several entries can legitimately share a tool tag — for nmap there is also a wrapper script — and the canonical one leads both search results and the tool filter, with a Reference badge. It is a tiebreaker, not an override: a title match still outranks it.

Frontmatter wins over inference. Everything else is identical to an ingested page: the same cleaning, the same zsh normalization, the same search indexing, and per-entry attribution — authored pages are credited to Opcode (authored) under the project's own GPLv3, with no upstream link.

Tag your shell fences. A fence with no language is skipped by both the zsh normalization pass and syntax highlighting, so write ```bash rather than a bare ```.

Then:

make ingest        # fold authored/ into content/
make rebuild       # bake content/ into the image and restart

How content flows

source repos ─┐
              ├─ingest.py──▶ content/entries/**.yaml ──seed──▶ SQLite ──▶ web app
authored/ ────┘             (generated, git-tracked)      (app-data volume)
 (hand-written)
  1. python ingest.py walks the sources, filters to web scope, cleans upstream markup, normalizes shell blocks for zsh, classifies each page, attaches attribution, and writes one YAML entry per page. It also rewrites TODO.md.
  2. Seeding happens automatically on every boot. It is an idempotent upsert by stable id, so there is no separate refresh step to forget.
  3. The app reads SQLite. It never opens content/ or a source repo.

Only app/ and content/ ship in the image. The ingestion package and the upstream repos stay on the host.

content/ is COPYed into the image rather than bind-mounted, which is why an edit needs a rebuild — see After changing content.

Re-sync

Manual only. Nothing pulls upstream on a schedule. resync.py is the one script that brings upstream changes in, and it runs on your host.

The easiest way is the control menu's Update, which runs the pull, the re-sync, the image rebuild, and an offer to commit the result — in that order, so you never re-sync and then forget to rebuild:

./scripts/opcode.sh           # choose Update

To run the stages yourself:

make resync                   # pull the clones, update content/, reseed SQLite
make rebuild                  # then bake the new content/ into the image

python resync.py --no-seed    # pull and update content/ only
python resync.py --no-pull    # re-sync from the clones as they are (offline)
make pull                     # pull the clones only, no ingest

It does four things in order, printing a report for each:

  1. Pull. Every clone is fast-forwarded from its origin — GitHub for PayloadsAllTheThings and HackTricks, GitLab for HTB-Scripts and Web-Security-Academy-Series. It never pulls over uncommitted changes, never merges or rebases a diverged branch, and never pulls from a remote other than the registered one; each of those is reported and the clone is left alone. A blocked clone does not stop the run, but the exit status is 1 so it cannot be missed.
  2. Sync. Entries whose upstream file changed are rebuilt; everything else is untouched. Idempotent: with nothing new upstream it writes no files and does not re-run normalization over unchanged content.
  3. Inventory. TODO.md is regenerated.
  4. Seed. SQLite is upserted from content/. make resync keeps it under ./data; running the script directly needs DATA_PATH=./data or --no-seed, and it checks that up front rather than failing after the pull. In Docker the rebuild reseeds on boot anyway.

Then review and commit the result on dev — content/ is git-tracked. The menu's Update offers to do exactly this, on dev and never on main; by hand it is:

git status --short content/
git add content/ TODO.md && git commit -m "content: re-sync from upstream"

documentation/content-sources.md §7 walks through every status the pull step can report, and documentation/resync-troubleshooting.md explains each error message and its fix.

Conflicts are never resolved silently. Each entry records the hash of the upstream file it came from and the hash of the body ingest produced. If upstream changed and the stored body no longer matches what ingest wrote (someone edited it by hand), the entry is flagged for manual review and left exactly as it is. Flagged entries are listed at the end of the run, on the entry page, and on /about.

To resolve one:

  • Keep the local version — edit content/entries/<id>.yaml, set flagged_for_review: false, and clear ingest_hash to keep protecting it.
  • Take upstream — delete the entry file; the next sync recreates it.

Upstream files that disappear are reported as stale and kept, never deleted.

Search

Substring matching over title, tool, classification, tags, and body, with optional category and tool filters that combine as AND.

Substring rather than FTS5 is deliberate: payload text is dense with punctuation ('; DROP, ${jndi:ldap://}, {{7*7}}) that an FTS5 MATCH query treats as operators. % and _ are escaped so they behave as literals, since in this corpus they are search terms, not wildcards.

Press / anywhere to focus the search box.

License

Opcode's own code is GPLv3 (GNU General Public License, version 3 or later). The full text is in LICENSE; copyright and third-party notices are in NOTICE.

SPDX-License-Identifier: GPL-3.0-or-later

GPLv3 is copyleft — what that means here

Copyleft is a reciprocity condition, not just an attribution notice. If this repository is ever made public, or Opcode is distributed in any form:

  • Derivative works must also be GPLv3. Anyone who modifies Opcode and distributes it must release their modified version under GPLv3 too.
  • Source must be offered. Conveying Opcode — including as a container image or a hosted appliance — obliges you to make the corresponding source available to recipients.
  • Modifications must be marked as changed, so problems are not attributed to earlier authors.
  • It cannot be relicensed as proprietary, and you may not add further restrictions on top of the GPL.
  • GPLv3 permits commercial use. Note the content caveat below, which is a separate license and does not.

The -or-later in the SPDX tag follows the FSF's recommended boilerplate ("either version 3 ... or (at your option) any later version"). For strictly version 3, change the tag to GPL-3.0-only in the source headers and in NOTICE section 1.

Bundled content is licensed separately

Everything under content/ is ingested third-party reference material. It is data, not part of the program, and keeps its original license. Every entry carries its source repository, original path, license, and a link upstream — on the entry page itself, not buried in a credits page.

  • PayloadsAllTheThings — MIT, © Swissky and contributors.
  • HackTricks — CC BY-NC 4.0, © Carlos Polop. Attribution required and commercial use is not permitted.
  • Web-Security-Academy-Series — GPLv3, the author's fork of rkhal101's series, with notes and lab scripts expanded.
  • Local notes — the author's own content, GPLv3 with the code.

Ingested content is modified from upstream (mdBook directives flattened, images removed, shell blocks normalized for zsh, pages recategorized). CC BY-NC 4.0 requires that modifications be indicated, so they are listed in NOTICE section 3 and noted on every entry page. No payload or command text is rewritten for meaning.

The GPL and the bundled content pull in different directions. GPLv3 grants the freedom to use and sell the software commercially; the bundled HackTricks material forbids commercial use. These coexist because content/ is a separate work shipped in the same tree — an aggregate under GPLv3 §5 — so the GPL does not extend to it and its terms do not restrict the code. In practice: commercial use has full GPLv3 rights to Opcode's code, but must drop content/ and re-ingest from sources whose terms permit that use. The ingestion pipeline is part of the GPL'd program, so this is fully supported. See NOTICE section 4.

Development

make test     # pytest
make lint     # flake8 + mypy + bandit
make fmt      # isort + black
make audit    # pip-audit on pinned runtime deps
pre-commit install

Changes are developed on the dev branch and reach main only through a CI-gated merge request on GitLab — see documentation/git-workflow.md for the day-to-day loop, the merge checklist, and the GitLab settings that enforce it.

See AGENTS.md for architecture, data contracts, and the footguns worth knowing before changing the pipeline.

About

This repo is a mirror. Devel;opment is on GitLab. Opcode is a fully offline, single-container local reference site that aggregates and normalizes web-app security material from PayloadsAllTheThings, HackTricks, HTB-Scripts, Web-Security-Academy, and your own notes into one fast searchable library for use during engagements.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages