No description
Find a file
Mark Janssen -- Sig-I/O Automatisering 5f2a02b34b
Temporary ugly fix for building with openssl1.0 or 1.1
Use either make -f Makefile.ssl1o or make -f Makefile.ssl11
When using OpenSSL1.0 or 1.1 based systems
2019-06-28 13:39:54 +02:00
contrib Fix one reference to documentation 2016-04-09 20:57:58 +02:00
debian Move manual page from debian subdir to main dir 2007-07-30 09:29:51 +00:00
docs Makefile: don't use non-portable -D option 2018-05-14 04:20:18 -07:00
.gitignore Ignore the proxytunnel binary 2016-08-29 22:43:36 +02:00
.travis.yml Improve Travis CI configuration 2016-08-29 23:04:44 +02:00
_copyright.inc Cosmetic changes and vim improvements. 2008-01-27 10:04:23 +00:00
base64.c Cosmetic changes and vim improvements. 2008-01-27 10:04:23 +00:00
base64.h Cosmetic changes and vim improvements. 2008-01-27 10:04:23 +00:00
basicauth.c Fix compiler warning wih gcc < 4. 2008-01-27 14:58:32 +00:00
basicauth.h Changed basicauth interface. 2008-01-27 13:19:17 +00:00
CHANGES NTLMv2 fixes by Giulio Galante <giulio.galante@fastwebnet.it> 2012-01-23 18:13:41 +00:00
cmdline.c drop revision not working in git, update texts 2018-03-06 12:03:52 +01:00
cmdline.h Add an option to provide a CA cert for server certificate verification 2016-08-18 10:26:41 -07:00
config.h increase version number a bit to reflect changes in the last years 2018-03-06 12:06:47 +01:00
CREDITS Added myself to CREDITS. 2008-01-20 22:00:11 +00:00
global.h Cosmetic changes and vim improvements. 2008-01-27 10:04:23 +00:00
http.c fix compiler warning 2018-03-12 17:47:13 +01:00
INSTALL Clarify INSTALL doc, add comment about bsd-functions in Makefile 2007-02-27 09:03:35 +00:00
io.c fix for 100% CPU bug caused when remote server not responding 2016-02-03 17:39:35 +01:00
io.h Cosmetic changes and vim improvements. 2008-01-27 10:04:23 +00:00
KNOWN_ISSUES Document some setproctitle behaviour 2006-09-02 11:29:53 +00:00
LICENSE.txt Updated LICENSE.txt with OpenSSL linking clause 2012-01-23 18:10:43 +00:00
Makefile Makefile: don't use non-portable -D option 2018-05-14 04:20:18 -07:00
Makefile.ssl10 Temporary ugly fix for building with openssl1.0 or 1.1 2019-06-28 13:39:54 +02:00
Makefile.ssl11 Temporary ugly fix for building with openssl1.0 or 1.1 2019-06-28 13:39:54 +02:00
messages.c Cosmetic changes and vim improvements. 2008-01-27 10:04:23 +00:00
ntlm.c NTLMv2 fixes by Giulio Galante <giulio.galante@fastwebnet.it> 2012-01-23 18:13:41 +00:00
ntlm.h NTLMv2 fixes by Giulio Galante <giulio.galante@fastwebnet.it> 2012-01-23 18:13:41 +00:00
proxytunnel.c Add SSL certificate verification support and enable it by default 2016-08-18 10:24:11 -07:00
proxytunnel.h add missing prototype 2018-03-06 12:39:31 +01:00
ptstream.c Temporary ugly fix for building with openssl1.0 or 1.1 2019-06-28 13:39:54 +02:00
ptstream.h Add SSL certificate verification support and enable it by default 2016-08-18 10:24:11 -07:00
README increase version number a bit to reflect changes in the last years 2018-03-06 12:06:47 +01:00
readpassphrase.c fixed compiler warnings 2016-02-03 18:02:23 +01:00
RELNOTES Fix typo 2008-08-09 16:33:03 +00:00
setproctitle.c Cosmetic changes and vim improvements. 2008-01-27 10:04:23 +00:00
strlcat.c Re-Indenting 2008-01-22 22:56:15 +00:00
strlcpy.c Re-Indenting 2008-01-22 22:56:15 +00:00
strzcat.c Reformatted sourcecode. 2008-01-22 23:52:42 +00:00
TODO Update TODO file 2016-08-29 22:48:04 +02:00

-----------
proxytunnel
-----------

Author:		Jos Visser <josv@osp.nl>, Mark Janssen <maniac@maniac.nl>

Hi all,

This is proxytunnel, a program that connects stdin and stdout
to an origin server somewhere in the Internet through an industry
standard HTTPS proxy. I originally wrote this program to be used
as an extension to SSH, to be able to SSH to my box at home. In 
this file, I will describe the use with SSH. If you want to use it
with some other application, feel free, and let me know!


Usage:

