Skip to content
Open
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
54 changes: 54 additions & 0 deletions actions/tcpdump_pcap_write.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: "Run tcpdump against an interface and collect pcap data."
enabled: true
name: "tcpdump_pcap_write"
pack: "networking_utils"

parameters:
interface:
type: "string"
description: "Interface identifier"
required: true

snaplen:
type: "number"
description: "Snaplength."
default: 0
required: false

file:
type: "string"
description: "Path to capture file."
required: true

mode:
description: "Capture mode - write to file or read from file"
type: "string"
enum:
- w
- r
default: "w"

time:
description: "Time for which tcpdump capture should be run"
type: "number"
required: false
default: 120 # seconds

timeout:
default: 1000

tcpdump_opts:
description: "Specify other tcpdump options as you specify on a shell."
type: "string"
required: false
default: "-G {{ time }} -W 1 -C 1 -l -nn"

sudo:
default: true
immutable: true

cmd:
default: 'sudo timeout {{ time }} tcpdump -i {{ interface }} -s {{ snaplen }} -{{ mode }} {{ file }} {{ tcpdump_opts }} || exit 0'

runner_type: "remote-shell-cmd"
54 changes: 54 additions & 0 deletions actions/tshark_pcap_write.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
description: "Run tcpdump against an interface and collect pcap data."
enabled: true
name: "tshark_pcap_write"
pack: "networking_utils"

parameters:
interface:
type: "string"
description: "Interface identifier"
required: true

snaplen:
type: "number"
description: "Snaplength."
default: 0
required: false

file:
type: "string"
description: "Path to capture file."
required: true

mode:
description: "Capture mode - write to file or read from file"
type: "string"
enum:
- w
- r
default: "w"

time:
description: "Time for which tcpdump capture should be run"
type: "number"
required: false
default: 120 # seconds

timeout:
default: 1000

tshark_opts:
description: "Specify other tcpdump options as you specify on a shell."
type: "string"
required: false
default: "-n"

sudo:
default: true
immutable: true

cmd:
default: 'sudo tshark -i {{ interface }} -s {{ snaplen }} -{{ mode }} {{ file }} -a duration:{{ time }} {{ tshark_opts }}'

runner_type: "remote-shell-cmd"