Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ docstring gives: it is a record, not a claim about now.

## 2026-11-22

- **`finish-attack-vm.sh` tests `ragnarok`'s scope with a send that reports
its refusal.** Its first run against `ragnarok` stopped with "a send to
`1.1.1.1` was not refused", but the scope itself held:
- Both tables were loaded as written, and the raw-frame check passed.
- Python's sends to `1.1.1.1` (ICMP, raw ICMP and UDP) each raised
`Operation not permitted`.
- `eth0` transmitted nothing during the tests.

The check was the fault. It grepped `ping`'s output for that error, and
Kali's iputils (20250605) reports a refused send as plain packet loss
instead. The script and `build-the-playground.md` §8 now make the send
from Python, which raises the kernel's `EPERM`. This corrects the
2026-11-13 entry on `ragnarok`'s outbound scope, which said the script
fails unless `ping` is refused.

- **`gandalf`'s AMT does not answer on the network.** The 2026-11-13 audit
of `gandalf` found AMT's state unproven. The ME is present (`/dev/mei0`),
and the OS cannot read whether it is provisioned. `build-the-playground.md`
Expand Down
19 changes: 10 additions & 9 deletions docs/runbooks/build-the-playground.md
Original file line number Diff line number Diff line change
Expand Up @@ -1034,19 +1034,20 @@ nft list ruleset 2>/dev/null | grep -Ei 'masquerade|snat' || echo "no NAT"
iptables -t nat -S 2>/dev/null | grep -- '-j MASQUERADE' || echo "no legacy NAT"
systemctl is-enabled nftables; sudo nft list chain inet range_scope output | grep 'policy drop'
sudo nft list chain netdev range_scope_l2 egress | grep 'policy drop'
ping -n -c1 -W2 1.1.1.1
python3 -c 'import socket; socket.socket(socket.AF_INET, socket.SOCK_DGRAM).sendto(b"x", ("1.1.1.1", 9))'
```

Both sysctls `= 0`, and no NAT from either table — Kali's `iptables` is
nft-backed, so the two commands can disagree about a rule that exists.
`nftables` reads `enabled`, the `range_scope` chain is loaded with
`policy drop`, and the ping fails with *Operation not permitted*: the filter
refused it. A timeout is not a pass, because it is what the internet being down
looks like too. The raw-Ethernet half, a frame to `1.1.1.1` through a packet
socket that must raise `range_scope_l2`'s `out_of_scope` counter, needs a
crafted frame, so it is left to `finish-attack-vm.sh`. Run this after
installing anything that touches the network stack, and after any install that
lifted the scope, not just once.
`nftables` reads `enabled`, the `range_scope` chain is loaded with `policy
drop`, and the send fails with `PermissionError: [Errno 1] Operation not
permitted`: the filter refused it. Use the Python line, not `ping`. Kali's
`ping` (iputils 20250605) reports a refused send as plain packet loss, which
looks the same as the internet being down, so it proves nothing either way. The
raw-Ethernet half, a frame to `1.1.1.1` through a packet socket that must raise
`range_scope_l2`'s `out_of_scope` counter, needs a crafted frame, so it is left
to `finish-attack-vm.sh`. Run this after installing anything that touches the
network stack, and after any install that lifted the scope, not just once.

**Four — a target has no route anywhere.** On a target:

Expand Down
21 changes: 17 additions & 4 deletions scripts/finish-attack-vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,23 @@ if [ -n "$legacy" ]; then echo "legacy NAT present"; else echo "no legacy NAT";
echo "nftables $(systemctl is-enabled nftables 2>/dev/null || echo disabled)"
chain="$(nft list chain inet range_scope output 2>/dev/null)" || chain=""
if printf '%s\n' "$chain" | grep -q 'policy drop;'; then echo "scope policy drop"; else echo "scope missing"; fi
p="$(ping -n -c1 -W2 1.1.1.1 2>&1)" || true
if printf '%s\n' "$p" | grep -q 'Operation not permitted'; then echo "egress refused"; else echo "egress not refused"; fi
p="$(ping -n -c1 -W2 10.0.30.1 2>&1)" || true
if printf '%s\n' "$p" | grep -q 'Operation not permitted'; then echo "segment refused"; else echo "segment allowed"; fi
# The send is made from Python, not ping: Kali's iputils (20250605) reports
# a send the filter refused as plain packet loss and drops the error, while
# Python raises the kernel's EPERM. UDP to the discard port, because the
# scope is by address and the protocol does not matter. The gateway ping
# after it stays for the raw probe below: it resolves the gateway's MAC.
send() { python3 -c 'import socket, sys
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
s.sendto(b"range-scope-probe", (sys.argv[1], 9))
print("sent")
except PermissionError:
print("refused")
except OSError as e:
print("error", e.errno)' "$1"; }
if [ "$(send 1.1.1.1)" = refused ]; then echo "egress refused"; else echo "egress not refused"; fi
if [ "$(send 10.0.30.1)" = sent ]; then echo "segment allowed"; else echo "segment refused"; fi
ping -n -c1 -W2 10.0.30.1 >/dev/null 2>&1 || true
# Raw Ethernet, which the ping cannot test: one ICMP echo to 1.1.1.1 written
# to eth0 through a packet socket, addressed to the gateway's MAC the ping
# above just resolved. The send may fail with ENOBUFS once the egress hook
Expand Down