Commit Graph

437 Commits

Author SHA1 Message Date
Jaap Keuter 455b9a470f sshdump: add capability to use doas on remote host 2023-02-19 13:41:24 +00:00
João Valverde 0cea64a632 Move ui/cmdarg_err.[ch] to wsutil 2023-02-10 20:59:22 +00:00
João Valverde 71cfbd81b3 Remove wspcap.h and use config.h instead
Forcing the use of a dedicated header to replace pcap.h is
unnecessary code and mental overhead in this case. We can
use config.h instead for the same purpose of defining a
macro symbol before including pcap.h.
2023-02-06 15:05:36 +00:00
João Valverde d70e174ca0 Remove wsutil/netlink.h workaround 2023-02-06 15:04:46 +00:00
João Valverde b07ab25a1c CMake: Cleanup unnecessary linking with shared libraries 2023-02-06 15:04:46 +00:00
Gerald Combs 24ab9c0aaa Falco bridge+falcodump: Scan for personal plugins 2023-01-19 00:17:08 +00:00
João Valverde cdff6da68e MinGW: Cast away a -Wincompatible-pointer-types warning
extcap/androiddump.c:1712:36: warning: passing argument 2 of 'ws_inet_pton4' from incompatible pointer type [-Wincompatible-pointer-types]
 1712 |         ws_inet_pton4(bt_local_ip, &(server.sin_addr.s_addr));
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                    |
      |                                    u_long * {aka long unsigned int *}
2023-01-14 14:52:53 +00:00
João Valverde f3152af8a0 MinGW: Fix -Wsign-compare 2023-01-13 22:41:04 +00:00
Alexis La Goutte f908bfa821 ciscodump(.c): Fix Null pointer passed to 1st parameter expecting 'nonnull' 2023-01-13 08:06:02 +00:00
Gerald Combs 11983087ed Falcodump: More scap event code handling fixes
We don't need to do anything special for timeouts.
2023-01-12 02:36:41 +00:00
Gerald Combs 809b34455e Falcodump: Improve scap event code handling
Check timeouts and filtered events.
2023-01-11 22:04:41 +00:00
Jakub Pawlowski c95e8bd38a androiddump: btsnoop support on android T and onwards
After android T, BT process might be called i.e.
com.google.android.bluetooth, instead of com.android.bluetooth

It depends on what APEX version is installed.
2023-01-05 06:52:02 +00:00
Gerald Combs bf17e3260e CMake: Set a default output directory for log-based extcaps 2022-12-22 19:30:17 +00:00
Gerald Combs f2caa6a0cc Extcap: Fix falcodump gcc warnings and errors.
Fix warnings and errors reported by gcc 11.3.
2022-12-15 01:46:03 +00:00
Dario Lombardo f2eb97e910 Fix ciscodump CID 2022-12-13 20:05:59 +00:00
j.novak@netsystem.cz 212b196bee ciscodump: Added support for IOS XE 17.x 2022-12-12 19:49:17 +00:00
Gerald Combs 9581085430 Falcodump: Open our fifo directly.
Just open our fifo directly using our sinsp dumper. Add a couple of
missing regions.
2022-12-12 18:36:52 +00:00
j.novak@netsystem.cz 2e22eb8357 ciscodump: Added noisy messages for troubleshooting 2022-12-12 07:50:46 +00:00
Alexis La Goutte 8aa55eb2ba etwudmp: fix typo
parmeters => parameters
2022-11-17 14:53:02 +00:00
Adrian Granados 420ec1511d extcap: fix missing control frames from wifidump capture
Normally, 'control' and 'otherbss' flags are set when
using monitor mode, but certain Wi-Fi drivers (e.g. MT7921)
need to explicitly have these flags set in order to capture
control frames.
2022-10-31 13:20:06 +00:00
Gerald Combs f10538a102 falcodump: Fix our credential and config file parsing. 2022-10-13 16:32:43 +00:00
Gerald Combs 7896f4b292 falcodump: Fixup our default profile and region.
Make sure we fetch AWS_PROFILE if it exists. Don't add AWS_PROFILE or
AWS_REGION if they're already in the profile and region lists. Fix our
default values.
2022-10-11 00:40:54 +00:00
João Valverde 3949d289d1 Add log init message to main() 2022-10-08 15:33:47 +00:00
Uli Heilmeier a471aa7628 sshdump: Add '-f ' for capture filter
Fixes #18420
2022-10-08 12:27:30 +00:00
Gerald Combs a1ec850894 falcodump: Prefill the Cloudtrail profile and region fields.
Make the cloudtrail-aws-profile and cloudtrail-aws-region settings
prefilled selection lists. Make them editable as well.
2022-10-07 17:01:17 +00:00
Gerald Combs ca0843f168 falcodump: Fixup our help output. 2022-10-03 15:09:55 -07:00
Gerald Combs b5b1949c5e falcodump: Updates for libsinsp and the cloudtrail plugin.
The libsinsp plugin API recently changed the way plugins are opened.
Update falcodump to match.

Plugins might return a nested and "$ref"ed config schema. Update our
parsing code to match.
2022-10-03 14:24:24 -07:00
j.novak@netsystem.cz e091e8755a extcap: Fixed end application loop logic 2022-10-03 10:16:57 +00:00
Gerald Combs 28a26096fb falcodump: Add support for selection options.
If a plugin has an "enum" + array in its configuration, convert it to a
selector option.

Start adding plugin sections to the falcodump man page.
2022-09-29 16:44:21 +00:00
Mikael Kanstrup b7066e0819 sshdump: Fix remote-capture-command option
The remote-capture-command option does not work when selecting
remote capture command selection 'other' from the extcap capture
options dialog. Fix strcmp statement to actually check for 'other'.

Fixes: #18381
2022-09-26 20:25:18 +02:00
Alexis La Goutte 2d22f72d4d ciscodump(extcap): Fix DeadStore 2022-09-20 06:27:46 +00:00
Guy Harris e5951765d8 Dissector names are not protocol names.
A given protocol's packet format may depend, for example, on which
lower-level protocol is transporting the protocol in question.  For
example, protocols that run atop both byte-stream protocols such as TCP
and TLS, and packet-oriented protocols such as UDP or DTLS, might begin
the packet with a length when running atop a byte-stream protocol, to
indicate where this packet ends and the next packet begins in the byte
stream, but not do so when running atop a packet-oriented protocol.

Dissectors can handle this in various ways:

For example, the dissector could attempt to determine the protocol over
which the packet was transported.

Unfortunately, many of those mechanisms do so by fetching data from the
packet_info structure, and many items in that structure act as global
variables, so that, for example, if there are two two PDUs for protocol
A inside a TCP segment, and the first protocol for PDU A contains a PDU
for protocol B, and protocol B's dissector, or a dissector it calls,
modifies the information in the packet_info structure so that it no
longer indicates that the parent protocol is TCP, the second PDU for
protocol A might not be correctly dissected.

Another such mechanism is to query the previous element in the layers
structure of the packet_info structure, which is a list of protocol IDs.

Unfortunately, that is not a list of earlier protocols in the protocol
stack, it's a list of earlier protocols in the dissection, which means
that, in the above example, when the second PDU for protocol A is
dissected, the list is {...,TCP,A,B,...,A}, which means that the
previous element in the list is not TCP, so, again, the second PDU for
protocol A will not be correctly dissected.

An alternative is to have multiple dissectors for the same protocol,
with the part of the protocol that's independent of the protocol
transporting the PDU being dissected by common code.  Protocol B might
have an "over a byte-stream transport" dissector and an "over a packet
transport" dissector, with the first dissector being registered for use
over TCP and TLS and the other dissector being registered for use over
packet protocols.  This mechanism, unlike the other mechanisms, is not
dependent on information in the packet_info structure that might be
affected by dissectors other than the one for the protocol that
transports protocol B.

Furthermore, in a LINKTYPE_WIRESHARK_UPPER_PDU pcap or pcapng packet for
protocol B, there might not be any information to indicate the protocol
that transports protocol B, so there would have to be separate
dissectors for protocol B, with separate names, so that a tag giving the
protocol name would differ for B-over-byte-stream and B-over-packets.

So:

We rename EXP_PDU_TAG_PROTO_NAME and EXP_PDU_TAG_HEUR_PROTO_NAME to
EXP_PDU_TAG_DISSECTOR_NAME and EXP_PDU_TAG_HEUR_DISSECTOR_NAME, to
emphasize that they are *not* protocol names, they are dissector names
(which has always been the case - if there's a protocol with that name,
but no dissector with that name, Wireshark will not be able to handle
the packet, as it will try to look up a dissector given that name and
fail).

We fix that exported PDU dissector to refer to those tags as dissector
names, not protocol names.

We update documentation to refer to them as DISSECTOR_NAME tags, not
PROTO_NAME tags.  (If there is any documentation for this outside the
Wireshark source, it should be updated as well.)

We add comments for calls to dissector_handle_get_dissector_name() where
the dissector name is shown to the user, to indicate that it might be
that the protocol name should be used.

We update the TLS and DTLS dissectors to show the encapsulated protocol
as the string returned by dissector_handle_get_long_name(); as the
default is "Application Data", it appeaers that a descriptive name,
rather than a short API name, should be used.  (We continue to use the
dissector name in debugging messages, to indicate which dissector was
called.)
2022-09-10 22:37:11 -07:00
Gerald Combs 5243ffa4c2 extcap: Add falcodump.
Add an extcap that fetches a scap from a Falco/libsinsp plugin. Tested
using the cloudtrail plugin.
2022-08-29 15:35:19 -07:00
j.novak@netsystem.cz 90143855af extcap: Signal processing unified for C based extcaps 2022-08-29 19:46:59 +00:00
Joakim Karlsson abe78a4109 sshdump: may be used uninitialized in this function [-Wmaybe-uninitialized] 2022-08-12 18:25:56 +00:00
Jaap Keuter 34ab3f308a sshdump: add option to select dumpcap as remote capture command 2022-08-10 17:26:49 +00:00
Jirka Novak 6d0619cdd0 ciscodump: Added support for IOS XE and ASA
Changes:
- The tool now recognizes which software is running on a device - IOS, IOS XE
  or ASA. Based on it, it uses correct sequence of commands to setup
  capture, read captured packets and clear the capture.
