| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
| |
The bootstrap/run separation was unnecessary. Move all initialization
(cleanup + nftables setup): into run() and skip bootstrap in daemon
mode. We repurpose the bootstrap() function to only run in non-daemon
mode for future foreground-only initialization.
- Add OPT_DAEMON option to detect daemon mode
- Move cleanup() and install_rules() from bootstrap() to run()
- Make bootstrap() a no-op (only called in non-daemon mode)
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Revert lock_handle()
send_to_raw cannot get a mutex since lock is not released per
iteration.
commit e08b57d281d8368dc02f06e3b6cd43edf88b2438
|
| |
|
|
|
| |
Closes: #2
Link: https://github.com/dilluti0n/dpibreak/issues/2
|
| | |
|
| |
|
|
| |
Now --fake-* options implicitly turn on --fake option.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Introduce `EvictPriority` enum.
- Optimize `is_stale` and `evict_priority` by passing entry references
to eliminate redundant memory loads.
pkt: hoptab: derive stale age from CAP
Replace the magic `64` threshold with `STALE_AGE = CAP >> 1` and make
the stale check inclusive (`age >= STALE_AGE`). This keeps the
eviction/staleness policy consistent when CAP changes and documents
the intended half-table age cutoff.
pkt: hoptab: add compile time assertion for CAP
pkt: hoptab: add comments
|
| |
|
|
|
| |
Use ST_OCCUPIED instead of ST_EMPTY to avoid skipping valid entries;
add debug logs
|
| | |
|
| |
|
|
|
|
|
|
|
| |
- add pkt::hoptab: small fixed-size hash table keyed by
IP (v4-mapped/v6) with TTL-based staleness + simple eviction
- store (src_ip -> inferred hop) on SYN/ACK from :443
- lookup (dst_ip -> hop) when crafting fake ClientHello, fallback to
--fake-ttl on miss
- add PktView helpers: ttl(), saddr(), daddr()
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Build WinDivert filter at runtime:
- Default: outbound TLS ClientHello packets
- --fake-autottl: also capture inbound SYN/ACK from tcp sport 443
Keep !impostor to avoid recapture.
|
| |
|
|
|
|
| |
- Add mangle/INPUT jump to DPIBREAK
- Queue tcp sport 443 SYN/ACK packets (NFQUEUE --queue-bypass)
- Cleanup removes INPUT jump as well
|
| |
|
|
| |
- simplify nftables rules by removing DPIBREAK chain
|
| | |
|
| |
|
|
|
|
|
| |
Split iptables and nftables rule management into dedicated modules.
Keep linux.rs focused on shared helpers and rule dispatch.
(cherry picked from commit 60c0011ca0cf5a463056fca17f2f747e762e19f9)
|
| | |
|
| |
|
|
| |
Introduce minimal iptables wrapper.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Initialize log_level from DEFAULT_LOG_LEVEL instead of duplicated
cfg(debug_assertions) branches in parse_args_1().
|
| | |
|
| | |
|
| |
|
|
|
| |
Move option parsing to opt.rs and packet handling to pkt.rs from
main.rs
|
| |
|
|
|
|
| |
- Extend split_packet_0 to optionally override TCP checksum.
- Compute L3 header length for IPv4/IPv6 and patch checksum field when requested.
- Wire fake_clienthello to set checksum to 0 when fake_badsum() is enabled.
|
| |
|
|
| |
For --fake-badsum work; Anyway, it is already calculated
|
| | |
|
| |
|
|
| |
Fake was enabled by default.....
|
| |
|
|
| |
Log runtime options on startup
|
| |
|
|
|
| |
- Add --fake flag to enable fake ClientHello injection
- Add --fake-ttl option to override TTL of fake packets
|
| |
|
|
| |
Introduce send_segment abstraction
|
| |
|
|
|
| |
- linux: fix infinite NFQUEUE loop by marking injected packets
- windows: by marking packet to impostor
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Introduce exec_process() to handle external command execution, stdin
piping, and error reporting. Now cleanup() and apply_nft_rules() call
exec_process() to call modprobe, nft respectively.
This improves error handling for cleanup xt_u32.
|
| |
|
|
|
| |
Do not log errors if cleanup fails during startup.
Retain error logging for cleanup failures on shutdown.
|
| |
|
|
|
| |
nftables-rs didn’t fit use case, so it was decoupled, and logging was
improved.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
`CloseAction::Uninstall` triggers ERROR_INVALID_NAME (0x8007007B) on Windows,
likely due to the crate passing a non–NUL-terminated "WinDivert" string to
`OpenServiceA`. For now, skip uninstallation and just close the handle
normally. Added a FIXME comment with details.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Add additional nftables match expressions to detect TLS records
(ContentType 0x16 = Handshake): and specifically ClientHello
(HandshakeType 0x01):. Packets matching this pattern are queued to
NFQUEUE. Mark xt_u32 as supported when nftables filtering is
successfully applied.
|