Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Run a command with ambient capabilities
#!/bin/bash
# Run from terminal like enter-caps ./wireshark
export PS1="#$PS1"
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
caps=cap_net_admin,cap_net_raw
sudo -E capsh --keep=1 --caps="cap_setuid,cap_setgid,cap_setpcap+ep $caps+eip" --user=[my_hardcoded_username] --addamb="$caps" -- -c "$@"
echo "...Exiting enter-caps"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.