summaryrefslogtreecommitdiff
path: root/extcap/sshdump.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-02Use glib-compatAndersBroman1-5/+1
Change-Id: I510af18d433c4db360243dda72260e59eb84355f Reviewed-on: https://code.wireshark.org/review/20336 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-02-16g_slist_free_full requires glib 2.28AndersBroman1-0/+5
Change-Id: I4f9ce7f65da0349b962f6be317635c5acb2daf73 Reviewed-on: https://code.wireshark.org/review/20148 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-20sshdump: add sudo option.Dario Lombardo1-9/+19
Basic installation of tcpdump (the default remote capture binary) don't have setcap option. Give the user the option to run tcpdump with sudo (already possible with a custom remote capture command). Change-Id: I273798b5f7dc63b468b03eb633bfc60f53e30743 Reviewed-on: https://code.wireshark.org/review/19672 Reviewed-by: Dario Lombardo <lomato@gmail.com>
2017-01-07extcap: fix memleak via data_file_urlPeter Wu1-1/+4
Commit v2.1.0rc0-2181-ga4e2263ac4 introduced a helppage parameter, but all callers were NULL. In a later change, callers would use the data_file_url() function, but this needs to be freed, so do that. Fixes: v2.3.0rc0-1825-ge5596b74bd ("extcap: set help page for all extcaps.") Change-Id: I967c0f8c6b50d9e78ac227575de24a81f97d376a Reviewed-on: https://code.wireshark.org/review/19570 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-12-20extcap: set help page for all extcaps.Dario Lombardo1-1/+2
They've been set to the manpage of the local filesystem. Ping-Bug: 13218 Change-Id: Iacd5d2ba7ae39ee1718b59747c245d1c07785e8f Reviewed-on: https://code.wireshark.org/review/19179 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-11-02sshdump: use g_shell_quote in the right way.Dario Lombardo1-1/+1
Change-Id: I3f71dabe92d3b00192f36fc57ebb7673b2327620 Reviewed-on: https://code.wireshark.org/review/18623 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-10-31sshdump: remove default filter from capture mode.Dario Lombardo1-6/+1
This allow to capture without any filter. Bug: 13048 Change-Id: I29fb1a7367375b9f3d83a4f610789ae159735198 Reviewed-on: https://code.wireshark.org/review/18561 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-19extcap: put missed parameters into the helpMichal Labedzki1-1/+0
"--debug" and "--extcap-version" are part of extcap-base helper, do not hide them. Change-Id: I287b68dbed5344c188fede69d112ab007a6ee18b Reviewed-on: https://code.wireshark.org/review/18279 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-10-04sshdump: add remote capture command.Dario Lombardo1-18/+37
This new option adds the chance to use a custom capture command. It must produce a PCAP stream that will be read by Wireshark, written to STDOUT. Change-Id: I34a72465eb369194f24ecf0594df143b8ad6555f Reviewed-on: https://code.wireshark.org/review/18037 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-04sshdump: use tcpdump as default capture binary.Dario Lombardo1-28/+6
This removes the option to specify a custom capture binary due to incompatibilities between different binaries options. A following change will add the chance to use a custom capture command that will cover all the cases that the default doesn't. Bug: 12952 Change-Id: Idbde3e27f34c28f4ce622c3a860994e25ce5f92f Reviewed-on: https://code.wireshark.org/review/18040 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-09-26sshdump: restyle the output write routine.Dario Lombardo1-27/+55
Bug: 12884 Change-Id: I90733bbcbbd8fafc0421b3fb9c6f9b48f178583c Reviewed-on: https://code.wireshark.org/review/17710 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-09-16extcap: make extcap use the ws_strtoi/u functions.Dario Lombardo1-10/+13
Change-Id: Id75c72eba869c8a0f413ce8b5d6329ce172aed1f Reviewed-on: https://code.wireshark.org/review/17415 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-09-13sshdump: remove -P.Dario Lombardo1-1/+1
This option is incompatible with other capture binaries (like tcpdump). Change-Id: If93fca69f93b7833e7f8bb28b70311373f42f3f5 Reviewed-on: https://code.wireshark.org/review/17682 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-08-26extcap: improve interface print in help.Dario Lombardo1-4/+5
Change-Id: Ife8e73b6cb1756623e937452fc042d8b31e2554f Reviewed-on: https://code.wireshark.org/review/17321 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-08-25extcap: add binary name and version to help message.Dario Lombardo1-1/+2
Change-Id: I8f8083c817065cf66fd006a1caeb309d26209509 Reviewed-on: https://code.wireshark.org/review/17305 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-24extcap: make extcaps use the version registered in config.Dario Lombardo1-1/+1
Change-Id: I12d0d0bec06e02af0a9d0877c0f0f1d86261d752 Reviewed-on: https://code.wireshark.org/review/17296 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-06extcap: move defines from sshdump & ciscodump to ssh-base.Dario Lombardo1-8/+0
Change-Id: I51769e2427b0119aefe57ebcc08406434ffbfead Reviewed-on: https://code.wireshark.org/review/16918 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-04extcap: restyle the help function.Dario Lombardo1-34/+25
Change-Id: Ia742dffb1fd4cd5780b8ba44f7064d1874e473da Reviewed-on: https://code.wireshark.org/review/16842 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-04extcap: restyle the output subsystem.Dario Lombardo1-30/+17
Change-Id: I3e0674751eb97bf30ae6d70c4e51f347d63b1697 Reviewed-on: https://code.wireshark.org/review/16849 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-07-22sshdump: Change ws_close to closesocketRoland Knall1-1/+1
ws_close just calls _close(); that doesn't close sockets. closesocket() is the API to close a socket on Windows, and is defined as close() on UN*X, so using closesocket() will close sockets on Windows and UN*X. This way, we close the pipe socket correctly on Windows. Change-Id: I6d50e26bfabac5618c74a180cbe94d444b591bd4 Reviewed-on: https://code.wireshark.org/review/16582 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-16Have extcap executables mirror the GTK's WinMain signature.Michael Mann1-2/+6
This is for appeasing VS Code Analysis. Change-Id: Ib7b3d8a3025dd764da283335051d0f77b45f6dee Reviewed-on: https://code.wireshark.org/review/16499 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-25Compile sshdump and ciscodump for WindowsPascal Quantin1-6/+7
Use libSSH 0.7.2 compiled with MinGW(32|64) and linked with zlib and gcrypt support Change-Id: I7c17d1ba3dd1890e2f83c119f5ea851834807e43 Reviewed-on: https://code.wireshark.org/review/12117 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-12sshdump,ciscodump: fix local addresses discoveryPeter Wu1-2/+2
Fixes a NULL-deref when no interface addresses are discovered. Remove NULL interface from list (an empty GSList is represented by NULL while g_slist_alloc returns a list with a single NULL data). Change-Id: I2eded40bb697e051445a526d1f34d8a50ef9ccd4 Reviewed-on: https://code.wireshark.org/review/14888 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-03-29Another round of extcap memleak fixesPeter Wu1-29/+36
Fix a bunch of memory leaks, mainly because extcap_base_cleanup is not called on most execution paths and because memory allocated for options were not freed. Additionally, randpkt will now fail if no option is given (it previously returned 0 if --capture was missing). Logic using "goto" is introduced with the idea that a program should fail (ret = EXIT_FAILURE) unless proven otherwise. Now none of the extcap programs are leaking: for what in ssh cisco; do for arg in '' --help --extcap-interfaces --extcap-interface=$what; do extcap/${what}dump $arg; done; done ./tshark -D Change-Id: I6df1027ed0c32bd53fe87e6c54d355bc8ddd01f5 Reviewed-on: https://code.wireshark.org/review/14671 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-03-24sshdump: use arg define.Dario Lombardo1-9/+1
Change-Id: I49ccfc3f616d2d6660c46d6a47d2409e25ad842a Reviewed-on: https://code.wireshark.org/review/14512 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-03-07sshdump: minor changesDario Lombardo1-12/+10
Change-Id: I07bd2a95622187c6bacb3013998f93bfa07af87c Reviewed-on: https://code.wireshark.org/review/14338 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-04extcap: move ssh common functions to ssh-base.Dario Lombardo1-125/+8
Change-Id: Ic06882a4f914b4f89d936d5d942b50552ae4abb3 Reviewed-on: https://code.wireshark.org/review/14264 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-03-04extcap: add local_interfaces_to_list() to wsutil.Dario Lombardo1-74/+24
This new function abstracts the creation of a list of the local interfaces that will be used by future extcaps to generate specific filters. Sshdump now uses it to create a pcap filter. Change-Id: I5b75a266f81104b3c9bcb3e51de246b7cc8785ce Reviewed-on: https://code.wireshark.org/review/14092 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-29extcap: Move extcap handling to baseRoland Knall1-93/+30
Also add the extcap-version parameter to enable parsing of version and helppage separately Change-Id: I35ba5aa992940ffbb0cd9ebea8b7c3a1e8629d74 Reviewed-on: https://code.wireshark.org/review/14094 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-26extcap: move windows functions into extcap-baseDario Lombardo1-44/+0
Change-Id: Iec7fed027a24992afd673b09c32470af51739ae5 Reviewed-on: https://code.wireshark.org/review/14075 Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-25Clean up modelines and indentation.Guy Harris1-4/+4
HT tab stops are set every 8 spaces on UN*X; UN*X tools that treat an HT character as tabbing to 4-space tab stops, or that even are configurable but *default* to 4-space tab stops (I'm looking at *you*, Xcode!) are broken. tab-width: 4, tabstop=4, and tabSize=4 are errors if you ever expect anybody to look at your file with a UN*X tool, and every text file will probably be looked at by a UN*X tool at some point, so Don't Do That. Adjust indentation to reflect the mode lines. Change-Id: Icf0831717de10fc615971fa1cf75af2f1ea2d03d Reviewed-on: https://code.wireshark.org/review/14150 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-25extcap: move includes into extcap-base.Dario Lombardo1-36/+0
Change-Id: I802cc3a3bb3989411216ed070ecc018345e0d54f Reviewed-on: https://code.wireshark.org/review/14073 Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-25extcap: move common code into extcap-base filesDario Lombardo1-42/+28
Change-Id: Ia4a73c7df39426c8773fce04cac223bda3c6ef1c Reviewed-on: https://code.wireshark.org/review/14071 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-08sshdump: fix default value for capture filter.Dario Lombardo1-1/+4
Change-Id: I21c4d6fa6726165882ed104262b1e2b22557d8cd Reviewed-on: https://code.wireshark.org/review/13522 Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-27sshdump: fix error in extcap sentence.Dario Lombardo1-2/+2
Change-Id: Ibbabd4d160661985d9a7d8caeb577845f45b847e Reviewed-on: https://code.wireshark.org/review/13561 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-22sshdump: fix leak in ssh_open_remote_connection() (CID 1349731)Dario Lombardo1-10/+12
Change-Id: I55656d4600edb800fd93532345f7ea2c7fc16f7d Reviewed-on: https://code.wireshark.org/review/13466 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-19sshdump: fix typo in extcap-config.Dario Lombardo1-1/+1
Change-Id: Ie6e60244e9ec6f80d37db9e46342c363825bc9ce Reviewed-on: https://code.wireshark.org/review/13415 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-01-18extcap: add masked to options.Dario Lombardo1-1/+1
This allows an option to be masked (like a password), by using the argument-type password. Change-Id: I2eae1be2e6672bff28ba5f749d7a3f687ebd4631 Reviewed-on: https://code.wireshark.org/review/13385 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-15sshdump: change message to error.Dario Lombardo1-1/+1
Change-Id: I6f3df909b2cb20a869dd1b812cdf6cdf8946e83c Reviewed-on: https://code.wireshark.org/review/13313 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-01-14ssh/randpktdump: Add version to extcap utilityRoland Knall1-0/+1
Add a version to each utility, displayed in the about dialog of Wireshark Change-Id: I64936072b13116b3e173c50411e9fff45d5fbf4c Reviewed-on: https://code.wireshark.org/review/13290 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Roland Knall <rknall@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-06sshdump: print error message to stderr instead of stdout.Dario Lombardo1-47/+47
Change-Id: I9e83373802b9cac5707cc30f0cc94314b39baf5b Reviewed-on: https://code.wireshark.org/review/13056 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-12-30extcap: Add Required and cleanupRoland Knall1-1/+1
An option may now use the "required=true" argument (see sshdump.c) which will ensure, that the capture can only be started via the dialog, if the option has been provided. To ensure, that this is working properly, multiselect has been moved to a separate source file. Renamed one method so it may not interfere with a future save functionality, and cleaned up the interface to use only default buttons and roles ONLY the Qt interface is being supported. Change-Id: Ie1c9a63c1bba2e557d55b1de6f4775d8b9fce515 Reviewed-on: https://code.wireshark.org/review/12912 Reviewed-by: Roland Knall <rknall@gmail.com> Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-24sshdump: add default filter even when interfaces are not listed.Dario Lombardo1-8/+7
Change-Id: I7fc6157a4ef0fff9b94f2ee222379f8d6d2962a9 Reviewed-on: https://code.wireshark.org/review/12090 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-23sshdump: fix int issueDario Lombardo1-1/+1
Change-Id: Ic4367c90e79f6d3ee0d3e55f9f3ab0ebf74190f7 Reviewed-on: https://code.wireshark.org/review/12065 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-11-21sshdump: add define for default capture binDario Lombardo1-4/+6
Change-Id: I52a5d12bb885f5bedffa030906d15f9d67bfe2e8 Reviewed-on: https://code.wireshark.org/review/11988 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-20sshdump: add packets countDario Lombardo1-6/+23
Change-Id: Ia430200a08ada4caaa780589a2fe4b90c797d94d Reviewed-on: https://code.wireshark.org/review/11989 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-19extcap: add sshdump.Dario Lombardo1-0/+850
sshdump is an extcap module that allows dumping from a remote host using an ssh connection. It goes with the existing extcap plugin interface. Change-Id: I8987614fdd817b8173a50130812bc643a4833bca Reviewed-on: https://code.wireshark.org/review/11402 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>