mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-12 21:02:11 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
15
tests/dynamic_fixtures/escape/raw_socket.py
Normal file
15
tests/dynamic_fixtures/escape/raw_socket.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"""Escape attempt: create a raw (AF_PACKET) socket.
|
||||
|
||||
Requires CAP_NET_RAW. Expected outcome: PermissionError (--cap-drop=ALL).
|
||||
"""
|
||||
import socket
|
||||
import sys
|
||||
|
||||
try:
|
||||
s = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, 0)
|
||||
s.close()
|
||||
print("NYX_ESCAPE_SUCCESS: created raw socket")
|
||||
sys.exit(0)
|
||||
except (PermissionError, OSError) as e:
|
||||
print(f"BLOCKED: {e}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue