Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
securesocketfunneling committed Nov 13, 2017
1 parent a7308a8 commit 5d58822
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 51 deletions.
12 changes: 6 additions & 6 deletions BUILD_CROSS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ which can be used to cross-compile applications for the Raspberry Pi 2/3
platform. On Debian/Ubuntu you can install it using the package manager.

```
apt-get install g++-arm-linux-gnueabihf
# apt-get install g++-arm-linux-gnueabihf
```

Building dependencies
Expand All @@ -22,8 +22,8 @@ SSF depends on Boost and OpenSSL, these need to be cross-compiled separately.
To make your life easier, use the scripts provided in `builddeps/`.

```
CROSS_PREFIX=arm-linux-gnueabihf- /path/to/ssf/source/builddeps/build_openssl.sh /path/to/openssl/prefix/
CROSS_PREFIX=arm-linux-gnueabihf- /path/to/ssf/source/builddeps/build_boost.sh /path/to/boost/prefix
$ CROSS_PREFIX=arm-linux-gnueabihf- /path/to/ssf/source/builddeps/build_openssl.sh /path/to/openssl-1.0.2m.tar.gz 1.0.2m /path/to/openssl/prefix/
$ CROSS_PREFIX=arm-linux-gnueabihf- /path/to/ssf/source/builddeps/build_boost.sh /path/to/boost_1_65_1.tar.bz2 1_65_1 /path/to/boost/prefix
```

Building SSF
Expand All @@ -50,18 +50,18 @@ variable. You might want to add the following line to the toolchain
configuration file:

```
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
```

Then, from the build directory, invoke `cmake` specifying your toolchain
configuration file using the `-DCMAKE_TOOLCHAIN_FILE` parameter:

```
cmake -DUSE_STATIC_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=arm-linux-gnueabihf.cmake -DBOOST_ROOT=/path/to/boost/prefix -DOPENSSL_ROOT_DIR=/path/to/openssl/prefix /path/to/ssf/source
$ cmake /path/to/ssf/source -DUSE_STATIC_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=arm-linux-gnueabihf.cmake -DBOOST_ROOT=/path/to/boost/prefix -DOPENSSL_ROOT_DIR=/path/to/openssl/prefix
```

Then proceed to build SSF:

```
make
$ make
```
10 changes: 2 additions & 8 deletions BUILD_UNIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ are checked out:

```
$ git clone https://github.com/securesocketfunnelling/ssf.git
$ git submodule update --init third_party/http-parser/http-parser third_party/msgpack/msgpack-c
```

`third_party/googletest` is only required if you intend to run unit tests.

```
$ git submodule update --init third_party/googletest
$ git submodule update --init
```

Create a build directory and generate the projet makefiles in it.
Expand Down Expand Up @@ -79,5 +73,5 @@ You can install SSF on your system using `make install`. The full install
directory is the content of `CMAKE_INSTALL_PREFIX` prepended to `DESTDIR`.

```
make install DESTDIR=/install_path
$ make install DESTDIR=/install_path
```
26 changes: 10 additions & 16 deletions BUILD_WIN32.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Replace `msvc-14.1` with your version of Visual Studio.
You will then need to point the cmake `BOOST_ROOT` variable to the location
of the boost install (By default: `C:\local\boost_1_65_1`).

* OpenSSL 1.0.2l:
* OpenSSL 1.0.2m:

Install `Win32OpenSSL-1_0_2L.exe` (32-bit) or `Win64OpenSSL-1_0_2L.exe` (64-bit)
Install `Win32OpenSSL-1_0_2m.exe` (32-bit) or `Win64OpenSSL-1_0_2m.exe` (64-bit)
from https://slproweb.com/products/Win32OpenSSL.html

*NOTE*: OpenSSL versions 1.1 is currently incompatible with Boost.
Expand All @@ -45,19 +45,19 @@ First prepare a build directory, download boost and openssl source and place
them inside the build directory:

```
C:\Users\you>mkdir C:\build
C:\Users\you>cd C:\build
C:\Users\user> mkdir C:\build
C:\Users\user> cd C:\build
```

Boost 1.65.1 can be downloaded from https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.bz2
and OpenSSL 1.0.2l from https://www.openssl.org/source/openssl-1.0.2l.tar.gz
and OpenSSL 1.0.2m from https://www.openssl.org/source/openssl-1.0.2m.tar.gz

### Building boost

Build Boost using `build_boost.bat`

```
C:\build>C:\path_to_ssf_source\builddeps\build_boost.bat 32 C:\boost
C:\build> C:\path_to_ssf_source\builddeps\build_boost.bat C:\Users\user\Downloads\boost_1_65_1.tar.bz2 1_65_1 32 C:\boost
```

Pass `32` for 32-bit or `64` for 64-bit builds. Boost headers and
Expand All @@ -82,7 +82,7 @@ Make sure `perl.exe` and `nasm.exe` can be found in your environment before
running the following commands (adjust `Path` if needed).

```
C:\build>C:\path_to_ssf_source\builddeps\build_openssl.bat 32 C:\openssl
C:\build> C:\path_to_ssf_source\builddeps\build_openssl.bat C:\Users\user\Downloads\openssl-1.0.2m.tar.gz 1.0.2m 32 C:\openssl
```

Pass `32` for 32-bit or `64` for 64-bit builds. OpenSSL headers and
Expand All @@ -100,21 +100,15 @@ If you obtained the source for the git repository, make sure the submodules
are checked out:

```
C:\path_to_ssf_source>git submodule update --init third_party/http-parser/http-parser third_party/msgpack/msgpack-c
```

`third_party/googletest` is only required if you intend to run unit tests.

```
C:\path_to_ssf_source>git submodule update --init third_party/googletest
C:\path_to_ssf_source> git submodule update --init
```

Generate the project files with CMake in your build directory. Point the
`BOOST_ROOT` and `OPENSSL_ROOT_DIR` variables to the correct location
(or leave empty for default settings).

```
C:\build>cmake C:\path_to_ssf_source -DBOOST_ROOT=C:\local\boost_1_65_1 -DUSE_STATIC_LIBS=ON
C:\build> cmake C:\path_to_ssf_source -DBOOST_ROOT=C:\local\boost_1_65_1 -DOPENSSL_ROOT_DIR=C:\OpenSSL-Win32 -DUSE_STATIC_LIBS=ON
```

Various parameters can be customized when generating the project files:
Expand All @@ -134,7 +128,7 @@ use raw TCP and be left unsecured. Provided for testing purpose only.
Proceed to build SSF:

```
C:\build>cmake . --config Release
C:\build> cmake --build . --config Release
```

Binaries are located in: `src\client\Release\ssf.exe`, `src\client\Release\ssfcp.exe`
Expand Down
28 changes: 24 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,39 @@
# Change Log

## 2.3.0
## 3.0.0

/!\ BC break with version 2.\*.\*

Features:
* Rename executables:
- `ssfc` -> `ssf`
- `ssfs` -> `ssfd`
* #46 Automatic client reconnection:
- Max unsuccessful connection attempts before stopping (`--max-connect-attemps`)
- Time to wait before attempting to reconnect (`--reconnect-delay`)
- Do not try to reconnect client if connection is interrupted (`--no-reconnect`)
* #39 Windows XP support (use `-T vXXX_xp` CMake option)
* #14 SOCKS proxy support (no authentication), cf. configuration file
* Refactor `ssfcp`:
- Attempt to resume file transfer if the destination file exists (`--resume`)
- Copy files recursively (`-r`)
- Max transfers in parallel (`--max-transfers`)
- Check file integrity at the end of the transfer (`--check-integrity`)
* Refactor logs (use `spdlog` library)
* Refactor command line (use `cxxopts` library)
* Remove `-b` client command line option (replaced by `circuit` configuration file key)
* Compatibility with `boost-1.63.0` and `openssl-1.0.2k`
* Compatibility with `boost-1.65.1` and `openssl-1.0.2m`
* Improve build system (cf. [BUILD_WIN32.md](BUILD_WIN32.md), [BUILD_UNIX.md](BUILD_UNIX.md), [BUILD_CROSS.md](BUILD_CROSS.md))
* Use `msgpack` library instead of boost serialization

