47 Commits

Author SHA1 Message Date
yrutschle
e7ce929020 config file now read to struct with c2s; command line no longer works 2018-11-29 11:56:33 +01:00
yrutschle
80ad31aec0 refactoring: replace magic constants with symbols 2018-11-04 22:25:16 +01:00
yrutschle
aa77922ffd turn ssl setting from command line to tls (ssl no longer exists) 2018-09-30 21:34:22 +02:00
yrutschle
f480eb6c7d refactoring: simpler TLS extension parsing algorithm 2018-09-28 13:58:33 +02:00
yrutschle
6d6ea50066 Merge branch 'master' of https://github.com/yrutschle/sslh 2018-09-23 21:57:16 +02:00
yrutschle
0003680137 remove old tls and ssl targets, only use alpn/sni probe also for TLS with no extensions 2018-09-23 12:07:06 +02:00
Oleg Oshmyan
e8f0d3ea53 Fix HTTP method probing 2018-09-22 15:50:40 +03:00
Yves Rutschle
60df92c2b2 prevent repeated reads on broken sockets 2018-08-14 23:05:49 +02:00
Yves Rutschle
8ad32816a6 last_p might be used uninitialised if last probe has no probe set (which I don't think might happen, but anyhow...) 2018-08-14 22:52:52 +02:00
Yves Rutschle
677e385fec new probing algorithm 2018-08-13 22:29:09 +02:00
Yves Rutschle
94911c1c2a cleaner framework to test all probes methodically (not all tests work as the probe code needs to be reworked) 2018-08-11 23:13:24 +02:00
Yves Rutschle
95e8f5731c document magic constant in socks5 probe 2018-06-13 12:40:02 +00:00
Yves Rutschle
dfd9e14866 fix socks5 probe 2018-06-13 09:52:49 +02:00
Eugene Protozanov
a43dd11fc9 Added support for socks5 protocol 2018-04-16 15:27:31 +04:00
yrutschle
d26eab728c
Merge pull request #143 from astiob/select-fork
sslh-select: support forking for particular protocols
2018-01-02 22:26:58 +01:00
Prameet Shah
79ca4df0d7 adb: update protocol sniffer
Modified is_adb_protocol in patch.c to check if initial host->device
packet sends an empty message for reasons unknown.  This was introduced
in ADB master in https://android-review.googlesource.com/c/342653.
2018-01-02 06:25:27 -05:00
yrutschle
f8a16c7a29
Merge pull request #146 from guusdk/SSLv2-clienthello
Allow SSLv2 CLIENT-HELLO (without SSL 2.0)
2017-12-16 19:09:25 +01:00
Robert de Bath
4e790e074f Move hexdump to verbose level 2
From the command line you use two "-v" options or in the configuration
file you replace the boolean "verbose:true" with an integer "verbose:2".
2017-11-27 21:05:07 +00:00
Robert de Bath
64485d7a58 Send hexdump to stderr like other verbose logs. 2017-11-23 20:52:54 +00:00
orbitarm
5b756ebd0a verbose: dump hex value of packet
uses the hexdump() function to display the hex value of each probed
packet, making it easy to create regex rules for unsupported connections
2017-11-23 20:52:54 +00:00
Guus der Kinderen
1f98b97756 Allow SSLv2 CLIENT-HELLO (without SSL 2.0)
The existing TLS probe is documented to ignore SSL 2.0, citing RFC 6176 as a reason.
RFC 6176 does prohibit the usage of SSL 2.0, but does allow for ClientHello messages
in the version 2 CLIENT-HELLO format (as long as those are used to negotiate the use
of a higher protocol).

This commit extends the TLS probe, by making it accept SSL v2 ClientHello messages
that negotiate a version of SSL/TLS 1.0 or higher (which is the same version range
as the original code).
2017-11-10 19:47:07 +01:00
Oleg Oshmyan
2544f20bdf sslh-select: support forking for particular protocols
To keep the code simple, use the same event loop in the child process
as in the parent process but close all irrelevant file descriptors.
2017-10-28 23:27:06 +03:00
Yves Rutschle
067f5d7646 Revert "clarify no space after -F (issue 108)"
This reverts commit f02ce3821c018719536971dbb1bc1ed1517530a2.

That commit accidently imported code that broke transparent
proxying.
2017-01-08 12:54:34 +01:00
Yves Rutschlé
f02ce3821c clarify no space after -F (issue 108) 2016-11-06 19:44:47 +00:00
Yves Rutschle
414ed7de11 Support keepalive for connections on the connecting side 2016-02-04 09:19:54 +01:00
Yves Rutschle
e5cb33fcb7 Add PCRE support for musl 2016-01-22 16:41:36 +01:00
moparisthebest
8af039d3eb Add ALPN protocol based probe 2016-01-05 00:32:10 -05:00
Yves Rutschle
2cb424c646 Added log_level option to configuration file, which switches off log at each connection 2015-12-15 15:51:18 +01:00
John Regan
ab3324be47 Enable PCRE as RegEx Library 2015-08-13 14:28:17 -04:00
Yves Rutschle
8fdaf6eb08 changed configuration file to accomodate SNI in a cleaner way 2015-07-17 15:04:04 +02:00
Yves Rutschle
77ef29358d make code C-compliant 2015-07-15 15:09:39 +02:00
Yves Rutschle
fbebdaf66c Add support for Server Name Indication (SNI, RFC4366) 2015-07-15 14:07:16 +02:00
Yves Rutschle
fecfb170c8 added reference to Tinc documentation 2015-07-15 13:34:53 +02:00
moparisthebest
b988540105 Add SNI hostname based probe 2015-07-12 23:10:53 -04:00
Yves Rutschle
3aefaf3004 Added Makefile option to build without libpcre 2015-07-09 15:31:42 +02:00
Kevin Cernekee
3469f56012 Add builtin handler for Android Debug Bridge (ADB) protocol
This allows Android devices to run multiple services on one port.  A
common use case involves muxing SSH for SCP / SFTP, and ADB for
sideloading packages or running CTS.

Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
2015-06-09 15:30:27 -07:00
Justin Matlock
bdeccfd9ff add longer check for xmpp preamble
original wasn't catching the preamble from Adium or Pidgin XMPP clients, because of a newline after the initial <xml> line. Grew the length of the check string so it'd see the word 'jabber' faster.
2015-03-06 02:58:52 -05:00
Ondřej Kuzník
7876bddff3 Fix regex probes always matching (#19) 2014-04-09 19:18:52 +01:00
Yves Rutschle
96f5d6387e new test for PROBE_AGAIN; changed deferred_data to begin_deferred_data where appropriate 2013-09-28 21:33:25 +02:00
Ondřej Kuzník
e4fb8b8496 defered -> deferred 2013-09-28 20:42:04 +02:00
Ondřej Kuzník
bcad6fbade Enable the PROBE_AGAIN return code 2013-09-28 20:21:47 +02:00
Ondřej Kuzník
dbafd6510d Allow probes to say they cannot decide yet 2013-09-28 20:21:47 +02:00
Ondřej Kuzník
c84a6af847 Introduce the probe return codes. 2013-09-28 20:21:47 +02:00
Ondřej Kuzník
708c3b0177 Make probes work even in the face of arbitrary data 2013-09-28 20:21:47 +02:00
Mike Frysinger
2d23cdc9f4 check asprintf return value
The current asprintf usage triggers many warnings like:

sslh-main.c: In function 'print_usage':
sslh-main.c:86:17: warning: ignoring return value of 'asprintf',
	declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-17 00:26:44 -04:00
Yves Rutschle
f842e2e081 v1.14: 21DEC2012
Corrected OpenVPN probe to support pre-shared secret
	mode (OpenVPN port-sharing code is... wrong). Thanks
	to Kai Ellinger for help in investigating and
	testing.

	Added an actual TLS/SSL probe.

	Added configurable --on-timeout protocol
	specification.

	Added a --anyprot protocol probe (equivalent to what
	--ssl was).

	Makefile respects the user's compiler and CFLAG
	choices (falling back to the current values if
	undefined), as well as LDFLAGS.
	(Michael Palimaka)

	Added "After" and "KillMode" to systemd.sslh.service
	(Thomas Weischuh).

	Added LSB tags to etc.init.d.sslh
	(Thomas Varis).
2013-07-10 23:19:33 +02:00
Yves Rutschle
9bcb2cdd7a v1.12: 08MAY2012
Added support for configuration file.

	New protocol probes can be defined using regular
	expressions that match the first packet sent by the
	client.

	sslh now connects timed out connections to the first
	configured protocol instead of 'ssh' (just make sure
	ssh is the first defined protocol).

	sslh now tries protocols in the order in which they
	are defined (just make sure sslh is the last defined
	protocol).
2013-07-10 23:15:38 +02:00