项目作者: uroesch

项目描述 :
Windows frontend for digging SSH tunnels and creating socks proxies
高级语言: AutoIt
项目地址: git://github.com/uroesch/PlinkProxy.git
创建时间: 2020-03-14T15:09:07Z
项目社区:https://github.com/uroesch/PlinkProxy

开源协议:MIT License

下载


Build
GitHub release (latest by date including pre-releases)
Runs on
GitHub All Releases

PlinkProxy

Executive Overview

PlinkProxy is a small wrapper and INI configuration file around the plink
command from the Putty suite of tools. It is meant to dig ssh
tunnels and create socks proxies into various networks to cut down on
excessive jump host hoping.

It was conceived in a corporate environment with many segragated networks which
were not directly accessible from the desktop. But the resources to be managed be it
databases, middleware service and web services to name but a few, required graphical
access to these resources.

PlinkProxy has been successfully used with FoxyProxy, DBeaver,
WinSCP and FreeRDP over SOCKS5 and LDAP Admin,
Apache Directory Studio over local SSH tunnel.

Screenshot

Plink Proxy Control Window

Prerequisites

Build Dependencies

Installation

Download

The latest release can be obtained from the
github releases page.
It is provided in the form of a ZIP file or a OneClick installer.
Important note: PlinkProxy depends on pageant and plink which
are not included in the ZIP and OneClick installer.

ZIP File

PlinkProxy was written with portability in mind. The ZIP file expands into
a directory called PlinkProxy which contains the PlinkProxy.exe file and
a sample configuration file (PlinkProxy.ini-sample). Before running the
binary copy the PlinkProxy.ini-sample file to PlinkProxy.ini and modify
to match your environment. Then run PlinkProxy.exe.

OneClick Installer

The provided installer is as minimial as it possibly can get. The installtion
copies files to the %AppData%\PlinkProxy directory and creates a start menu
item. To start the application navigate to the %AppData%\PlinkProxy
directory and rename the PlinkProxy.ini-sample file to PlinkProxy.ini.
Change the freshly copied configuration file to match your environment.
Go to the start menu and navigate to the PlinkProxy entry and start the
application.

Note: Since the installer and the included binaries are not not signed it
is very likely that it will be flagged as virus or malware. But don’t dispair
there is work underway to mitigate the issue.

PortableApp

If you want to run PlinkProxy from within the
PortableApps.com platform you can do so by
downloading it here.
Note: Newer versions to bundle with pageant and plink.

Configuration

Introduction

PlinkProxy.exe requires a configuration file called PlinkProxy.ini to be
present in the same directory as the executable. If it is a new installation
copy the file PlinkProxy.ini-sample to PlinkProxy.ini and modify the file
to suit your needs.

The INI configuration is split into 2 distinct sections. The first one is
called Globals and defines settings used in all the plink connections.

Further, each connection is defined in its own section staring with either
Socket or LocalTunnel followed by a colon : and then the port number.
E.g. Socket:8880.

Below are some more details how to setup the INI file for your environment.

Example Globals

  1. [Globals]
  2. login = joedoe
  3. path = %ProgramFiles%\Putty
  4. ssh_keys_dir = %UserProfile%\etc
  5. first_hop = jumphost.acme.org
  6. first_hop_hostkey = 01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef
  7. plink_options = -N -A -v -batch
  • login defines the user name used for the first_hop and the jump_hosts
  • path is used to locate the plink executable. Windows command variables are
    being properly expanded.
  • first_hop is the jump_host which is used to initiate the second hop to the
  • first_hop_hostkey is the host key fingerprint shown when running plink -v <first_hop> (>= v0.0.15-alpha)
    final destination.
  • plink_options are the global options used to spawn the connection.

Since version v0.0.14-alpha a special environmental variable called %ScriptDir%
has been added. It expands to the directory where the PlinkProxy.exe is run from.
This is a handy shortcut for the path defintion should plink.exe and
pageant.exe be located in the same directory as PlinkProxy.exe.