Fixed bugs:
* #32 SOCKS v5 microservice
* #35 Use `reuse_addr` socket option on listener microservices (`stream_listener`, `datagram_listener`)
* #35 Use `reuse_addr` socket option on `ssfd` and listener microservices (`stream_listener`, `datagram_listener`)
* Improve memory management
* Improve server stability
* Improve client and server stability

[Configuration file](README.md#configuration-file):
* #41 Add user agent configuration for HTTP proxy (`http_proxy.user_agent` key)
* Allow TLS parameters as buffers (`tls.ca_cert_buffer`, `tls.cert_buffer`, `tls.key_buffer`, `tls.dh_buffer` keys)
* Move circuit configuration into configuration file (`circuit` key)
* Add an option to save command line arguments (`arguments` key)
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set(CMAKE_CXX_STANDARD 14)

set(SSF_VERSION_MAJOR 2)
set(SSF_VERSION_MINOR 2)
set(SSF_VERSION_MAJOR 3)
set(SSF_VERSION_MINOR 0)
set(SSF_VERSION_FIX 0)
set(SSF_VERSION_CIRCUIT 2)
set(SSF_VERSION_TRANSPORT 2)
Expand Down Expand Up @@ -120,6 +120,7 @@ if(OPENSSL_USE_STATIC_LIBS AND MSVC_VERSION)
target_link_libraries(ssl INTERFACE iob_func)
endif(NOT HAVE_IOB_FUNC)
endif()
message(STATUS "OpenSSL version: ${OPENSSL_VERSION}")

# --- http-parser components
add_subdirectory(third_party/http-parser)
Expand Down Expand Up @@ -155,4 +156,4 @@ message(STATUS " RTTI disabled: ${DISABLE_RTTI}")
message(STATUS " Logs disabled: ${DISABLE_LOGS}")
if (UNIX)
message(STATUS " Syslog collector enabled: ${ENABLE_SYSLOG}")
endif (UNIX)
endif (UNIX)
5 changes: 4 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
Copyright (c) 2015 SSF
Copyright (c) 2017 SSF

This software is using:
* Boost project released with Boost Software License 1.0
* OpenSSL project released with OpenSSL License and SSLeay License
* Google Test project released with BSD 3-Clause license
* CMake modules project released with Boost Software License 1.0
* HTTP Parser project released with MIT license
* cxxopts project released with MIT license
* spdlog project released with MIT license
* msgpack-c project released with Boost Software License 1.0

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,27 @@ Features:
* Local and remote UDP port forwarding
* Local and remote SOCKS server
* Local and remote shell through sockets
* File copy
* Native relay protocol
* TLS connection with the strongest cipher-suites

[Download prebuilt binaries](https://securesocketfunneling.github.io/ssf/#download)

[Documentation](https://securesocketfunneling.github.io/ssf/)

[Build on Windows](BUILD_WIN32.md)

[Build on Unix/Linux](BUILD_UNIX.md)

[Cross compiling SSF (e.g. Raspberry Pi)](BUILD_CROSS.md)

## How to use

### Command line

#### Client

Usage: `ssf [options] server_address`
Usage: `ssf[.exe] [options] server_address`

Options:

Expand All @@ -41,10 +48,10 @@ Remote port (default: 8011)
Specify configuration file. If not set, 'config.json' is loaded from the
current working directory

* `-m max-connect-attempts`:
Number of unsuccessful connection attempts before stopping (default: 1)
* `-m attempts`:
Max unsuccessful connection attempts before stopping (default: 1)

* `-t reconnect-delay`:
* `-t delay`:
Time to wait before attempting to reconnect in seconds (default: 60)

* `-n`:
Expand All @@ -57,6 +64,8 @@ specific address rather than "localhost"
* `-S`:
Display microservices status (on/off)

Services options:

* `-D [[bind_address]:]port`:
Run a SOCKS proxy on the server accessible on `[[bind_address]:]port` on the
local side
Expand Down Expand Up @@ -89,7 +98,7 @@ on the local side

#### Server

Usage: `ssfd [options]`
Usage: `ssfd[.exe] [options]`

Options:

Expand Down Expand Up @@ -133,7 +142,7 @@ The copy feature must be enabled on both client and server configuration file:
}
```

Usage: `ssfcp [options] [host@]/absolute/path/file [[host@]/absolute/path/file]`
Usage: `ssfcp[.exe] [options] [host@]/absolute/path/file [[host@]/absolute/path/file]`

Options:

Expand Down Expand Up @@ -162,8 +171,8 @@ Check file integrity at the end of the transfer
* `-r`:
Copy files recursively

* `--max-transfers`:
Number of transfers in parallel (default: 1)
* `--max-transfers arg`:
Max transfers in parallel (default: 1)

### Examples

Expand Down Expand Up @@ -234,6 +243,7 @@ ssfcp [-c config_file] [-p port] -r remote_host@path/to/dir absolute/path/direct
"http_proxy": {
"host": "",
"port": "",
"user_agent": "",
"credentials": {
"username": "",
"password": "",
Expand Down Expand Up @@ -345,6 +355,7 @@ SSF supports connection through:
|:----------------------------------|:----------------------------------------------------------------------------------------------------------|
| http_proxy.host | HTTP proxy host |
| http_proxy.port | HTTP proxy port |
| http_proxy.user_agent | User-Agent header value in HTTP CONNECT request |
| http_proxy.credentials.username | proxy username credentials (all platform: Basic or Digest, Windows: NTLM and Negotiate if reuse = false) |
| http_proxy.credentials.password | proxy password credentials (all platform: Basic or Digest, Windows: NTLM and Negotiate if reuse = false) |
| http_proxy.credentials.domain | user domain (NTLM and Negotiate auth on Windows only) |
Expand Down Expand Up @@ -456,7 +467,7 @@ There are 7 microservices:
* stream_listener
* datagram_forwarder
* datagram_listener
* file_copy
* copy
* socks
* shell

Expand Down Expand Up @@ -489,7 +500,7 @@ Here is the default microservices configuration:
"stream_forwarder": { "enable": true },
"stream_listener": { "enable": true },
"socks": { "enable": true },
"file_copy": { "enable": false },
"copy": { "enable": false },
"shell": { "enable": false }
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/core/command_line/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ bool Base::DisplayHelp(const Options& opts) {
return false;
}

#ifndef SSF_DISABLE_LOGS
std::cerr << opts.help(opts.groups()) << std::endl;

std::cerr << "Using Boost " << ssf::versions::boost_version << " and OpenSSL "
<< ssf::versions::openssl_version << std::endl
<< std::endl;
#endif // SSF_DISABLE_LOGS

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/command_line/copy/command_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ void CopyCommandLine::InitOptions(Options& opts) {
("resume", "Attempt to resume operation if the destination file exists")
("check-integrity", "Check file integrity")
("r,recursive", "Copy files recursively")
("max-transfers", "Number of transfers in parallel",
("max-transfers", "Max transfers in parallel",
cxxopts::value<uint32_t>()->default_value("1"))
("args", "", cxxopts::value<std::vector<std::string>>());

opts.parse_positional("args");
opts.positional_help("[host@]source_path [host@]destination_path");
opts.positional_help("[host@]source_path [[host@]destination_path]");

// clang-format on
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/command_line/standard/command_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void StandardCommandLine::InitOptions(Options& opts) {
// client cli
opts.add_options()
("m,max-connect-attempts",
"Number of unsuccessful connection attempts before stopping",
"Max unsuccessful connection attempts before stopping",
cxxopts::value<uint32_t>()->default_value("1"))
("t,reconnect-delay",
"Time to wait before attempting to reconnect",
Expand Down

0 comments on commit 5d58822

Please sign in to comment.