• Stars
    star
    203
  • Rank 192,890 (Top 4 %)
  • Language
    Go
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reverse SOCKS5 implementation in Go

CircleCI Codacy Badge

revsocks

Reverse socks5 tunneler with SSL/TLS and proxy support (without proxy authentication and with basic/NTLM proxy authentication) Based on https://github.com/brimstone/rsocks and https://github.com/llkat/rsockstun

Features

  • Single executable (thanks to Go!)
  • Linux/Windows/Mac/BSD support
  • Encrypted communication with TLS
  • DNS tunneling support (SOCKS5 over DNS)
  • Support for proxies (without authentication or with basic/NTLM proxy authentication)
  • Automatic SSL/TLS certificate generation if not specified

Architecture

  • server = locally listening socks server
  • client = client which connects back to server

Usage

reverse TCP

Usage:
1) Start on VPS: revsocks -listen :8443 -socks 127.0.0.1:1080 -pass SuperSecretPassword
2) Start on client: revsocks -connect clientIP:8443 -pass SuperSecretPassword
3) Connect to 127.0.0.1:1080 on the VPS with any socks5 client.
4) Enjoy. :]

DNS tunnel

0) setup your domain records
1) Start on the DNS server: revsocks -dns example.com -dnslisten :53 -socks 127.0.0.1:1080 -pass 52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64
2) Start on the target: revsocks -dns example.com -pass 52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64
3) Connect to 127.0.0.1:1080 on the DNS server with any socks5 client.

Useful parameters

Add params:
 -proxy 1.2.3.4:3128 - connect via proxy
 -proxyauth Domain/username:password  - proxy creds
 -proxytimeout 2000 - server and clients will wait for 2000 msec for proxy connections... (Sometime it should be up to 4000...)
 -useragent "Internet Explorer 9.99" - User-Agent used in proxy connection (sometimes it is usefull)
 -pass Password12345 - challenge password between client and server (if not match - server reply 301 redirect)
 -recn - reconnect times number. Default is 3. If 0 - infinite reconnection
 -rect - time delay in secs between reconnection attempts. Default is 30

Options

Complete list of command line options

  -cert string
    	certificate file
  -connect string
    	connect address:port
  -debug
    	display debug info
  -dns string
    	DNS domain to use for DNS tunneling
  -dnsdelay string
    	Delay/sleep time between requests (200ms by default)
  -dnslisten string
    	Where should DNS server listen
  -listen string
    	listen port for receiver address:port
  -pass string
    	Connect password
  -proxy string
    	proxy address:port
  -proxyauth string
    	proxy auth Domain/user:Password
  -proxytimeout string
    	proxy response timeout (ms)
  -q	Be quiet
  -recn int
    	reconnection limit (default 3)
  -rect int
    	reconnection delay (default 30)
  -socks string
    	socks address:port (default "127.0.0.1:1080")
  -useragent string
    	User-Agent
  -verify
    	verify TLS connection
  -version
    	version information

Requirements

  • Go 1.4 or higher
  • Few external Go modules (yamux, go-socks5 and go-ntlmssp)

Compile and Installation

Linux VPS

  • install Golang: apt install golang make
make

launch:

./revsocks -listen :8443 -socks 127.0.0.1:1080 -pass Password1234

Windows client:

  • download and install golang
go get
go build

Windows optional

optional: to build as Windows GUI:

go build -ldflags -H=windowsgui

You can also compress exe - just use any exe packer, ex: UPX

upx revsocks

Usage examples

revsocks -connect clientIP:8443 -pass Password1234

or with proxy and user agent:

revsocks -connect clientIP:8443 -pass Password1234 -proxy proxy.domain.local:3128 -proxyauth Domain/userpame:userpass -useragent "Mozilla 5.0/IE Windows 10"

Client connects to server and send agentpassword to authorize on server. If server does not receive agentpassword or reveive wrong pass from client (for example if spider or client browser connects to server ) then it send HTTP 301 redirect code to www.microsoft.com

Custom certificate

Generate self-signed certificate with openssl:

openssl req -new -x509 -keyout server.key -out server.crt -days 365 -nodes

Debug

For debugging (especially DNS part):

go build -tags debug

More Repositories

1

dvcs-ripper

Rip web accessible (distributed) version control systems: SVN/GIT/HG...
Perl
1,583
star
2

nmap-android

Nmap on Android - Makefile/diff/scripts to build it with Android NDK
Makefile
247
star
3

