firegex/fgex-lib
2026-07-23 16:53:09 +02:00
..
fgex-pip updating also versions on fgex alias 2025-04-16 17:16:34 +02:00
firegex integrated and refactore docs + minor changes 2026-07-23 16:53:09 +02:00
fgex nfproxy module writing: written part of the firegex lib, frontend refactored and improved, c++ improves 2025-02-20 19:51:28 +01:00
MANIFEST.in nfproxy module writing: written part of the firegex lib, frontend refactored and improved, c++ improves 2025-02-20 19:51:28 +01:00
README.md integrated and refactore docs + minor changes 2026-07-23 16:53:09 +02:00
requirements.txt upgrade to py3.14 and fedora 43 2025-10-13 15:38:38 +02:00
setup.py Update setup.py 2025-04-11 17:23:35 +02:00

Firegex Python Library and CLI

This is the Python library for Firegex, a firewall built for CTF Attack-Defense competitions. It provides the firegex.nfproxy package used to write Netfilter Proxy Python packet filters, the fgex CLI, and a local proxy simulator (proxysim) for testing filters without a running Firegex instance.

Installation

pip install -U firegex

fgex is an alias package for firegex: installing either one gives you the same firegex module and the fgex/firegex CLI commands.

Documentation

➡️ Netfilter Proxy: writing and testing @pyfilter scripts — the pyfilter decorator, every data structure (RawPacket, TCPInputStream/TCPOutputStream, HttpRequest/HttpResponse and their variants, HttpHistory), packet statements, stream limits, the fgex nfproxy CLI simulator, and a full worked example.

That page is also what's shown in the Firegex web UI itself (the docs button on the nfproxy pages) — both are generated from that single file, so they can never drift out of sync.

Firegex's other filtering modules

This library only covers Netfilter Proxy. Firegex ships several other independent modules, each with its own guide:

  • Netfilter Regex — fast, PCRE2/hyperscan-based regex matching against raw traffic.
  • Hijack Port to Proxy — redirect traffic to your own external proxy without touching the target service.
  • Firewall Rules — plain nftables allow/drop/reject rules.
  • TLS Decryption — decrypt-and-reinspect bridge for services that speak TLS natively.