Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdolitsky/go-pivot-ssh
Simple Go-based tool to proxy local TCP connections over an SSH tunnel
https://github.com/jdolitsky/go-pivot-ssh
golang pivot proxy ssh tunnel
Last synced: 6 days ago
JSON representation
Simple Go-based tool to proxy local TCP connections over an SSH tunnel
- Host: GitHub
- URL: https://github.com/jdolitsky/go-pivot-ssh
- Owner: jdolitsky
- License: mit
- Created: 2021-11-11T15:15:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-11T19:50:32.000Z (almost 3 years ago)
- Last Synced: 2024-10-10T23:47:09.489Z (27 days ago)
- Topics: golang, pivot, proxy, ssh, tunnel
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-pivot-ssh
Simple Go-based tool to proxy local TCP connections
over an SSH tunnel.Uses host entries found in `~/.ssh/config`
for authentication. If no `IdentifyFile` is
defined for a given host, user will be
prompted to enter password.## How to use
Install (requires Go):
```
git clone https://github.com/jdolitsky/go-pivot-ssh.git 2>/dev/null && \
(cd go-pivot-ssh && go build -o /usr/local/bin/pivot-ssh .) && \
rm -rf go-pivot-ssh/
```Usage:
```
pivot-ssh
```## Example
For example, access service at `10.1.1.55:80`, which is only
reachable via `10.11.1.123` (which you have SSH access to).In your `~/.ssh/config`, add info about the host:
```
$ cat ~/.ssh/config
Host 10.11.1.123
User myuser
Port 2222
```Then start a local listener at `127.0.0.1:8080` which
will forward traffic to `10.1.1.55:80` over SSH tunnel:```
$ pivot-ssh 10.11.1.123 127.0.0.1:8080 10.1.1.55:80
Enter SSH password:
2021/11/11 09:46:43.239008 listening for new connections...
2021/11/11 09:46:45.711348 accepted connection
2021/11/11 09:46:45.711387 listening for new connections...
2021/11/11 09:46:46.248858 connected to 10.11.1.123:2222 (1 of 2)
2021/11/11 09:46:46.525407 connected to 10.1.1.55:80 (2 of 2)
```## Credits
Powered by the following Go libraries:
- https://github.com/elliotchance/sshtunnel
- https://github.com/kevinburke/ssh_config