Commit Graph

886 Commits

Author SHA1 Message Date
Kaian dcccd6ea39 pcap: implement capture pcap output 2018-07-29 15:32:49 +02:00
Kaian 08ffe96425 capture: reimplement capture input/output sources
Implemented generic capture input and output structures to manage
all packet sources and sinks directly from a capture manager.

Currently available capture inputs:
	- PCAP (device)
	- PCAP (file)
	- HEP (server mode)

Currently availabe capture outptus:
	- PCAP (file)
	- HEP (client mode)
2018-07-29 15:32:47 +02:00
Kaian 4887b311d3 include config.h.cmake.in for cmake configurable defines 2018-07-29 15:31:40 +02:00
Kaian 41e81bd86d main: update error reporting to g_printerr 2018-07-29 15:31:40 +02:00
Kaian 74d601fe50 gnutls: improve error handling for tls_check_keyfile 2018-07-29 15:31:40 +02:00
Kaian 3aadd5832b main: code cleanup input files and devices 2018-07-29 15:31:40 +02:00
Kaian d57affc561 storage: move configuration options to structures 2018-07-29 15:31:39 +02:00
Kaian 37bc1fc5ee remove unused functions and variables 2018-07-29 15:31:21 +02:00
Kaian 2b1056f126 core: replace vector_t with GSequence
While not the best structure container, GSequence
has most of the methods that vector used and also allows
replacing vector_iterator_t with GSequenceIter.

From this point we can move to other containers like
GSList, GList or GPtrArray when required.
2018-07-29 15:31:02 +02:00
Kaian 53129dda17 core: replace regex_t and pcre with GRegex 2018-07-29 15:28:59 +02:00
Kaian 6c982a3b30 sip: replace htable with GHashTable functions 2018-07-29 15:27:34 +02:00
Kaian 4ba68565f2 capture: replace pthread threads with GThread and GRecMutex 2018-07-29 15:27:33 +02:00
Kaian 6ae48b85fb main: replace getopt with GOption for command line parsing 2018-07-29 15:26:04 +02:00
Kaian 4dfa0300e5 cmake: include new build-system using cmake 2018-07-29 15:26:04 +02:00
Kaian 4c73bdcde3 autotools: include new dependency on glib2-0 2018-07-29 15:26:04 +02:00
Kaian 064ed5a3b1 capture: wait for pcap threads cancellation before exit #253 2018-07-24 13:38:44 +02:00
Kaian 33cf5b74d5 call_flow: properly limit column addresses length #250 2018-07-18 17:22:37 +02:00
Kaian ea8302facd ui_filter: create checkbox for new filter methods #249 2018-07-18 16:55:32 +02:00
Kaian 4a68744fff capture: cancel pcap capture threads when exiting #251
We must cancel the thread here instead of joining because, according to
pcap_breakloop man page, you can only break pcap_loop from within the same
thread.

https://www.tcpdump.org/manpages/pcap_breakloop.3pcap.html
2018-07-18 16:29:52 +02:00
Kaian ef5883e14b sip: allow INFO, REFER and UPDATE as method for initial requests #249 2018-07-10 17:03:55 +02:00
Kaian aaebd2d801 group: improve flow view performance for one call groups 2018-06-07 20:52:59 +02:00
Kaian d4a41b26fa sip: fixed a crash with malformed status lines 2018-06-07 20:16:19 +02:00
Kaian 45491d39df cf: improve arrow visibility when src/dst column is the same 2018-05-11 12:41:01 +02:00
Victor Seva 8c038c7658 support custom Call-ID correlation header via sip.xcid setting
* default value: 'X-Call-ID|X-CID' as previously

fixes #218
2018-04-11 19:31:19 +02:00
Kaian c5f6b4e31a cf: fix buffer overflow with long response-text #240 2018-04-11 15:32:16 +02:00
Kaian 731b15eb15 cr: replace non-ascii characters with a configurable character #211
Although sngrep has Unicode support for ncurses, the SIP message payload
is printed character by character using mvwaddch

This commit adds a new configurable setting cr.nonascii that defaults to .
to replace not printable characters.
2018-04-05 12:13:43 +02:00
Kaian 61f5dbd421 cl: avoid buffer overflow while triming display filter #225 2018-04-04 21:02:24 +02:00
Kaian f20a90b056 ui: add support for ncurses compiled with opaque structures #239 2018-04-03 20:54:22 +02:00
Kaian 3d5c047843 vector: fix vector sorter functions everywhere #234 2018-02-28 21:29:26 +01:00
Kaian f9b8334f04 capture: restore loading information in offline pcap mode #235 2018-02-28 20:11:54 +01:00
dmpaul26 5f1f10dd05 Added methods and key bindings for soft clear of call list (leaves calls matching current filter) 2018-02-07 15:32:13 +01:00
Adam Duskett 0ee014d497 fix libressl support
This is taken from the apache source code.

