From 0a279ccbfcb0be44e4e82f9ced28641a8d5cc3ef Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Sat, 18 May 2013 22:49:38 -0400 Subject: [PATCH 1/7] [client] minor --verbose display update to say source port is 'OS assigned' when not otherwise set --- client/spa_comm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/spa_comm.c b/client/spa_comm.c index 2532669b..22384c19 100644 --- a/client/spa_comm.c +++ b/client/spa_comm.c @@ -45,7 +45,7 @@ dump_transmit_options(const fko_cli_options_t *options) if (options->spa_src_port) log_msg(LOG_VERBOSITY_INFO, " source port: %d", options->spa_src_port); else - log_msg(LOG_VERBOSITY_INFO, " source port: unknown"); + log_msg(LOG_VERBOSITY_INFO, " source port: "); log_msg(LOG_VERBOSITY_INFO, " destination port: %d", options->spa_dst_port); log_msg(LOG_VERBOSITY_INFO, " IP/host: %s", options->spa_server_str); From 3e16d6694c07e8e92eaf590cb79b19dd4f729524 Mon Sep 17 00:00:00 2001 From: Franck Joncourt Date: Sun, 19 May 2013 17:14:35 +0200 Subject: [PATCH 2/7] Fixed gpl2.0.texi to make it build. The @appendixsubsec entries are substituted by @appendixsec entries. --- doc/gpl-2.0.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/gpl-2.0.texi b/doc/gpl-2.0.texi index 83669ca6..e8d15daa 100644 --- a/doc/gpl-2.0.texi +++ b/doc/gpl-2.0.texi @@ -17,7 +17,7 @@ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display -@appendixsubsec Preamble +@appendixsec Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -68,7 +68,7 @@ patent must be licensed for everyone's free use or not licensed at all. modification follow. @iftex -@appendixsubsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +@appendixsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @end iftex @ifinfo @center GNU GENERAL PUBLIC LICENSE @@ -333,7 +333,7 @@ POSSIBILITY OF SUCH DAMAGES. @end ifinfo @page -@appendixsubsec Appendix: How to Apply These Terms to Your New Programs +@appendixsec Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it From e31459bb1e4664482b5ccd49d9ff0326d63aabe5 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Sun, 19 May 2013 14:12:58 -0400 Subject: [PATCH 3/7] updated client and server man page material --- client/fwknop.8.in | 513 +++++++++++++++++++++++++++++--------------- server/fwknopd.8.in | 59 +++-- 2 files changed, 386 insertions(+), 186 deletions(-) diff --git a/client/fwknop.8.in b/client/fwknop.8.in index a9996e7c..fdf02b76 100644 --- a/client/fwknop.8.in +++ b/client/fwknop.8.in @@ -1,13 +1,22 @@ '\" t .\" Title: fwknop .\" Author: [see the "AUTHORS" section] -.\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 05/05/2013 +.\" Generator: DocBook XSL Stylesheets v1.76.1 +.\" Date: 05/19/2013 .\" Manual: Fwknop Client .\" Source: Fwknop Client .\" Language: English .\" -.TH "FWKNOP" "8" "05/05/2013" "Fwknop Client" "Fwknop Client" +.TH "FWKNOP" "8" "05/19/2013" "Fwknop Client" "Fwknop Client" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -22,22 +31,24 @@ fwknop \- Firewall Knock Operator .SH "SYNOPSIS" .sp -\fBfwknop\fR \fB\-A\fR <\fIproto/ports\fR> \fB\-R\fR|\fB\-a\fR|\fB\-s \-D\fR <\fIhost\fR> [\fIoptions\fR] +\fBfwknop\fR \fB\-A\fR <\*(Aqproto/ports\*(Aq> \fB\-R\fR|\fB\-a\fR|\fB\-s \-D\fR <\*(Aqhost\*(Aq> [\fIoptions\fR] .SH "DESCRIPTION" .sp -\fBfwknop\fR implements an authorization scheme known as Single Packet Authorization (SPA) for Linux systems running iptables\&. This mechanism requires only a single encrypted and non\-replayed packet to communicate various pieces of information including desired access through an iptables or ipfw policy\&. The main application of this program is to use iptables in a default\-drop stance to protect services such as \fISSH\fR with an additional layer of security in order to make the exploitation of vulnerabilities (both 0\-day and unpatched code) much more difficult\&. +\fBfwknop\fR implements an authorization scheme known as Single Packet Authorization (SPA) for passive service protection\&. SPA requires only a single non\-replayed encrypted packet together with an HMAC in order to communicate various pieces of information including desired access to a service that is otherwise blocked by a firewall\&. The main application of SPA is to use a firewall in a default\-drop stance to protect services such as \fISSH\fR with an additional layer of security in order to make the exploitation of vulnerabilities (both 0\-day and unpatched code) more difficult\&. In addition, services that are protected in this fashion naturally cannot be scanned for with \fINmap\fR\&. .sp -An authorization server \fBfwknopd\fR passively monitors authorization packets via \fIlibpcap\fR and hence there is no \(lqserver\(rq to which to connect in the traditional sense\&. Any service protected by \fBfwknop\fR is inaccessible (by using \fIiptables\fR or \fIipfw\fR to intercept packets within the kernel) before authenticating; anyone scanning for the service will not be able to detect that it is even listening\&. Single Packet Authorization offers many advantages over port knocking, including non\-replayability of SPA packets, ability to use asymmetric ciphers (such as Elgamal), and SPA cannot be broken by simply spoofing packets to duplicate ports within the knock sequence on the server to break port knocking authentication\&. +SPA is essentially next generation Port Knocking (PK), but solves many of the limitations exhibited by PK while retaining its core benefits\&. PK limitations include a general difficulty in protecting against replay attacks, asymmetric ciphers and HMAC schemes are not usually supported, and it is trivially easy to mount a DoS attack against a PK server just by spoofing an additional packet into a PK sequence as it traverses the network (thereby convincing the PK server that the client doesn\(cqt know the proper sequence)\&. All of these limitation are solved by SPA\&. At the same time, SPA hides services behind a default\-drop firewall policy, acquires SPA data passively (usually via libpcap or other means), and implements lightweight cryptographic operations for SPA packet authentication and encryption/decryption\&. .sp -SPA packets can easily be spoofed as well (this is a good thing in this context), and this makes it possible to make it appear as though, say, www\&.yahoo\&.com is trying to authenticate to a target system but in reality the actual connection will come from a seemingly unrelated IP\&. +This is the manual page for the \fBfwknop\fR client which is responsible for constructing SPA packets and sending them over the network\&. The server side is implemented by the \fBfwknopd\fR daemon which sniffs the network for SPA packets, and it is recommended to read the \fIfwknopd(8)\fR manual page as well\&. .sp -Authorization packets are either encrypted with the \fIRijndael\fR block cipher or via \fIGnuPG\fR and associated asymmetric ciphers\&. If the symmetric encryption method is chosen, then the encryption key is shared between the client and server (see the fwknopd \fIaccess\&.conf\fR file for details)\&. If the GnuPG method is chosen, then the encryption keys are derived from GnuPG key rings\&. SPA packets generated by fwknop running as a client adhere to the following format (before they are encrypted): +SPA packets generated by \fBfwknop\fR leverage HMAC for authenticated encryption in the encrypt\-then\-authenticate model\&. Although the usage of an HMAC is currently optional, it is highly recommended for three reasons: \fI1)\fR without an HMAC, cryptographically strong authentication is not possible with \fBfwknop\fR unless GnuPG is used, \fI2)\fR an HMAC applied after encryption protects against CBC\-mode padding oracle attacks such as the Vaudenay attack and the more recent "Lucky 13" attack against SSL, and \fI3)\fR the code required by the \fBfwknopd\fR daemon to verify an HMAC is much more simplistic than the code required to decrypt an SPA packet, so an SPA packet without a proper HMAC isn\(cqt even sent through the decryption routines\&. Generating an HMAC for SPA communications requires a dedicated key in addition to the normal encryption key\&. +.sp +\fBfwknop\fR encrypts SPA packets either with the \fIRijndael\fR block cipher or via \fIGnuPG\fR and associated asymmetric cipher\&. If the symmetric encryption method is chosen, then as usual the encryption key is shared between the client and server (see the \fBfwknopd\fR \fIaccess\&.conf\fR file for details)\&. If the GnuPG method is chosen, then the encryption keys are derived from GnuPG key rings\&. SPA packets generated by fwknop running as a client adhere to the following format (before encryption and the HMAC is applied): .sp .if n \{\ .RS 4 .\} .nf - random number (16 bytes) + random data (16 bytes) username timestamp software version @@ -50,30 +61,19 @@ Authorization packets are either encrypted with the \fIRijndael\fR block cipher .RE .\} .sp -Each of the above fields are separated by a ":" character due to the variable length of several of the fields, and those that might contain ":" characters are base64 encoded\&. The message digest (\fBSHA256\fR by default in all versions of \fBfwknop\fR greater than 1\&.9\&.1) allows the server to check message integrity after decryption, and the 16 bytes of random data ensures (with high probability) that no two messages are identical\&. This ensures that replay attacks are not possible against \fBfwknop\fR\&. +Each of the above fields are separated by a ":" character due to the variable length of several of the fields, and those that might contain ":" characters are base64 encoded\&. The message digest (\fBSHA256\fR by default) is part of the data to be encrypted and is independent of the HMAC which is appended to the SPA packet data after encryption\&. The 16 bytes of random data ensures that no two SPA packets are identical, and this is in addition to and independent of using PBKDF1 for key derivation for Rijndael in CBC mode\&. Because \fBfwknopd\fR tracks the SHA256 digest of all incoming valid SPA packets and throws out duplicates, replay attacks are not feasible against \fBfwknop\fR\&. Syslog alerts are generated if a replay is detected\&. .sp -For each packet coming from an \fBfwknop\fR client, the \fBfwknopd\fR server can cache the digest calculated over the entire packet and compares against previous packet digests in order to detect attempted replay attacks\&. Syslog alerts are generated if a replay is detected\&. +By default, the \fBfwknop\fR client sends authorization packets over UDP port 62201, but this can be altered with the \fB\-\-server\-port\fR argument (this requires \fBfwknopd\fR to be configured to acquire SPA data over the selected port)\&. Also, \fBfwknop\fR can send the SPA packet over a random port via the \fB\-\-rand\-port\fR argument\&. See \fIfwknopd(8)\fR for further details\&. See the \fBEXAMPLES\fR section for example invocations of the \fBfwknop\fR client\&. .sp -By default, the \fBfwknop\fR client sends authorization packets over UDP port 62201, but this can be altered with the \fB\-\-server\-port\fR argument\&. The server must first be configured to acquire the SPA data on the changed protocol\-port\&. Also, \fBfwknop\fR can send the SPA packet over a random port via the \fB\-\-rand\-port\fR argument\&. See \fIfwknopd(8)\fR for further details\&. See the \fBEXAMPLES\fR section for example invocations of the \fBfwknop\fR client\&. +The \fBfwknop\fR client is quite portable, and is known to run on various Linux distributions (all major distros and embedded ones as well such as OpenWRT), FreeBSD, OpenBSD, and Cygwin on Windows\&. There is also a library \fBlibfko\fR that both \fBfwknop\fR and \fBfwknopd\fR use for SPA packet encryption/decryption and HMAC authentication operations\&. This library can be used to allow third party applications to use SPA\&. .SH "REQUIRED ARGUMENTS" .sp -These required arguments can be specified via command\-line or from within the \fI\&.fwknoprc\fR file (see \fI\-n, \-\-named\-config\fR option and the FWKNOPRC FILE section below\&. -.PP -\fB\-D, \-\-destination\fR=\fI\fR -.RS 4 -Direct the -\fBfwknop\fR -client to authenticate with the -\fBfwknopd\fR -daemon/service at the specified destination hostname or IP address\&. The connection mode is discovered by the -\fBfwknopd\fR -daemon/service when it decrypts and parses the authentication packet\&. -.RE +These required arguments can be specified via command\-line or from within the \fI\&.fwknoprc\fR file (see \fI\-n, \-\-named\-config\fR option and the FWKNOPRC FILE section below)\&. .PP \fB\-A, \-\-access\fR=\fI\fR .RS 4 Provide a list of ports and protocols to access on a remote computer running -\fBfwknopd\fR\&. The format of this list is \(lq/\&.../\(rq, e\&.g\&. \(lqtcp/22,udp/53\(rq\&. +\fBfwknopd\fR\&. The format of this list is \(lq+/\&.../+\(rq, e\&.g\&. \(lqtcp/22,udp/53\(rq\&. \fBNOTE:\fR The vast majority of usages for \fBfwknop\fR @@ -86,11 +86,22 @@ argument via an SPA packet to be executed by does not require this argument\&. .RE .PP +\fB\-D, \-\-destination\fR=\fI\fR +.RS 4 +Direct the +\fBfwknop\fR +client to authenticate with the +\fBfwknopd\fR +daemon/service at the specified destination hostname or IP address\&. The connection mode is discovered by the +\fBfwknopd\fR +daemon/service when it decrypts and parses the authentication packet\&. +.RE +.PP \fB\-R|\-a|\-s\fR .RS 4 One of these options (see below) is required to tell the remote \fBfwknopd\fR -daemon what IP should be let through the local firewall\&. It is recommend to use the +daemon what IP should be allowed through the local firewall\&. It is recommend to use the \fB\-R\fR or \fB\-a\fR @@ -107,49 +118,32 @@ in order to harden SPA communications against possible Print a usage summary message and exit\&. .RE .PP -\fB\-B, \-\-save\-packet\fR=\fI\fR -.RS 4 -Instruct the -\fBfwknop\fR -client to write a newly created SPA packet out to the specified file so that it can be examined off\-line\&. -.RE -.PP -\fB\-b, \-\-save\-packet\-append\fR -.RS 4 -Append the generated packet data to the file specified with the \-B option\&. -.RE -.PP \fB\-G, \-\-get\-key\fR=\fI\fR .RS 4 -Load an encryption key/password from the specified file\&. The key file contains a line for each destination hostname or IP address, a colon (":"), optional space and the password, followed by a newline\&. Note that the last line has to have a terminating newline character\&. Also note: though this is a convenience, have a file on your system with cleartext passwords is not a good idea and is not recommended\&. +Load an encryption key/password from the specified file\&. The key file contains a line for each destination hostname or IP address, a colon (":"), optional space and the password, followed by a newline\&. Note that the last line has to have a terminating newline character\&. Also note: though this is a convenience, having a file on your system with clear text passwords is not a good idea and is not recommended\&. Having the +\fBfwknop\fR +client prompt you for the key is generally more secure\&. Note also that if a key is stored on disk, the +\fBfwknop\fR +rc file is a more powerful mechanism for specifying not only the key but other options as well\&. .RE .PP -\fB\-\-key\-rijndael\fR=\fI\fR +\fB\-\-get\-hmac\-key\fR=\fI\fR .RS 4 -Specify the Rijndael key\&. Since the password is visible to utilities (like -\fIps\fR -under Unix) this form should only be used where security is not important\&. +Load an HMAC key/password from the specified file\&. Similarly to the format for the +\fB\-\-get\-key\fR +option, the HMAC key file contains a line for each destination hostname or IP address, a colon (":"), optional space and the password, followed by a newline\&. Note that the last line has to have a terminating newline character\&. Also note: though this is a convenience, having a file on your system with clear text passwords is not a good idea and is not recommended\&. Having the +\fBfwknop\fR +client prompt you for the HMAC key is generally more secure\&. Note also that if a key is stored on disk, the +\fBfwknop\fR +rc file is a more powerful mechanism for specifying not only the HMAC key but other options as well\&. .RE .PP -\fB\-\-key\-base64\-rijndael\fR=\fI\fR +\fB\-\-key\-gen\fR .RS 4 -Specify the base64 encoded Rijndael key\&. Since the password is visible to utilities (like -\fIps\fR -under Unix) this form should only be used where security is not important\&. -.RE -.PP -\fB\-\-key\-base64\-hmac\fR=\fI\fR -.RS 4 -Specify the base64 encoded HMAC key\&. Since the password is visible to utilities (like -\fIps\fR -under Unix) this form should only be used where security is not important\&. -.RE -.PP -\fB\-\-key\-hmac\fR=\fI\fR -.RS 4 -Specify the raw HMAC key (not base64 encoded)\&. Since the password is visible to utilities (like -\fIps\fR -under Unix) this form should only be used where security is not important\&. +Have +\fBfwknop\fR +generate both Rijndael and HMAC keys that can be used for SPA packet encryption\&. These keys are derived from /dev/random and then base64 encoded before being printed to stdout, and are meant to be included within the \(lq$HOME/\&.fwknoprc\(rq file (or the file referenced by +\fB\-\-get\-key\fR)\&. .RE .PP \fB\-l, \-\-last\-cmd\fR @@ -169,6 +163,42 @@ Specify the name of the configuration stanza in the \(lq$HOME/\&.fwknoprc\(rq fi file\&. .RE .PP +\fB\-\-key\-rijndael\fR=\fI\fR +.RS 4 +Specify the Rijndael key on the command line\&. Since the key may be visible to utilities such as +\fIps\fR +under Unix, this form should only be used where security is not critical\&. Having the +\fBfwknop\fR +client either prompt you for the key or acquire via the \(lq$HOME/\&.fwknoprc\(rq file is generally more secure\&. +.RE +.PP +\fB\-\-key\-base64\-rijndael\fR=\fI\fR +.RS 4 +Specify the base64 encoded Rijndael key\&. Since the key may be visible to utilities such as +\fIps\fR +under Unix, this form should only be used where security is not critical\&. Having the +\fBfwknop\fR +client either prompt you for the key or acquire via the \(lq$HOME/\&.fwknoprc\(rq file is generally more secure\&. +.RE +.PP +\fB\-\-key\-base64\-hmac\fR=\fI\fR +.RS 4 +Specify the base64 encoded HMAC key\&. Since the key may be visible to utilities such as +\fIps\fR +under Unix, this form should only be used where security is not critical\&. Having the +\fBfwknop\fR +client either prompt you for the key or acquire via the \(lq$HOME/\&.fwknoprc\(rq file is generally more secure\&. +.RE +.PP +\fB\-\-key\-hmac\fR=\fI\fR +.RS 4 +Specify the raw HMAC key (not base64 encoded)\&. Since the key may be visible to utilities such as +\fIps\fR +under Unix, this form should only be used where security is not critical\&. Having the +\fBfwknop\fR +client either prompt you for the key or acquire via the \(lq$HOME/\&.fwknoprc\(rq file is generally more secure\&. +.RE +.PP \fB\-\-rc\-file\fR=\fI\fR .RS 4 Specify path to the fwknop rc file (default is $HOME/\&.fwknoprc)\&. @@ -179,6 +209,11 @@ Specify path to the fwknop rc file (default is $HOME/\&.fwknoprc)\&. Save command line arguments to the $HOME/\&.fwknoprc stanza specified with the \-n option\&. .RE .PP +\fB\-\-force\-stanza\fR +.RS 4 +Used with \-\-save\-rc\-stanza to overwrite all of the variables for the specified stanza +.RE +.PP \fB\-\-show\-last\fR .RS 4 Display the last command\-line arguments used by @@ -205,6 +240,18 @@ is executed\&. Test mode\&. Generate the SPA packet data, but do not send it\&. Instead, print a break\-down of the SPA data fields, then run the data through the decryption and decoding process and print the break\-down again\&. This is primarily a debugging feature\&. .RE .PP +\fB\-B, \-\-save\-packet\fR=\fI\fR +.RS 4 +Instruct the +\fBfwknop\fR +client to write a newly created SPA packet out to the specified file so that it can be examined off\-line\&. +.RE +.PP +\fB\-b, \-\-save\-packet\-append\fR +.RS 4 +Append the generated packet data to the file specified with the \-B option\&. +.RE +.PP \fB\-v, \-\-verbose\fR .RS 4 Run the @@ -220,6 +267,13 @@ Display version information and exit\&. .RE .SH "SPA OPTIONS" .PP +\fB\-\-use\-hmac\fR +.RS 4 +Set HMAC mode for authenticated encryption of SPA communications\&. As of +\fBfwknop\fR +2\&.5, this is an optional feature, but this will become the default in a future release\&. +.RE +.PP \fB\-a, \-\-allow\-ip\fR=\fI\fR .RS 4 Specify IP address that should be permitted through the destination @@ -239,17 +293,6 @@ option\&. Another related option is client to automatically resolve the externally routable IP address the local system is connected to by querying a website that returns the actual IP address it sees from the calling system\&. .RE .PP -\fB\-C, \-\-server\-cmd\fR=\fI\fR -.RS 4 -Instead of requesting access to a service with an SPA packet, the -\fB\-\-server\-cmd\fR -argument specifies a command that will be executed by the -\fBfwknopd\fR -server\&. The command is encrypted within the SPA packet and sniffed off the wire (as usual) by the -\fBfwknopd\fR -server\&. -.RE -.PP \fB\-g, \-\-gpg\-encryption\fR .RS 4 Use GPG encryption on the SPA packet (default if not specified is Rijndael)\&. @@ -259,18 +302,9 @@ Use of this option will require the specification of a GPG recipient (see along with other GPG\-related options below)\&. .RE .PP -\fB\-H, \-\-http\-proxy\fR=\fI[:port]\fR +\fB\-\-hmac\-digest\-type\fR=\fI\fR .RS 4 -Specify an HTTP proxy that the -\fBfwknop\fR -client will use to send the SPA packet through\&. Using this option will automatically set the SPA packet transmission mode (usually set via the -\fB\-\-server\-proto\fR -argument) to "http"\&. You can also specify the proxy port by adding ":" to the proxy host name or ip\&. -.RE -.PP -\fB\-m, \-\-digest\-type\fR=\fI\fR -.RS 4 -Specify the message digest algorithm to use in the SPA data\&. Choices are: +Set the HMAC digest algorithm for authenticated encryption of SPA packets\&. Choices are: \fBMD5\fR, \fBSHA1\fR, \fBSHA256\fR @@ -279,29 +313,6 @@ Specify the message digest algorithm to use in the SPA data\&. Choices are: \fBSHA512\fR\&. .RE .PP -\fB\-M, \-\-encryption\-mode\fR=\fI\fR -.RS 4 -Specify the encryption mode when AES is used for encrypting SPA packets\&. The default is CBC mode, but others can be chosen such as CFB or OFB as long as this is also specified in the -\fIaccess\&.conf\fR -file on the server side via the ENCRYPTION_MODE variable\&. In general, it is recommended to not use this argument and just use the default\&. Note that the string \(lqlegacy\(rq can be specified in order to generate SPA packets with the old initialization vector strategy used by versions of -\fBfwknop\fR -before 2\&.5\&. With the 2\&.5 release, -\fBfwknop\fR -generates initialization vectors in a manner that is compatible with OpenSSL\&. -.RE -.PP -\fB\-\-hmac\-digest\-type\fR=\fI\fR -.RS 4 -Set the HMAC digest algorithm (default is sha256)\&. Options are md5, sha1, sha256, sha384, or sha512\&. -.RE -.PP -\fB\-\-use\-hmac\fR -.RS 4 -Set HMAC mode for authenticated encryption of SPA communications\&. As of -\fBfwknop\fR -2\&.5, this is an optional feature, but this will become the default in a future release\&. -.RE -.PP \fB\-N, \-\-nat\-access\fR=\fI\fR .RS 4 The @@ -310,7 +321,7 @@ server offers the ability to provide SPA access through an iptables firewall to \fBfwknopd\fR server is protecting an internal network on an RFC\-1918 address space, an external \fBfwknop\fR -client can request that the server port forward an external port to an internal IP, i\&.e\&. \(lq\-\-NAT\-access 192\&.168\&.10\&.2,55000\(rq\&. In this case, access will be granted to 192\&.168\&.10\&.2 via port 55000 to whatever service is requested via the +client can request that the server port forward an external port to an internal IP, i\&.e\&. \(lq+\-\-NAT\-access 192\&.168\&.10\&.2,55000+\(rq\&. In this case, access will be granted to 192\&.168\&.10\&.2 via port 55000 to whatever service is requested via the \fB\-\-access\fR argument (usually tcp/22)\&. Hence, after sending such an SPA packet, one would then do \(lqssh \-p 55000 user@host\(rq and the connection would be forwarded on through to the internal 192\&.168\&.10\&.2 system automatically\&. Note that the port \(lq55000\(rq can be randomly generated via the @@ -396,7 +407,7 @@ server must use a \fBPCAP_FILTER\fR variable that is configured to accept such packets\&. For example, the \fBPCAP_FILTER\fR -variable could be set to: \(lqudp dst portrange 10000\-65535\(rq\&. +variable could be set to: \(lq+udp dst portrange 10000\-65535+\(rq\&. .RE .PP \fB\-R, \-\-resolve\-ip\-http\fR @@ -423,11 +434,15 @@ Override the default URL used for resolving the source IP address\&. For best re .RS 4 Instruct the \fBfwknop\fR -client to form an SPA packet that contains the special\-case IP address \(lq0\&.0\&.0\&.0\(rq which will inform the destination +client to form an SPA packet that contains the special\-case IP address \(lq+0\&.0\&.0\&.0+\(rq which will inform the destination \fBfwknopd\fR SPA server to use the source IP address from which the SPA packet originates as the IP that will be allowed through upon modification of the firewall ruleset\&. This option is useful if the \fBfwknop\fR -client is deployed on a machine that is behind a NAT device\&. The permit\-address options +client is deployed on a machine that is behind a NAT device and the external IP is not known\&. However, usage of this option is not recommended, and either the +\fB\-a\fR +or +\fB\-R\fR +options should be used instead\&. The permit\-address options \fB\-s\fR, \fB\-R\fR and @@ -440,6 +455,48 @@ are mutually exclusive\&. Set the source port for outgoing SPA packet\&. .RE .PP +\fB\-C, \-\-server\-cmd\fR=\fI\fR +.RS 4 +Instead of requesting access to a service with an SPA packet, the +\fB\-\-server\-cmd\fR +argument specifies a command that will be executed by the +\fBfwknopd\fR +server\&. The command is encrypted within the SPA packet and sniffed off the wire (as usual) by the +\fBfwknopd\fR +server\&. +.RE +.PP +\fB\-H, \-\-http\-proxy\fR=\fI[:port]\fR +.RS 4 +Specify an HTTP proxy that the +\fBfwknop\fR +client will use to send the SPA packet through\&. Using this option will automatically set the SPA packet transmission mode (usually set via the +\fB\-\-server\-proto\fR +argument) to "http"\&. You can also specify the proxy port by adding ":" to the proxy host name or ip\&. +.RE +.PP +\fB\-m, \-\-digest\-type\fR=\fI\fR +.RS 4 +Specify the message digest algorithm to use in the SPA data\&. Choices are: +\fBMD5\fR, +\fBSHA1\fR, +\fBSHA256\fR +(the default), +\fBSHA384\fR, and +\fBSHA512\fR\&. +.RE +.PP +\fB\-M, \-\-encryption\-mode\fR=\fI\fR +.RS 4 +Specify the encryption mode when AES is used for encrypting SPA packets\&. The default is CBC mode, but others can be chosen such as CFB or OFB as long as this is also specified in the +\fIaccess\&.conf\fR +file on the server side via the ENCRYPTION_MODE variable\&. In general, it is recommended to not use this argument and just use the default (CBC)\&. Note that the string \(lqlegacy\(rq can be specified in order to generate SPA packets with the old initialization vector strategy used by versions of +\fBfwknop\fR +prior to 2\&.5\&. With the 2\&.5 release, +\fBfwknop\fR +generates initialization vectors in a manner that is compatible with OpenSSL via the PBKDF1 algorithm\&. +.RE +.PP \fB\-\-time\-offset\-plus\fR=\fI