Dnx Firewall – A Pure Python Next Generation Firewall Built On Top Of Linux Kernel/Netfilter

DNX Firewall is an optimized/high performance collection of applications or services to convert a standard linux system into a zone based next generation firewall.

All software is designed to run in conjunction with eachother, but with a modular design certain aspects can be completely removed with little effort. The primary security modules have DIRECT/INLINE control over all connections, streams, messages, that goes through the system.

That being said, depending on the protocol, offloading to lower level control is present to maintain the highest possible throughput with full inspection enabled.

There is an IPTable custom chain to allow for the administrator to hook into the packet flow without the ability to accidentally override dnx security modules. A low level “architecture, system design” video will be created at some point to show how this is possible with pure python.

Included Features

  • DNS Proxy
    • category based blocking (general, TLD, substring matching)
    • user added whitelist/blacklist or custom general category creation
    • native DNS over TLS conversion with optional UDP fallback
    • local dns server
    • software failover
    • 2 level record caching
  • IP Proxy (transparent) Bi directional
    • reprutation based host filtering
    • geolocation filter
    • lan restriction (disables internet access to the LAN for all IPs not whitelisted)
  • IPS/IDS (WAN/inbound)
    • Denial of service detection/prevention
    • Portscan detection/prevention
  • Lightweight DHCP Server (custom)
    • ip reservations
    • security alert integration
  • General Services
    • Log handling
    • Database management
    • Syslog client (UDP, TCP, TLS) IMPORTANT: currently in a beta/unstable state. this service will not be enabled by default and will require the service enabled to start on system start.
  • Additional Features
    • IPv6 disabled
    • prebuilt iptable rules
    • DNS over HTTPs blocks (dns bypass prevention)
    • DNS over TCP blocks (dns bypass prevention)
    • DNS over TLS blocks (dns bypass prevention)
    • all inbound connections to wan DROPPED by default
    • IPTABLES custom chain for admin hook into packet flow

Before Running

NEW: sqlite3 is now the default database in use (to simplify deployments). The environment variable “SQL_VERSION” located in dnx_configure/dnx_constants.py can be flipped to use postgresql. WARNING: switching the database used after initial configuration may cause problems.

  • [+] Edit data/config.json and data/dhcp_server.json to reflect your system [interfaces].
  • [+] Move all systemd service files into the systems systemd folder.
  • [+] Configure system interfaces. LAN needs to be Default Gateway of local network.
  • [+] Compile python-netfilterqueue for your current architecture/distro (link below). - ensure name is netfilter.so and placed in the dnxfirewall/netfilter folder
    • NOTE: in the future this step will be wrapped into the deployment script
  • [+] Compile dnx_iptools/binary_search.pyx for your current architecture/distro. - ensure name is binary_search.so and placed in the dnxfirewall/dnx_iptools folder
    • NOTE: in the future this step will be wrapped into the deployment script
  • [+] Run/ follow, in order, the corresponding deployment scripts [for the selected database] to automate system setup. look at comments in script files for more direction.

Non DNX code dependencies/sources!

General Showcase Demo (outdated)

This video is extremely outdated, but still shows general functionality and some of the high level security implementations. an updated video will be created soon which will show the newly added modules: syslog client, standard logging, ips/ids, updated dns proxy functionality, updated ip proxy functionality, more.

R K

Recent Posts

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

1 week ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

2 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

2 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

3 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

3 weeks ago

MaLDAPtive – Pioneering LDAP SearchFilter Parsing And Security Framework

MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…

3 weeks ago