dockscan

dockscan is security vulnerability and audit scanner for Docker installations
Ruby
214
star
4

android-elf-cleaner

Android ELF cleaner
C
126
star
5

docker-alpine

Alpine based images for Docker - Fundamental ones
Shell
99
star
6

mikrotik-npk

Python tools for manipulating Mikrotik NPK format
Python
73
star
7

tty2web

Share your terminal as a web application in bind/reverse mode
Go
70
star
8

docker-webscan

Dockerized versions of various web security scanning tools and utilities
67
star
9

NetworkMapper

Android frontend for Nmap Security Scanner
Java
67
star
10

Croatian-US-mac

Croatian US keyboard for Mac OS X
35
star
11

fujprog

FPGA ULX2/3 JTAG programmer
C
34
star
12

nmap-nse

NMAP NSE scripts - (not all)) my contributions before merging to nmap svn
Lua
34
star
13

rdpcmd

script/execute commands over RDP connection (elevated cmd.exe)
AutoIt
34
star
14

vulnscan-pwcrack

Password guessers for popular vulnerability scanners and frameworks: Find the password for your favourite vulnscanners: OpenVAS, Nessus, NeXpose or Metasploit
Perl
28
star
15

nanomet

Nano meterpreter shell based on TinyMet
C
27
star
16

docker-moloch

A Docker container for Moloch based on minimal Debian
Shell
26
star
17

dcled

Dream Cheeky USB Message Board
C
26
star
18

httpexec

RESTful interface to your operating system shell
Go
18
star
19

logdns

Simple DNS logging server
Go
16
star
20

scexec

Portable utility to execute in memory a sequence of opcodes
C
16
star
21

docker-security

Security oriented images for Docker
Shell
15
star
22

sqlc

sqlc - Universal DBMS/SQL client with exfiltration features :)
Go
15
star
23

webrepl-python

Handle micropython web_repl in Python
Python
14
star
24

lantronix-witchcraft

Perl utilities to retrieve and/or set basic and enhanced telnet passwords (amongst others)
Perl
14
star
25

jtr-stuff

John The Ripper (JtR) - various stuff
13
star
26

slirp

Software program that emulates a PPP, SLIP, or CSLIP connection to the Internet via a shell account
C
12
star
27

webshell-portlet

Web shell as Portlet (useful for Websphere Portal, JBoss Portal, etc.)
Java
12
star
28

ulx3s-ghdl-examples

ulx3s ghdl examples
VHDL
12
star
29

docker-sift

Docker container of SANS Investigative Forensic Toolkit (SIFT) Workstation Version 3
Shell
11
star
30

Croatian-US-windows

CroUS keyboard for Windows
11
star
31

rdpcmd-ruby

Run commands over RDP on massive number of hosts
Ruby
11
star
32

libwmiclient

WMI client library - useful for monitoring/commanding Windows from other OSes
C
11
star
33

nmapxml

Convert nmap xml files to various formats: list of URLS, freemind mindmap, html (without XSL), etc..
Perl
9
star
34

tc-guesser

TrueCrypt password guesser/cracker
Perl
9
star
35

Croatian-US-linux

Croatian US keyboard for Linux
9
star
36

docker-cowrie

A Docker container for Cowrie - SSH honeypot based on kippo
Shell
9
star
37

singlepython

Building Python interpreter as Single Fat Binary
Makefile
8
star
38

smtp2mqtt

Simple SMTP to MQTT relay/forwarder
Go
8
star
39

massws

Mass Web Screenshot Tool - command line based
C++
8
star
40

memdump

System Memory dump
C
8
star
41

docker-zcash

Zcash inside docker container
8
star
42

wall-of-sheep

Wall of Sheep/Shame implemented in Perl with different modes: HTML, CGI and standalone web server
Perl
8
star
43

keepassz

Keepassz is improved Keepassx 0.x/1.x
C++
8
star
44

nessus_rest-ruby

Communicate with Nessus Scanner (version 6+) over REST/JSON interface
Ruby
7
star
45

external-ip

Android application to display IP addresses of device for easy copy&paste
Java
6
star
46

drcrack

drcrack - Matt Weir version - my patches
C++
5
star
47

micropython-socks

MicroPython library implementing SOCKS server.
Python
5
star
48

go-MemoryModule

Go binding example for MemoryModule
C
5
star
49

walletexplorer

Wallet Explorer for wallets of different cryptocurrencies (bitcoin, litecoin, ...)
Ruby
5
star
50

