Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

피드문의개인정보© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
NetworkSandboxEngine — A deterministic network sandbox for testing nftables rules. It uses ephemeral Linux network namespaces (netns) and Scapy to validate firewall logic safely. | Kitploit
도구/GitHubGitHub/onyks-os/networksandboxengine
Defensive ToolsPacket Sniffing & AnalysisScripting & AutomationConfiguration AuditingNetwork SecurityDevSecOps
GitHubonyks-os/networksandboxengine

NetworkSandboxEngine

A deterministic network sandbox for testing nftables rules. It uses ephemeral Linux network namespaces (netns) and Scapy to validate firewall logic safely.

저장소 보기
4318일 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유
웹사이트
요청한 언어로 콘텐츠를 사용할 수 없습니다. 영어 버전을 표시합니다.

Network Sandbox Engine

A Linux engine for deterministic nftables firewall testing inside isolated network namespaces.

Linux Python CI Status Documentation PyPI License

Why NSE? • Oracle contract • Wire assertions • Features • Requirements • Installation • Quickstart • How It Works • Project Structure

Why NSE?

Testing firewall rulesets on a live Linux system poses significant risks: malformed rules can drop SSH management sessions, leak cleartext traffic during testing, or leave orphan firewall tables active on the host.

Network Sandbox Engine (NSE) provides a safe, reproducible testing harness. It constructs ephemeral Linux network namespaces, wires virtual ethernet pairs, compiles nftables rulesets, and injects synthetic Layer 2 and Layer 3 packets using Scapy. All evaluation happens inside the sandbox namespace: host firewall state is never altered.

Key architectural properties:

  • Zero Host Mutation: Rulesets are loaded exclusively into ephemeral sandbox namespaces (nse_<uuid>) and are completely removed during teardown.
  • Self-verifying Oracle: Every run injects a canary packet before the test packets and again after them, and reports a result only if the kernel trace for both was observed. See The oracle contract.
  • Dual-Stack and Topologies: Native support for IPv4 and IPv6 traffic, plus multi-namespace Gateway topologies for router, NAT, and forwarding ruleset validation.
  • Small, auditable surface: One package, no web server, no JavaScript. nse/ is ~1200 statements at 98% test coverage.

Requires root

NSE creates network namespaces, loads nftables rulesets and reads kernel trace events, so it runs as root. It does not open a socket, a port or an RPC endpoint of any kind — it is a library and a CLI that you invoke, and it holds privileges only for the duration of a run.

Version 2.1.0 removed the FastAPI/Svelte web interface that earlier releases shipped. That interface ran in-process as root from 2.0.0 onward, which was a large attack surface for a testing tool; the code remains in the git history at tag v2.0.0 if you need it.


The oracle contract

A firewall test is a negative assertion — "this packet did not get through" — and a negative assertion is worth nothing unless the instrument is known to be working. A trace monitor that never attached to the kernel and a firewall that blocked everything produce byte-identical output.

NSE therefore refuses to report a verdict it cannot show it measured:

GuaranteeMechanism
The monitor was attached before the first test packetA readiness canary is injected and re-injected until its kernel trace is observed. No observation, no run.
The monitor was still attached after the last oneA liveness canary runs after injection. If it is missed, the verdict stream is declared truncated.
The parser understood what the kernel saidTrace lines that no pattern matches are counted, and any count above zero is an error rather than a debug log.
The monitor did not die quietlyThe read loop records why it ended — clean stop, unexpected EOF, timeout or crash — and only a clean stop is acceptable.
A missing verdict is not a passThe CLI runner fails when the number of observed verdicts differs from the number expected, in either direction.

Canary packets are excluded from results by trace id, so they never appear in your verdict stream.

The suite proves this holds, rather than asserting it: make test-blind forces the parser to understand nothing, and the build fails unless the runner exits non-zero. That job runs in CI on every push.


Asserting on the wire

nft monitor trace reports what the ruleset decided. It cannot report what left an interface the ruleset never matched on, which is the question a zero-leak claim actually asks. PCAPAsserter covers that: an AsyncSniffer wrapper that captures on a named interface and hands the frames back, so a test can assert that a stimulus produced none.

from nse import PCAPAsserter

asserter = PCAPAsserter(iface="veth-host")
await asserter.start()
# ... send the stimulus ...
leaked = await asserter.stop()
assert not leaked, leaked

The same rule as the trace oracle applies, and it is the caller's to enforce: a sniffer that never attached and a firewall that blocked everything both return an empty list. Capture the stimulus once with the ruleset flushed and require the frame to be seen before asserting its absence.

The default filter suppresses link-local noise, and nothing else. DEFAULT_FILTER excludes ARP and ICMPv6 types 133-137 - Neighbour Discovery, which carries a hop limit of 255 and cannot reach a remote observer. Everything else is captured, including ICMPv6 echo to a globally routable address. A filter argument is combined with that default; replace_default_filter=True uses yours alone. The escape hatch exists because the filter is compiled into BPF and evaluated in the kernel: a packet it excludes never reaches userspace, so no consumer can recover it downstream. Until 2.1.2 the default read not arp and not icmp6, which discarded routable ICMPv6 as well - see issue #14.


Features

도구 다운로드