File: extcap.adoc

package info (click to toggle)
wireshark 4.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 351,244 kB
  • sloc: ansic: 3,101,885; cpp: 129,710; xml: 100,972; python: 56,512; perl: 24,575; sh: 5,874; lex: 4,383; pascal: 4,304; makefile: 165; ruby: 113; objc: 91; tcl: 35
file content (179 lines) | stat: -rw-r--r-- 7,366 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
include::../attributes.adoc[]
= extcap(4)
:doctype: manpage
:stylesheet: ws.css
:linkcss:
:copycss: {css_dir}/{stylesheet}

== NAME

extcap - The external capture interface

== DESCRIPTION

The extcap (external capture) interface is a versatile plugin interface that allows external binaries
to act as capture interfaces directly in Wireshark. It is used in scenarios, where
the source of the capture is not a traditional capture model
(live capture from an interface, from a pipe, from a file, etc). The typical
example is connecting esoteric hardware of some kind to the main Wireshark application.

Without extcap, a capture can always be achieved by directly writing to a capture file:

    the-esoteric-binary --the-strange-flag --interface=stream1 --file dumpfile.pcap &
    wireshark dumpfile.pcap

but the extcap interface allows for such a connection to be easily established and
configured using the Wireshark GUI.

The extcap subsystem is made of multiple extcap binaries that are automatically
called by the GUI in a row. In the following chapters we will refer to them as
"the extcaps".

Extcaps may be any binary or script within the _extcap/wireshark_ or _extcap/stratoshark_ directories.
Please note that scripts need to be executable without prefacing a script interpreter before the call.

WINDOWS USERS: Because of restrictions directly calling the script may not always work.
In such a case, a batch file may be provided, which then in turn executes the script. Please
refer to doc/extcap_example.py for more information.

When Wireshark launches an extcap, it automatically adds its installation path (normally _C:\Program Files\Wireshark\_) to the DLL search path so that the extcap library dependencies can be found (it is not designed to be launched by hand).
This is done on purpose. There should only be extcap programs (executables, Python scripts, ...) in the extcap folder to reduce the startup time and not have Wireshark trying to execute other file types.

== GRAMMAR ELEMENTS

Grammar elements:

arg (options)::
argument for CLI calling

number::
Reference # of argument for other values, display order

call::
Literal argument to call (--call=...)

display::
Displayed name

default::
Default value, in proper form for type

range::
Range of valid values for UI checking (min,max) in proper form

type::
+
--
Argument type for UI filtering for raw, or UI type for selector:

    integer
    unsigned
    long (may include scientific / special notation)
    double
    string (display a textbox)
    selector (display selector table, all values as strings)
    editselector (selector table which can be overridden, all values as strings)
    boolean (display checkbox)
    booleanflag (display checkbox)
    radio (display group of radio buttons with provided values, all values as strings)
    fileselect (display a dialog to select a file from the filesystem, value as string)
    multicheck (display a textbox for selecting multiple options, values as strings)
    table (display a table that is populated by the user, selections can be configured, values as commandlines arguments)
    password (display a textbox with masked text)
    timestamp (display a calendar)
--

value (options)::
+
--
    Values for argument selection
    arg     Argument # this value applies to
--

== EXAMPLES

Example 1:

    arg {number=0}{call=--channel}{display=Wi-Fi Channel}{type=integer}{required=true}
    arg {number=1}{call=--chanflags}{display=Channel Flags}{type=radio}
    arg {number=2}{call=--interface}{display=Interface}{type=selector}
    value {arg=0}{range=1,11}
    value {arg=1}{value=ht40p}{display=HT40+}
    value {arg=1}{value=ht40m}{display=HT40-}
    value {arg=1}{value=ht20}{display=HT20}
    value {arg=2}{value=wlan0}{display=wlan0}

Example 2:

    arg {number=0}{call=--usbdevice}{USB Device}{type=selector}
    value {arg=0}{call=/dev/sysfs/usb/foo/123}{display=Ubertooth One sn 1234}
    value {arg=0}{call=/dev/sysfs/usb/foo/456}{display=Ubertooth One sn 8901}

Example 3:

    arg {number=0}{call=--usbdevice}{USB Device}{type=selector}
    arg {number=1}{call=--server}{display=IP address for log server}{type=string}{validation=(?:\d{1,3}\.){3}\d{1,3}}
    flag {failure=Permission denied opening Ubertooth device}

Example 4:

    arg {number=0}{call=--username}{display=Username}{type=string}
    arg {number=1}{call=--password}{display=Password}{type=password}

Example 5: timestamp

    arg {number=0}{call=--start}{display=Start Time}{type=timestamp}
    arg {number=1}{call=--end}{display=End Time}{type=timestamp}

Example 6: multicheck

    arg {number=0}{call=--device}{display=Device}{type=multicheck}
    value {arg=0}{value=USBDEV}{display=USB devices}{enabled=false}
    value {arg=0}{value=/dev/sysfs/usb/foo/123}{display=Ubertooth One sn 1234}{parent=USBDEV}
    value {arg=0}{value=/dev/sysfs/usb/foo/456}{display=Ubertooth One sn 8901}{parent=USBDEV}
    value {arg=0}{value=PCIDEV}{display=PCI devices}{enabled=false}
    value {arg=0}{value=/sys/devices/pci123}{display=Device 1}{parent=PCIDEV}
    value {arg=0}{value=/sys/devices/pci456}{display=Device 2}{parent=PCIDEV}

== Table field

The "table" field is a bit different, in that its values can have additional configuration options.
The values can either be entered manually by the user, or a list of available values can be provided using the same
API as "multicheck".
Unlike most APIs, the value is provided using a commandline-like API, separated by spaces instead of comas. For instance,
a configured "myparam" attribute where the user selected three values (1, 2 and 3) would receive:

    --myparam "1 2 3"

If a "prefix" is configured to be "--p", it would receive the following:

    --myparam "--p 1 --p 2 --p 3"

The values selected in a table field may have specific configuration options, if "configurable=true" for the "multicheck" field.
In this case, the extcap will be called again when the user presses the configuration wheel that matches a value in the table,
with the additional "--extcap-config-option-name <option_name> --extcap-config-option-value <option_value>" with no prefix.
An extcap program should respond with an additional set of arguments, which will be opened in a popup. Once those are configured,
the extcap might get the following, assuming for instance that an additional "param1" is requested when value is 1, and "param2"
when value is 2.

    --myparam "--p 1 --param1 1 --p 2 --param2 true --p 3"

== Security Considerations

- If you're running Wireshark as root, we can't save you.
- Dumpcap retains suid/setgid and group execute permissions for users in the “wireshark” group only.
- Third-party capture programs run with whatever privileges they're installed with.
- If an attacker can write to a system binary directory, it's game over.
- You can find your local extcap directory in menu:About[Folders].

== SEE ALSO

xref:wireshark.html[wireshark](1), xref:tshark.html[tshark](1), xref:dumpcap.html[dumpcap](1), xref:androiddump.html[androiddump](1), xref:sshdig.html[sshdig](1), xref:sshdump.html[sshdump](1), xref:randpktdump.html[randpktdump](1)

== NOTES

*Extcap* is feature of *Wireshark*.
The latest version of *Wireshark* can be found at https://www.wireshark.org.

HTML versions of the Wireshark project man pages are available at
https://www.wireshark.org/docs/man-pages.