docker-nmap

A Docker container for Nmap
5
star
51

homebrew-ulx3s

Homebrew repo of ULX3S open source toolchain
Ruby
5
star
52

nessus-xmlrpc-ruby

Ruby gem/library for Nessus XMLRPC interface and Nessus command line example
Ruby
4
star
53

js-zynpass

ZyNOS Password/Secret generator - Node npm module
JavaScript
4
star
54

http-padawan

Basic (perl) tools for playing with HTTP protocol: basic HTTP server, proxy, etc.
Perl
4
star
55

dnstun

DNS tunnel library in Go
Go
4
star
56

SensorsWebLogger

Android application - Sensors Web Logger
Java
4
star
57

docker-kf

Docker containter for handling known files (goodware, badware) - usually by use of hashes
Shell
4
star
58

offrep

Offensive Reporting
Ruby
4
star
59

crotax-utils

Few utils for Croatian Tax payers
Ruby
4
star
60

ansible-galaxy.ubuntu.virtualbox

Ansible Galaxy role for installing VirtualBox on Ubuntu
4
star
61

owasp-favicon-crawl

OWASP favicon crawl scripts
Perl
4
star
62

docker-av

Anti-virus images for Docker
3
star
63

gosc

Go Shellcode
Go
3
star
64

rapid7-nexpose-api-perl

CPAN module - Rapid7::NeXpose::API - perl library for communication with NeXpose via API
Perl
3
star
65

DroidMeter

Android Application for multi meter - UNI-T UT61C
Java
3
star
66

http-get-methods

Enumeration of HTTP methods
Perl
3
star
67

regeorgo

Implementation of regeorg tunnel in golang (victim side).
Go
3
star
68

nessus-xmlrpc-perl

CPAN Module Net::Nessus::XMLRPC - perl library for communication with Nessus scanner(v4.2+) via XMLRPC
Perl
3
star
69

babushkafs

Pluggable filesystem containers
Perl
3
star
70

openvas-omp-ruby

This Ruby gem is used for communication with OpenVAS manager over OMP. You can start, stop, pause and resume scan. Watch progress and status of scan, download report, etc.
Ruby
3
star
71

pcap-utils

Basic tools for analyzing pcap traffic
Perl
3
star
72

openwrt-usb-modeswitch

OpenWRT packages for switching USB devices
Shell
2
star
73

metasploit-openvas-bridge

OpenVAS bridge for Metasploit
Ruby
2
star
74

dotfiles

General, public and basic dotfiles
Python
2
star
75

m-whitelist

Whitelist 1.0 for Redline mirror
2
star
76

fuzzy_time_hr

Croatian fuzzy time Pebble Watchface
C
2
star
77

ulx3s-passthru

Automated Passthru builds for ulx3s
Shell
2
star
78

libsimplebloom

Small bloom filter implementation in plain C with utils
C
2
star
79

bt-customise

BackTrack customizing/remastering scripts
2
star
80

ulx3s-next186

Automated Next186 builds for ulx3s
Shell
2
star
81

libk8055-perl

CPAN Module Device::Velleman::K8055::libk8055
C
2
star
82

httpexecute

Go library for HTTP execute system commands handler
Go
1
star
83

SPSpyGhost

Open source SP Spy Ghost Controller
Java
1
star
84

tcom-hr-dsl

T-Com DSL utilities
Perl
1
star
85

kost.github.com

Homepage
JavaScript
1
star
86

TextWatch-hr

Croatian Pebble TextWatch Watchface
C
1
star
87

witi

C
1
star
88

remmina-ruby

Ruby support classes for Remmina
Ruby
1
star
89

neohub-python

Python module to control Neohub supported thermostats
Python
1
star
90

ulx3s-oberon

Automated build for ulx3s-oberon from https://github.com/emard/oberon
Shell
1
star
91

SpitEvents

Useful scripts to parse various events/logs including Windows Events
Perl
1
star
92

nanoweblog

logs every web/http request
C
1
star
93

ansible-galaxy.ubuntu.chef

Ansible Galaxy role for installing Chef on Ubuntu
1
star
94

ansible-galaxy.ubuntu.docker

Ansible Galaxy role for installing Docker on Ubuntu
1
star
95

language-nse

NSE/Lua language support in Atom https://atom.io/packages/language-nse
CoffeeScript
1
star
96

gpp-decrypt-ruby

Group Policy Preferences (GPP) password decryption
Ruby
1
star