Fix and simplify tcpdump

This commit is contained in:
Andrea Cardaci 2018-08-19 10:31:04 +02:00
parent acf29564cb
commit 2ff760e560

View File

@ -1,9 +1,17 @@
--- ---
functions: functions:
execute-non-interactive: execute-non-interactive:
- code: echo "whoami > /tmp/whoami" > /tmp/tmpfile - code: |
tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z ./tmpfile -Z root COMMAND='id > /tmp/output'
sudo-enabled: TF=$(mktemp -u)
- code: echo "whoami > /tmp/whoami" > /tmp/tmpfile echo "$COMMAND" > $TF
sudo tcpdump -ln -i eth0 -w /dev/null -W 1 -G 1 -z ./tmpfile -Z root chmod +x $TF
tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z $TF
suid-enabled:
- code: |
COMMAND='id > /tmp/output'
TF=$(mktemp -u)
echo "$COMMAND" > $TF
chmod +x $TF
sudo tcpdump -ln -i lo -w /dev/null -W 1 -G 1 -z $TF
--- ---