'\" t .\" Title: fwknop .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: 08/06/2018 .\" Manual: Fwknop Client .\" Source: Fwknop Client .\" Language: English .\" .TH "FWKNOP" "8" "08/06/2018" "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 .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" fwknop \- Firewall Knock Operator .SH "SYNOPSIS" .sp \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 strong service concealment\&. SPA requires only a single packet which is encrypted, non\-replayable, and authenticated via an HMAC in order to communicate desired access to a service that is hidden behind a firewall in a default\-drop filtering stance\&. The main application of SPA is to use a firewall to drop all attempts to connect to services such as \fISSH\fR in order to make the exploitation of vulnerabilities (both 0\-day and unpatched code) more difficult\&. Any service that is concealed by SPA naturally cannot be scanned for with \fINmap\fR\&. The fwknop project natively supports four different firewalls: \fIiptables\fR, \fIfirewalld\fR, \fIPF\fR, and \fIipfw\fR across Linux, OpenBSD, FreeBSD, and Mac OS X\&. There is also support for custom scripts so that fwknop can be made to support other infrastructure such as \fIipset\fR or \fInftables\fR\&. .sp 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 possible to reliably support, 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 standard cryptographic operations for SPA packet authentication and encryption/decryption\&. .sp 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 interacts with the local firewall to allow SPA authenticated connections\&. It is recommended to read the \fIfwknopd(8)\fR manual page as well\&. Further detailed information may be found in the tutorial \(lqSingle Packet Authorization: A Comprehensive Guide to Strong Service Concealment with fwknop\(rq available online (see: \fIhttp://www\&.cipherdyne\&.org/fwknop/docs/fwknop\-tutorial\&.html\fR)\&. .sp 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 (enabled via the \fB\-\-use\-hmac\fR command line switch), 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, but even then an HMAC should still be applied, \fI2)\fR an HMAC applied after encryption protects against cryptanalytic CBC\-mode padding oracle attacks such as the Vaudenay attack and related trickery (like 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\&. Reason \fI3)\fR is why an HMAC should still be used even when SPA packets are encrypted with GnuPG due to the fact that SPA data is not sent through \fBlibgpgme\fR functions unless the HMAC checks out first\&. GnuPG and libgpgme are relatively complex bodies of code, and therefore limiting the ability of a potential attacker to interact with this code through an HMAC operation helps to maintain a stronger security stance\&. Generating an HMAC for SPA communications requires a dedicated key in addition to the normal encryption key, and both can be generated with the \fB\-\-key\-gen\fR option\&. .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 \fI/etc/fwknop/access\&.conf\fR file for details)\&. The actual encryption key used for Rijndael encryption is generated via the standard PBKDF1 key derivation algorithm, and CBC mode is set\&. 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 data (16 digits) username timestamp software version mode (command mode (0) or access mode (1)) if command mode => command to execute else access mode => IP,proto,port message digest (SHA512 / SHA384 / SHA256 / SHA1 / MD5 / SHA3_256 / SHA3_512) .fi .if n \{\ .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) 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 digits of random data (about 53 bits) 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 (which uses an 8\-byte random "salt" value)\&. 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 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 The \fBfwknop\fR client is quite portable, and is known to run on various Linux distributions (all major distros and embedded ones such as OpenWRT as well), FreeBSD, OpenBSD, Mac OS X, 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 subject to the terms of the GNU General Public License (GPL v2+)\&. .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\-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\&. \fBNOTE:\fR The vast majority of usages for \fBfwknop\fR require the \fB\-A\fR argument, but sending full commands with the \fB\-\-server\-cmd\fR argument via an SPA packet to be executed by \fBfwknopd\fR 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 allowed through the firewall\&. It is recommend to use the \fB\-R\fR or \fB\-a\fR options instead of \fB\-s\fR in order to harden SPA communications against possible \fIMan\-In\-The\-Middle\fR (MITM) attacks, and on the server side set \fIREQUIRE_SOURCE_ADDRESS\fR variable in the \fI/etc/fwknop/access\&.conf\fR file\&. Note that the most secure option is \fB\-a\fR so that \fBfwknop\fR does not have to issue any HTTPS request to \fIhttps://www\&.cipherdyne\&.org/cgi\-bin/myip\fR in order to resolve the externally routable IP address\&. Using \fB\-a\fR requires that the user already knows what the external IP is for the network where fwknop is running\&. .RE .SH "GENERAL OPTIONS" .PP \fB\-h, \-\-help\fR .RS 4 Print a usage summary message and exit\&. .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, 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\-\-stdin\fR .RS 4 Read the encryption key/password from stdin\&. This can be used to send the data via a pipe for example\&. This command is similar to \-\-fd 0\&. .RE .PP \fB\-\-fd\fR=\fI\fR .RS 4 Specify the file descriptor number to read the key/password from\&. This command avoids the user being prompted for a password if none has been found in the user specific stanza, or none has been supplied on the command line\&. A file descriptor set to 0 is similar to the stdin command\&. .RE .PP \fB\-\-get\-hmac\-key\fR=\fI\fR .RS 4 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\-gen\fR .RS 4 Have \fBfwknop\fR generate both Rijndael and HMAC keys that can be used for SPA packet encryption and authentication\&. These keys are derived from /dev/urandom 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)\&. Such keys are generally more secure than passphrases that are typed in from the command line\&. .RE .PP \fB\-\-key\-gen\-file\fR=\fI\fR .RS 4 Write generated keys to the specified file\&. Note that the file is overwritten if it already exists\&. If this option is not given, then \fB\-\-key\-gen\fR writes the keys to stdout\&. .RE .PP \fB\-\-key\-len\fR=\fI\fR .RS 4 Specify the number of bytes for a generated Rijndael key\&. The maximum size is currently 128 bytes\&. .RE .PP \fB\-\-hmac\-key\-len\fR=\fI\fR .RS 4 Specify the number of bytes for a generated HMAC key\&. The maximum size is currently 128 bytes\&. .RE .PP \fB\-l, \-\-last\-cmd\fR .RS 4 Execute \fBfwknop\fR with the command\-line arguments from the previous invocation (if any)\&. The previous arguments are parsed out of the \fI~/\&.fwknop\&.run\fR file\&. .RE .PP \fB\-n, \-\-named\-config\fR=\fI\fR .RS 4 Specify the name of the configuration stanza in the \(lq$HOME/\&.fwknoprc\(rq file to pull configuration and command directives\&. These named stanzas alleviate the need for remembering the various command\-line arguments for frequently used invocations of \fBfwknop\fR\&. See the section labeled, FWKNOPRC FILE below for a list of the valid configuration directives in the \fI\&.fwknoprc\fR 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 \fBfwknop\fR rc file (default is \(lq$HOME/\&.fwknoprc\(rq)\&. .RE .PP \fB\-\-no\-rc\-file\fR .RS 4 Perform \fBfwknop\fR client operations without referencing the \(lq$HOME/\&.fwknoprc\(rq file\&. .RE .PP \fB\-\-no\-home\-dir\fR .RS 4 Do not allow the \fBfwknop\fR client to look for the home directory associated with the user\&. .RE .PP \fB\-\-save\-rc\-stanza\fR=\fI\fR .RS 4 Save command line arguments to the \(lq$HOME/\&.fwknoprc\(rq stanza specified with the \fB\-n\fR option\&. If the \fB\-n\fR option is omitted, then the stanza name will default to the destination server value (hostname or IP) given with the \fB\-D\fR argument\&. .RE .PP \fB\-\-force\-stanza\fR .RS 4 Used with \fB\-\-save\-rc\-stanza\fR to overwrite all of the variables for the specified stanza .RE .PP \fB\-\-stanza\-list\fR .RS 4 Dump a list of the stanzas found in \(lq$HOME/\&.fwknoprc\(rq\&. .RE .PP \fB\-\-show\-last\fR .RS 4 Display the last command\-line arguments used by \fBfwknop\fR\&. .RE .PP \fB\-E, \-\-save\-args\-file\fR=\fI\fR .RS 4 Save command line arguments to a specified file path\&. Without this option, and when \fB\-\-no\-save\-args\fR is not also specified, then the default save args path is \fI~/\&.fwknop\&.run\fR\&. .RE .PP \fB\-\-no\-save\-args\fR .RS 4 Do not save the command line arguments given when \fBfwknop\fR is executed\&. .RE .PP \fB\-T, \-\-test\fR .RS 4 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 \fB\-B\fR option\&. .RE .PP \fB\-\-fault\-injection\-tag\fR=\fI\fR .RS 4 This option is only used for fault injection testing when \fBfwknop\fR is compiled to support the libfiu library (see: \fIhttp://blitiri\&.com\&.ar/p/libfiu/\fR)\&. Under normal circumstances this option is not used, and any packaged version of fwknop will not have code compiled in so this capability is not enabled at run time\&. It is documented here for completeness\&. .RE .PP \fB\-v, \-\-verbose\fR .RS 4 Run the \fBfwknop\fR client in verbose mode\&. This causes \fBfwknop\fR to print some extra information about the current command and the resulting SPA data\&. .RE .PP \fB\-V, \-\-version\fR .RS 4 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 \fBfwknopd\fR server firewall (this IP is encrypted within the SPA packet itself)\&. This is useful to prevent a MITM attack where a SPA packet can be intercepted en\-route and sent from a different IP than the original\&. Hence, if the \fBfwknopd\fR server trusts the source address on the SPA packet IP header then the attacker gains access\&. The \fB\-a\fR option puts the source address within the encrypted SPA packet, and so thwarts this attack\&. The \fB\-a\fR option is also useful to specify the IP that will be granted access when the SPA packet itself is spoofed with the \fB\-\-spoof\-src\fR option\&. Another related option is \fB\-R\fR (see below) which instructs the \fBfwknop\fR client to automatically resolve the externally routable IP address the local system is connected to by querying \fIhttps://www\&.cipherdyne\&.org/cgi\-bin/myip\fR\&. This returns the actual IP address it sees from the calling system\&. .RE .PP \fB\-g, \-\-gpg\-encryption\fR .RS 4 Use GPG encryption on the SPA packet (default if not specified is Rijndael)\&. \fBNote:\fR Use of this option will also require a GPG recipient (see \fB\-\-gpg\-recipient\fR along with other GPG\-related options below)\&. .RE .PP \fB\-\-hmac\-digest\-type\fR=\fI\fR .RS 4 Set the HMAC digest algorithm for authenticated encryption of SPA packets\&. Choices are: \fBMD5\fR, \fBSHA1\fR, \fBSHA256\fR (the default), \fBSHA384\fR, \fBSHA512\fR, \fBSHA3_256\fR, and \fBSHA3_512\fR\&. .RE .PP \fB\-N, \-\-nat\-access\fR=\fI\fR .RS 4 The \fBfwknopd\fR server offers the ability to provide SPA access through an iptables firewall to an internal service by interfacing with the iptables NAT capabilities\&. So, if the \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 \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 \fB\-\-nat\-rand\-port\fR argument (described later)\&. .RE .PP \fB\-\-nat\-local\fR .RS 4 On the \fBfwknopd\fR server, a NAT operation can apply to the local system instead of being forwarded through the system\&. That is, for iptables firewalls, a connection to, say, port 55,000 can be translated to port 22 on the local system\&. By making use of the \fB\-\-nat\-local\fR argument, the \fBfwknop\fR client can be made to request such access\&. This means that any external attacker would only see a connection over port 55,000 instead of the expected port 22 after the SPA packet is sent\&. .RE .PP \fB\-\-nat\-port\fR .RS 4 Usually \fBfwknop\fR is used to request access to a specific port such as tcp/22 on a system running \fBfwknopd\fR\&. However, by using the \fB\-\-nat\-port\fR argument, it is possible to request access to a (again, such as tcp/22), but have this access granted via the specified port (so, the \fB\-p\fR argument would then be used on the \fISSH\fR client command line)\&. See the \fB\-\-nat\-local\fR and \fB\-\-nat\-access\fR command line arguments to \fBfwknop\fR for additional details on gaining access to services via a NAT operation\&. .RE .PP \fB\-\-nat\-rand\-port\fR .RS 4 Usually \fBfwknop\fR is used to request access to a specific port such as tcp/22 on a system running \fBfwknopd\fR\&. However, by using the \fB\-\-nat\-rand\-port\fR argument, it is possible to request access to a particular service (again, such as tcp/22), but have this access granted via a random translated port\&. That is, once the \fBfwknop\fR client has been executed in this mode and the random port selected by \fBfwknop\fR is displayed, the destination port used by the follow\-on client must be changed to match this random port\&. For \fISSH\fR, this is accomplished via the \fB\-p\fR argument\&. See the \fB\-\-nat\-local\fR and \fB\-\-nat\-access\fR command line arguments to \fBfwknop\fR for additional details on gaining access to services via a NAT operation\&. .RE .PP \fB\-p, \-\-server\-port\fR=\fI\fR .RS 4 Specify the port number where \fBfwknopd\fR accepts packets via libpcap or ulogd pcap writer\&. By default \fBfwknopd\fR looks for authorization packets over UDP port 62201\&. .RE .PP \fB\-P, \-\-server\-proto\fR=\fI\fR .RS 4 Set the protocol (udp, tcp, http, udpraw, tcpraw, or icmp) for the outgoing SPA packet\&. Note: The \fBudpraw\fR, \fBtcpraw\fR, and \fBicmp\fR modes use raw sockets and thus require root access to run\&. Also note: The \fBtcp\fR mode expects to establish a TCP connection to the server before sending the SPA packet\&. This is not normally done, but is useful for compatibility with the Tor for strong anonymity; see \fIhttp://tor\&.eff\&.org/\fR\&. In this case, the \fBfwknopd\fR server will need to be configured to listen on the target TCP port (which is 62201 by default)\&. .RE .PP \fB\-Q, \-\-spoof\-src\fR=\fI\fR .RS 4 Spoof the source address from which the \fBfwknop\fR client sends SPA packets\&. This requires root on the client side access since a raw socket is required to accomplish this\&. Note that the \fB\-\-spoof\-user\fR argument can be given in this mode in order to pass any \fBREQUIRE_USERNAME\fR keyword that might be specified in \fI/etc/fwknop/access\&.conf\fR\&. .RE .PP \fB\-r, \-\-rand\-port\fR .RS 4 Instruct the \fBfwknop\fR client to send an SPA packet over a random destination port between 10,000 and 65535\&. The \fBfwknopd\fR 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: \(lq+udp dst portrange 10000\-65535+\(rq\&. .RE .PP \fB\-R, \-\-resolve\-ip\-https\fR .RS 4 This is an important option, and instructs the \fBfwknop\fR client to issue an HTTPS request to a script running on \fIcipherdyne\&.org\fR that returns the client\(cqs IP address (as seen by the web server)\&. In some cases, this is needed to determine the IP address that should be allowed through the firewall policy at the remote \fBfwknopd\fR server side\&. This option is useful if the \fBfwknop\fR client is being used on a system that is behind an obscure NAT address, and the external Internet facing IP is not known to the user\&. The full resolution URL is: \fIhttps://www\&.cipherdyne\&.org/cgi\-bin/myip\fR, and is accessed by \fBfwknop\fR via \fIwget\fR in \fB\-\-secure\-protocol\fR mode\&. Note that it is generally more secure to use the \fB\-a\fR option if the externally routable IP address for the client is already known to the user since this eliminates the need for \fBfwknop\fR to issue any sort of HTTPS request\&. .RE .PP \fB\-\-resolve\-url\fR \fI\fR .RS 4 Override the default URL used for resolving the source IP address\&. For best results, the URL specified here should point to a web service that provides just an IP address in the body of the HTTP response\&. .RE .PP \fB\-\-resolve\-http\-only\fR .RS 4 This option forces the \fBfwknop\fR client to resolve the external IP via HTTP instead of HTTPS\&. There are some circumstances where this might be necessary such as when \fIwget\fR is not available (or hasn\(cqt been compiled with SSL support), but generally this is not recommended since it opens the possibility of a MITM attack through manipulation of the IP resolution HTTP response\&. Either specify the IP manually with \fB\-a\fR, or use \fB\-R\fR and omit this option\&. .RE .PP \fB\-w, \-\-wget\-cmd\fR=\fI\fR .RS 4 Manually set the full path to the \fIwget\fR command\&. Normally the \fIconfigure\fR script finds the \fIwget\fR command, but this option can be used to specify the path if it is located in a non\-standard place\&. .RE .PP \fB\-s, \-\-source\-ip\fR .RS 4 Instruct the \fBfwknop\fR 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 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 \fB\-a\fR are mutually exclusive\&. .RE .PP \fB\-S, \-\-source\-port\fR=\fI\fR .RS 4 Set the source port for outgoing SPA packet\&. .RE .PP \fB\-\-server\-resolve\-ipv4\fR .RS 4 This option forces the \fBfwknop\fR client to only accept an IPv4 address from DNS when a hostname is used for the SPA server\&. This is necessary in some cases where DNS may return both IPv6 and IPv4 addresses\&. .RE .PP \fB\-f, \-\-fw\-timeout\fR=\fI\fR .RS 4 Specify the length of time (seconds) that the remote firewall rule that grants access to a service is to remain active\&. The default maintained by \fBfwknopd\fR is 30 seconds, but any established connection can be kept open after the initial accept rule is deleted through the use of a connection tracking mechanism that may be offered by the firewall\&. .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, \fBSHA3_256\fR, and \fBSHA3_512\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 \fI/etc/fwknop/access\&.conf\fR file on the server side via the ENCRYPTION_MODE variable\&. In general, it is recommended to not include this argument and let the default (CBC) apply\&. 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