Example Socks

  1. [Socks:8881]
  2. name = dmz
  3. enabled = yes
  4. setup = no
  5. jump_login = jamesbond
  6. jump_host = dmz-jumphost.acme.org
  7. jump_hostkey = 01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef
  8. jump_port = 2222
  • Socks:8881 instructs to create a local Socks proxy on port 8881.
    Equivalent to -D 8881 on the command line.
  • enabled should the socks proxy be started or not. Accepts yes or no.
  • setup set to yes if the jumphost is used for the first time. Accepts yes or no
  • jump_login override the globals login value with a different login name. (>= v0.0.15-alpha)
  • jump_host defines the termination point of the Socks proxy.
  • jump_hostkey is the host key fingerprint shown when running plink -v <jump_host> (>= v0.0.15-alpha)
  • jump_port defines the port of jump_host's connection, if ommited defaults to 22.

Example LocalTunnel

  1. [LocalTunnel:11636]
  2. name = ldap-server
  3. enabled = yes
  4. setup = no
  5. jump_login = fritz
  6. jump_host = dmz-jumphost
  7. jump_hostkey = 01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef
  8. target_host = ldap.dmz.acme.org
  9. target_port = 636
  • LocalTunnel:11636 instructs to create a local tunnel port forward on 11636.
  • enabled should the tunnel be started or not. Accepts yes or no.
  • setup set to yes if the jumphost is used for the first time. Accepts yes or no.
  • jump_login override the globals login value with a different login name. (>= v0.0.15-alpha)
  • jump_host defines the termination point of the tunnel.
  • jump_hostkey is the host key fingerprint shown when running plink -v <jump_host> (>= v0.0.15-alpha)
  • target_host forward address or ip when leaving the tunnel.
  • target_port forward port when leaving the tunnel.

Command line equivalent of -L 11636:ldap.dmz.acme.org:636

Example RemoteTunnel

With version v0.0.10-alpha the new tunnel type RemoteTunnel was introduced.

  1. [RemoteTunnel:5900]
  2. name = vnc-remote-assistance
  3. enabled = yes
  4. setup = no
  5. jump_login = greta
  6. jump_host = jumphost.acme.org
  7. jump_hostkey = 01:23:45:67:89:ab:cd:ef:01:23:45:67:89:ab:cd:ef
  8. target_host = localhost
  9. target_port = 5900
  • RemoteTunnel:5900 instructs to create a remote tunnel listening on port 5900
    of the jump_hosts‘s loopback interface.
  • enabled should the tunnel be started or not. Accepts yes or no.
  • setup set to yes if the jumphost is used for the first time. Accepts yes or no.
  • jump_login override the globals login value with a different login name. (>= v0.0.15-alpha)
  • jump_host defines the termination point of the tunnel where to listen for incoming traffic.
  • jump_hostkey is the host key fingerprint shown when running plink -v <jump_host> (>= v0.0.15-alpha)
  • target_host forward address or ip when receiving a connection on the tunnel.
  • target_port forward port when receiving a connection on the tunnel.

Command line equivalent of -R 5900:localhost:5900

Note: The global option for remote tunnels which listens on all interfaces is not yet implemented.
Due internal data representation a remote tunnel must use a unique port number with in the [RemoteTunnel]
namespace.

Commandline Options

Since version v0.0.11-alpha PlinkProxy is able to parse command line options. Below is a list of the
short and long options available.

  1. Usage:
  2. PlinkProxy.exe <Options>
  3. Options:
  4. -h | --help
  5. Display this message and exit
  6. -c | --config-file
  7. Path to config file
  8. Default: PlinkProxy.ini
  9. -l | --log-file
  10. Path to log file
  11. Default: PlinkProxy.log

Further Reading

Build

There is a small cmd build script (CompilePlinkProxy.cmd) to compile and ZIP up the relase.

  1. C:> cmd\CompilePlinkProxy.cmd

Known Issues

  • Update of status list not working correctly if name of connection was changed.
  • Setup mode constains logic errors and does not work as initially intended.

Todo

  • Make it a tray application.
  • Enable overriding defaults from the Globals section in each of the connections.