- The tool reads packets on the fly so you don't have to wait till
  --remote-count of packets is reached.
- The tool reads timestamps from capture on the device for IOS and ASA (on
  IOS-XE, there is no timestamp in dump).
- Except Windows platform the tool handles early stop of capture on the device
  and clear of capture buffer on the device (it finish the capture).
- There are special interface names to allow the tool to generate
  specific capture types.
- Data collection and config cleanup is handled in two separated ssh
  sessions.
- Documentation updated.

Closes #17672.
2022-07-22 15:55:28 +00:00
Jirka Novak f2b30e70eb ciscodump: Added support for IOS XE and ASA
Changes:
- The tool now recognizes which software is running on a device - IOS, IOS XE
  or ASA. Based on it, it uses correct sequence of commands to setup
  capture, read captured packets and clear the capture.
- The tool reads packets on the fly so you don't have to wait till
  --remote-count of packets is reached.
- The tool reads timestamps from capture on the device for IOS and ASA (on
  IOS-XE, there is no timestamp in dump).
- Except Windows platform the tool handles early stop of capture on the device
  and clear of capture buffer on the device (it finish the capture).
- There are special interface names to allow the tool to generate
  specific capture types.
- Documentation updated.

Closes #17672.
2022-07-22 15:55:28 +00:00
Jirka Novak 62e81d53ba Removed useless function 2022-07-22 15:55:28 +00:00
Jirka Novak 274f423401 Fixed issue in processing filters for ASA 2022-07-22 15:55:28 +00:00
Jirka Novak 1e53e49a54 ciscodump: Added support for IOS XE and ASA
Changes:
- The tool now recognizes which software is running on a device - IOS, IOS XE
  or ASA. Based on it, it uses correct sequence of commands to setup
  capture, read captured packets and clear the capture.
- The tool reads packets on the fly so you don't have to wait till
  --remote-count of packets is reached.
- The tool reads timestamps from capture on the device for IOS and ASA (on
  IOS-XE, there is no timestamp in dump).
- Except Windows platform the tool handles early stop of capture on the device
  and clear of capture buffer on the device (it finish the capture).
- There are special interface names to allow the tool to generate
  specific capture types.
- Documentation updated.

Closes #17672.
2022-07-22 15:55:28 +00:00
Odysseus Yang 36e834b6b7 ETW: Extract IP packets from Windows event trace
With this change, Wireshark will be enhanced to display IP packets from an event trace logfile
or an event trace live session.
2022-05-05 13:35:47 +00:00
Roland Knall f595f3b6ad sshdump: Update doc for openssh key note
Add a note, that the key value pair format has to be openssh format

Fixes #18063
2022-04-28 19:59:07 +02:00
Gerald Combs 3086774fa6 wsutil: Add configuration namespaces.
Rename init_progfile_dir to configuration_init. Add an argument which
specifies our configuration namespace, which can be "Wireshark"
(default) or "Logwolf".
2022-04-04 09:39:27 -07:00
Gerald Combs 1e39a66746 etwdump: Clarify "ETW".
Not everyone knows what ETW is.
2022-03-21 15:35:48 -07:00
Guy Harris 109b92b5d7 wiretap: have wtap_dump_close() provide a "needs to be reloaded" indication.
This allows the "needs to be reloaded" indication to be set in the close
process, as is the case for ERF; having a routine that returns the value
of that indication is not useful if it gets seet in the close process,
as the handle for the wtap_dumper is no longer valid after
wtap_dump_close() finishes.

We also get rid of wtap_dump_get_needs_reload(), as callers should get
that information via the added argument to wtap_dump_close().

Fixes #17989.
2022-03-14 19:12:20 +00:00
Dylan Ulis 2ebf8d4bdd sshdump: fix remote-sudo parameter on restart 2022-03-13 21:39:29 +00:00
Adrian Granados 8622c92a75 extcap: new interface, wifidump, to capture Wi-Fi frames using a remote SSH host 2022-03-09 08:01:39 +00:00
Moshe Kaplan 69d54d6f8e Corrects repeated words throughout the code.
Repeated words were found with:
egrep "(\b[a-zA-Z]+) +\1\b" . -Ir
and then manually reviewed.
Non-displayed strings (e.g., in comments)
were also corrected, to ease future review.
2021-12-22 11:01:11 +00:00
João Valverde 2c44afbba3 Use UINT64_C() with two constants 2021-12-22 01:53:46 +00:00