Skip to content

Instantly share code, notes, and snippets.

View codref's full-sized avatar

codref*, your solution pointer codref

View GitHub Profile
@codref
codref / go-ssh-reverse-tunnel.go
Last active October 23, 2023 13:32
Go SSH reverse tunnel implementation (SSH -R)
/*
Go-Language implementation of an SSH Reverse Tunnel, the equivalent of below SSH command:
ssh -R 8080:127.0.0.1:8080 operatore@146.148.22.123
which opens a tunnel between the two endpoints and permit to exchange information on this direction:
server:8080 -----> client:8080
Opened log file 'c:\CrashDumps\20150810_202716_Crash_Mode\ADPlus_log_03a8_2015-08-10_20-27-16-303.log'
0:001> as AdpOutputDir c:\CrashDumps
0:001> as AdpDumpDirEsc c:\\CrashDumps\\20150810_202716_Crash_Mode
0:001> as AdpTimeStamp 20150810_202716
0:001> *
0:001> *----- OS and Time Information ----
0:001> vertarget
Windows 8 Version 9600 MP (12 procs) Free x64
Product: Server, suite: TerminalServer SingleUserTS
kernel32.dll version: 6.3.9600.17415 (winblue_r4.141028-1500)