Proxytunnel is very easy to use, when running proxytunnel with the help
option it specifies it's command-line options.

$ ./proxytunnel --help
proxytunnel 1.9.9 Copyright 2001-2018 Proxytunnel Project
Usage: proxytunnel [OPTIONS]...
Build generic tunnels through HTTPS proxies using HTTP authentication

Standard options:
 -i, --inetd               Run from inetd (default: off)
 -a, --standalone=INT      Run as standalone daemon on specified port
 -p, --proxy=STRING        Local proxy host:port combination
 -r, --remproxy=STRING     Remote proxy host:port combination (using 2 proxies)
 -d, --dest=STRING         Destination host:port combination
 -e, --encrypt             SSL encrypt data between local proxy and destination
 -E, --encrypt-proxy       SSL encrypt data between client and local proxy
 -X, --encrypt-remproxy    SSL encrypt data between local and remote proxy
 -L                        (legacy) enforce TLSv1 connection
 -T, --no-ssl3             Do not connect using SSLv3

Additional options for specific features:
 -z, --no-check-certficate Don't verify server SSL certificate
 -C, --cacert=STRING       Path to trusted CA certificate or directory
 -F, --passfile=STRING     File with credentials for proxy authentication
 -P, --proxyauth=STRING    Proxy auth credentials user:pass combination
 -R, --remproxyauth=STRING Remote proxy auth credentials user:pass combination 
 -N, --ntlm                Use NTLM based authentication
 -t, --domain=STRING       NTLM domain (default: autodetect)
 -H, --header=STRING       Add additional HTTP headers to send to proxy
 -o STRING                 send custom Host Header
 -x, --proctitle=STRING    Use a different process title

Miscellaneous options:
 -v, --verbose             Turn on verbosity
 -q, --quiet               Suppress messages
 -h, --help                Print help and exit
 -V, --version             Print version and exit

To use this program with OpenSSH to connect to a host somewhere, create
a $HOME/.ssh/config file with the following content:

Host foobar
	ProtocolKeepAlives 30
	ProxyCommand /path/to/proxytunnel -p proxy:8080 -P username
-d mybox.athome.nl:443

With:

- foobar		The symbolic name of the host you want to connect to
- proxy         	The host name of the proxy you want to connect through
- 8080			The port number where the proxy software listens to
- username		Your proxy userid (password will be prompted)
- mybox.athome.nl	The hostname of the box you want to connect to (ultimately)
- 443			The port number of the SSH daemon on mybox.athome.nl

If your proxy doesn't require the username and password for using it,
you can skip these options. If you don't provide the password on the
command-line (which is recommended) you will be prompted for it by
proxytunnel. If you are on a trusted system you can also put the
password in an environment variable, and tell proxytunnel where to
find it with '-S'.

If you want to run proxytunnel from inetd add the '--inetd' option.

Most HTTPS proxies do not allow access to ports other than 443 (HTTPS)
and 563 (SNEWS), so some hacking is necessary to start the SSH daemon on
the required port. (On the server side add an extra Port statement in
the sshd_config file, or use a redirect rule in your firewall.)

When your proxy uses NTLM authentication (like Microsoft IIS proxy)
you need to specify -N to enable NTLM, and then specify your username
and password (and optionally domain, if autodetection fails).
The NT domain can be specified on the commandline if the
auto-detection doesn't work for you (which is usually doesn't)

If you want to have the first proxy connect to another http proxy (like
one you can control, specify -r proxy2:port. The first proxy will then
connect to this remote proxy, which will be asked to connect to the 
requested destination. Note that authentication doesn't (yet) work on
this remote proxy. For more information regarding this feature, check
out http://dag.wieers.com/howto/ssh-http-tunneling/

If your proxy is more advanced, and does protocol inspection it will
detect that your connection is not a real HTTPS/SSL connection. You
can enable SSL encryption (using -e), which will work around this
problem, however, you need to setup stunnel4 on the other side, or
connect to a process that understands SSL itself.

When all this is in place, execute an "ssh foobar" and you're in business!

Environment Variables
=====================

Proxytunnel can make use of the following environment variables:
PROXYUSER		Username for the proxy-authentication
PROXYPASS		Password for the proxy-authentication
REMPROXYUSER	Username for remote proxy-authentication
REMPROXYPASS	Password for remote proxy-authentication
HTTP_PROXY		Primary proxy host and port information
				Format: HTTP_PROXY=http://<host>:<port>/

Authentication File
===================

Proxytunnel can read authentication data from a file (-F/--passfile)
The format for this file is:
<field> = <value>
<field> = <value>
etc

One entry per line, 1 space before and after the equal sign.
The accepted fields are:
 * proxy_user
 * proxy_passwd
 * remproxy_user
 * remproxy_passwd

Share and Enjoy!

Jos Visser <josv@osp.nl>
Mark Janssen <maniac@maniac.nl>