LibreSSL declares OPENSSL_VERSION_NUMBER == 2.0 but does not include most
changes from OpenSSL >= 1.1.

To work around this:
- check to see if LIBRESSL_VERSION_NUMBER is defined.
- If so, define MODSSL_USE_OPENSSL_PRE_1_1_API.
- Change all checks for OPENSSL_VERSION_NUMBER < 0x10100000L to
  '#if MODSSL_USE_OPENSSL_PRE_1_1_API'

This keeps the code maintainable in the future as well.
2018-02-06 18:16:56 +01:00
Kaian ab970b12b8 doc: update all copyright headers to 2018 2018-01-19 11:52:13 +01:00
Kaian 57ccd90891 doc: update Changelog with 1.4.5 changes 2018-01-19 11:49:43 +01:00
Kaian 5f97547c00 pkg: update files for 1.4.5 release 2017-12-22 15:16:21 +01:00
kaian f4cd906f2e pkg: include rules for debian debug package 2017-12-22 13:53:44 +01:00
Kaian 6ec5cd2ee4 save: avoid displaying dialog with multiple inputs. #223 2017-12-22 12:35:38 +01:00
Kaian 19c5cba2f2 cf: remove truncate compiler warnings while formatting column titles #226 2017-12-20 13:57:02 +01:00
Kaian c89fe85195 save: fix dialog_run format when used with capture_last_error #223 2017-12-12 15:00:39 +01:00
Kaian fd2b89526e cl: fix buffer overflow in display filter #225
Display filter content was being moved into a temporal
buffer with fixed length of 256. The filter field is
determined by the actual screen width, so we must ensure
the buffer has enough space to contain it.

ncurses always returns the same length output for the
filter value, filling the buffer with whitespaces until the
field lenght has been reached.
2017-12-12 14:54:41 +01:00
Victor Seva 08d3f4ca8d fix manpage typo thanks to lintian
> I: sngrep: spelling-error-in-manpage usr/share/man/man8/sngrep.8.gz Altough Although
2017-12-12 13:15:08 +01:00
Kaian be7d70824b tls: remove testing TLS sample files 2017-11-16 13:18:05 +01:00
Kaian 49fb3de242 capture: add support for NFLOG linktype headers #222
If DLT_NFLOG is available (libpcap >1.6.0) standard libpcap structs will be
used. Othewise, a fallback minimum implementation is provided in capture
headers.

Thanks as always to wireshak team for the sources to implement this :)
2017-11-15 18:50:05 +01:00
Kaian 9d9d093872 tls: add new setting capture.tlsserver #220
Added a new setting to only try to decrypt incomming TLS connections to
configured server in format IP:PORT

To enable this add following setting in sngreprc

set capture.tlsserver X.X.X.X:YYYY
2017-11-06 16:25:12 +01:00
kaian 98cd80f897 tls: don't handle all TCP connections as TLS #209 #214
When SYN-SYN+ACK-ACK sequence is captured, we handle the TCP
stream as TLS if keyfile is provided. This may not be the case,
so we must allow SIP parsing in TCP streams that doesn't come
with SSL record data.
2017-10-30 15:18:59 +01:00
kaian a438e38984 tls: fix compatibility with OpenSSL >= 1.1.0 #213 2017-10-30 12:52:39 +01:00
kaian f4c30a528e tls: fix overflow warnings in tls records processing 2017-10-30 12:30:24 +01:00
Kaian 0a9ad07d5e tls: fix compatibility with OpenSSL >= 1.1.0 #213 2017-10-27 17:56:29 +02:00
Kaian b2996a3549 capture: avoid premature handler close in offline mode #207
While reading pcap files the packet loop ends and the capture handler
is closed, making it unusable for saving packets.

This commit avoids closing the handler until the application has
quit, using the running flag to determine if the capture thread is running
or not.
2017-10-09 17:51:04 +02:00
Kaian 2d4eee8015 capture: only read stdin when input file is -
stdin was being reopened always even when input file was a pcap file.

Current tests enter keybinding from stdin so its data was being
ignored making them fail.
2017-10-02 15:20:11 +02:00