Repository navigation
fix(range): test ragnarok's scope with a send that reports EPERM, not ping - #1643
Merged
Merged
Conversation
… ping finish-attack-vm.sh's first run against ragnarok died on "a send to 1.1.1.1 was not refused", with the scope holding: Python's ICMP, raw ICMP and UDP sends to 1.1.1.1 all raised EPERM and eth0 sent nothing. Kali's iputils (20250605) reports a filtered send as packet loss and drops the error, so grepping ping's output for it could never pass. The check now sends a UDP datagram from Python and reads the PermissionError; the gateway ping stays only to resolve the MAC for the raw probe. Runbook §8 matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the replacement of unreliable ping-based scope checks with Python UDP probes.
No open issues 🎉
What changed in this PR
This PR corrects the attack VM scope checks so Kali’s suppressed ping errors no longer cause a false failure. The nftables rules remain unchanged.
Changes:
- Use Python UDP sends to verify blocked external traffic and allowed segment traffic, retaining the gateway ping for MAC resolution.
- Align the playground runbook’s manual check with the Python probe.
- Add a changelog correction explaining the faulty check and its replacement.
| File | Description |
|---|---|
scripts/finish-attack-vm.sh |
Replaces ping-output checks with explicit Python send results. |
docs/runbooks/build-the-playground.md |
Updates the manual scope check and explains why ping is unsuitable. |
docs/changelog.md |
Records the fix and corrects the earlier scope-check entry. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
scripts/finish-attack-vm.sh: the "egress refused" and "segment allowed" checks now send a UDP datagram from Python, to1.1.1.1and to10.0.30.1. They readPermissionError(the kernel'sEPERM) instead of greppingping's output. The gateway ping stays, output discarded, because the raw-Ethernet probe after it needs the gateway's MAC resolved.docs/runbooks/build-the-playground.md§8 check three: the manual check uses the same Python line, and the text says whypingcannot prove it on Kali.docs/changelog.md: a 2026-11-22 entry that corrects the 2026-11-13 one.Why
The first real run of
finish-attack-vm.shagainstragnarokstopped witherror: a send to 1.1.1.1 was not refused by the filter. Onragnarok, read through the guest agent:range_scopeandrange_scope_l2were loaded exactly as written, and the script's raw-frame check had passed.ping -c1 1.1.1.1printed only "100% packet loss": no error, exit 1.1.1.1.1over ICMP datagram, raw ICMP and UDP all raised[Errno 1] Operation not permitted.eth0'stx_packetsdid not move during either test.So the scope holds. The check was the fault: Kali's iputils 20250605 reports a refused send as plain packet loss and drops the error.
Blast radius
One check in
finish-attack-vm.sh, plus docs. The nftables rules are unchanged. Nothing else calls the script.Verification
ragnarokexactly as the script runs it (sh -eu -s), printedegress refusedandsegment allowed.bash -n scripts/finish-attack-vm.sh: OK.make validate: all checks passed, with 46 skipped because there is no Docker here../scripts/lint.sh: passed, with 14 skipped. Shellcheck, markdownlint and editorconfig run in CI.finish-attack-vm.shfromphoenixafter merge.🤖 Generated with Claude Code