Skip to content

fix(range): test ragnarok's scope with a send that reports EPERM, not ping - #1643

Merged
Gerrrt merged 1 commit into
mainfrom
gerrrt/ragnarok-scope-check-eperm
Nov 22, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
gerrrt/ragnarok-scope-check-eperm

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 22, 2026

Copy link
Copy Markdown
Owner

What changed

  • scripts/finish-attack-vm.sh: the "egress refused" and "segment allowed" checks now send a UDP datagram from Python, to 1.1.1.1 and to 10.0.30.1. They read PermissionError (the kernel's EPERM) instead of grepping ping'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 why ping cannot 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.sh against ragnarok stopped with error: a send to 1.1.1.1 was not refused by the filter. On ragnarok, read through the guest agent:

  • range_scope and range_scope_l2 were loaded exactly as written, and the script's raw-frame check had passed.
  • ping -c1 1.1.1.1 printed only "100% packet loss": no error, exit 1.
  • From Python, sends to 1.1.1.1 over ICMP datagram, raw ICMP and UDP all raised [Errno 1] Operation not permitted.
  • eth0's tx_packets did 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

  • The new guest-side block, run on ragnarok exactly as the script runs it (sh -eu -s), printed egress refused and segment 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.
  • Not yet done: a full rerun of finish-attack-vm.sh from phoenix after merge.

🤖 Generated with Claude Code

… 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>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 23:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@Gerrrt
Gerrrt enabled auto-merge (squash) November 22, 2026 23:14
@Gerrrt
Gerrrt merged commit aaf8f36 into main Nov 22, 2026
10 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/ragnarok-scope-check-eperm branch November 22, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants