darkssh

package module
v0.0.0-...-0cf20dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2022 License: MIT Imports: 9 Imported by: 0

README

DarkSSH - SSH-over-Anonymous-Networks for Go

This is a tool for automatically connecting to SSH Servers and SSH-based Services which are hosted on .i2p and .onion resources. Given an .i2p or .onion host, it will dial out using their respective sockets. It is used to make managing many .i2p or .onion-hosted SSH services easier by natively handling the known_hosts file and automatically handling proxy setup and client key-management for services which use blocklisting and allowlisting facilities provided by the hidden services, or even more sophisticated features like Encrypted LeaseSets. As a fringe benefit, when addressing services by their cryptographic identifiers(i.e. the .b32.i2p or .onion domains) there is no chance of impersonation. Eventually, it will implement a drop-in replacement for a real SSH client so it can be used as a ProxyCommand or as part of a .i2p or .onion only selfhosted workflow.

What's in this repository:

# a terminal SSH client - interface is *UNSTABLE*, forked from goph
# for modification
./cmd/darkssh
# a slightly-modified version of melbahja/goph, which automatically
# configures itself for I2P and Tor Transports
./goph
# implementations of the required interfaces for x/crypto/ssh
./

The goal is to be exactly compatible with any other SSH client, so things that proxy commands to SSH, like rsync or SSHFS, can use it instead when someone wants to use such a tool over Tor or I2P.

Eventually, an SSH server will also be implemented.

Documentation

Index

Constants

View Source
const (
	// STREAMING is an I2P Streaming Session
	STREAMING string = "st"
	// DATAGRAMS is an I2P Datagram Session
	DATAGRAMS string = "dg"
)
View Source
const (
	// TORTCP a TOR TCP session
	TORTCP string = "tor"
)

Variables

View Source
var CONTROLPort = "9051"

CONTROLPort is the port used for controlling Tor

View Source
var Options_SSH = []string{"inbound.length=2", "outbound.length=2", "inbound.lengthVariance=0", "outbound.lengthVariance=0", "inbound.quantity=3", "outbound.quantity=3", "inbound.backupQuantity=2", "outbound.backupQuantity=2", "i2cp.closeOnIdle=false", "i2cp.reduceOnIdle=false", "i2cp.leaseSetEncType=4,0"}
View Source
var SAMHost = "127.0.0.1"

SAMHost is the SAM API bridge host

View Source
var SAMPort = "7656"

SAMPort is the SAM API bridge port

View Source
var SOCKSPort = "9050"

SOCKSPort is the port used for the Tor SOCKS proxy

View Source
var TORHost = "127.0.0.1"

TORHost is the host where Tor is running

Functions

func CONTROLHostAddress

func CONTROLHostAddress() string

CONTROLHostAddress gets you the address of the Tor Control Port

func DialConn

func DialConn(network, addr string) (net.Conn, error)

func DialI2P

func DialI2P(network, addr string, config *ssh.ClientConfig) (*ssh.Client, error)

DialI2P returns an ssh.Client configured to connect via I2P. It accepts "st" or "dg" in the "Network" parameter, for "streaming" or "datagram" based connections. It is otherwise identical to ssh.Dial

func DialI2PConn

func DialI2PConn(net, addr string) (net.Conn, error)

func DialI2PDatagrams

func DialI2PDatagrams(net, addr string) (net.Conn, error)

func DialI2PStreaming

func DialI2PStreaming(net, addr string) (net.Conn, error)

func DialTor

func DialTor(network, addr string, config *ssh.ClientConfig) (*ssh.Client, error)

DialTor returns an ssh.Client configured to connect via Tor. It accepts "st" or "dg" in the "Network" parameter, for "streaming" or "datagram" based connections. It is otherwise identical to ssh.Dial

func DialTorStreaming

func DialTorStreaming(network, addr string) (net.Conn, error)

func ListenI2P

func ListenI2P(network string, config *sshd.Option) (net.Listener, error)

func ListenI2PDatagrams

func ListenI2PDatagrams() (net.Listener, error)

func ListenI2PStreaming

func ListenI2PStreaming() (net.Listener, error)

func SAMHostAddress

func SAMHostAddress() string

SAMHostAddress combines SAMHost and SAMPort

func SOCKSHostAddress

func SOCKSHostAddress() string

SOCKSHostAddress gives you the address of the Tor SOCKS port

func Server

func Server(config *sshd.Option) (*sshd.Server, error)

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL