Skip to content

Commit 620d528

Browse files
committed
add reverse portfwd function
1 parent df012ce commit 620d528

File tree

6 files changed

+239
-171
lines changed

6 files changed

+239
-171
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ CLIENT_BINARY=ligoloc
99
SERVER_BINARY=ligolos
1010
TAGS=release
1111

12-
OSARCH = "linux/amd64 linux/386 windows/amd64 windows/386 darwin/amd64 darwin/386"
12+
OSARCH = "linux/amd64 linux/386 windows/amd64 windows/386 darwin/amd64"
1313

1414
TLS_HOST ?= 'ligolo.lan'
1515

README.md

Lines changed: 70 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,138 @@
1-
# Ligolo: Reverse tunnel for intranet penetration
1+
# Ligolo : 用于内网渗透的反向隧道
22

33
[![forthebadge](https://forthebadge.com/images/badges/made-with-go.svg)](https://forthebadge.com)
44
[![forthebadge](https://forthebadge.com/images/badges/gluten-free.svg)](https://forthebadge.com)
55

6-
English | [简体中文](./README_ZH.md)
6+
简体中文 | [English](./README_EN.md)
77

8-
## introduce
8+
## 介绍
99

10-
The project is modified according to [ligolo](https://github.com/sysdream/ligolo), mainly for some functional tailoring, which is convenient to use.
10+
项目根据 [ligolo](https://github.com/sysdream/ligolo) 修改,主要做一些功能上的裁剪,方便使用.
1111

12-
**Ligolo** is a simple, lightweight reverse Socks5 proxy tool, all traffic is encrypted with TLS.
12+
**Ligolo** 是一个简单的,轻量级的反向Socks5代理工具及端口映射工具,所有的流量使用TLS加密.
1313

14-
Its function is similar to *Autoroute + Socks4a* in *Meterpreter*, but it is more stable and faster.
14+
其功能类似于*Meterpreter*中的*Autoroute + Socks4a*,但是更加稳定,速度更快.
1515

16-
## why you need this
16+
## 使用场景
1717

18-
When you have obtained the permission of a Windows / Linux / Mac host on the other party's intranet and the host can connect to the Internet.
18+
当你已经在对方内网获取到一台 Windows / Linux / Mac 主机的权限且该主机可以连接互联网.
1919

20-
At this point you want to establish a Socks5 proxy for the other party's intranet.
20+
此时你想要建立一个对方内网的Socks5代理或需要连接内网某个IP地址的某端口.
2121

22-
**Ligolo** can help you establish an agent to help you continue to penetrate the intranet.
22+
**Ligolo** 可以帮助你建立代理,协助你继续进行内网渗透.
2323

24-
> If the controlled host cannot access the Internet, you can try another tool [pystinger](https://github.com/FunnyWolf/pystinger)
24+
> 如果已控主机不能访问互联网,可以尝试使用另一款工具 [pystinger](https://github.com/FunnyWolf/pystinger)
2525
26-
## Instructions
26+
## 使用方法
2727

28-
### TL;DR
28+
### Sock5代理
2929

30-
- Get the compiled binary file [release](https://github.com/FunnyWolf/ligolo/releases)
30+
- 获取已编译的二进制文件 [release](https://github.com/FunnyWolf/ligolo/releases)
3131

32-
- In your VPS hosting.
32+
- 在你的VPS主机中.
3333

3434
```
3535
./ligolos
3636
```
3737

38-
- In the controlled intranet host.
38+
- 在已控制的内网主机中.
3939

4040
```
4141
> ligoloc.exe -s your-vps-ip:443
4242
```
4343

44-
- After the connection is successfully established, the 127.0.0.1:1080 of the VPS has established the Socks5 proxy for the internal network of the controlled host.
44+
- 连接建立成功后,此时VPS的127.0.0.1:1080已经建立已控主机的内网Socks5代理.
4545

46-
### Detailed description
46+
### 详细说明
4747

48-
*Ligolo* contains two modules:
48+
*Ligolo* 包含两个模块:
4949

5050
- ligolos (server)
5151
- ligoloc (client)
5252

53-
*ligolos* runs on your VPS server (attack server).
53+
*ligolos* 运行于你的VPS服务器 (攻击服务器).
5454

55-
*ligoloc* runs on an already controlled intranet host.
55+
*ligoloc* 运行于已经控制的内网主机.
5656

57-
*ligolos* can use the default settings. It will listen on port 0.0.0.0:443 (for waiting for ligoloc connection) and 127.0.0.1:1080 (for socks5 proxy).
57+
*ligolos*可以使用默认设置.它会监听0.0.0.0:443端口(用于等待ligoloc连接)及127.0.0.1:1080(用于socks5代理).
5858

59-
*ligoloc* The server address must be specified when running, using the parameter `-s your-vps-ip:443`.
59+
*ligoloc*运行时必须制定服务端地址,使用参数`-s your-vps-ip:443`.
6060

61-
You can use the `-h` parameter to view the help.
61+
你可以使用`-h`参数查看帮助.
6262

63-
Once the connection between *ligolos* and *ligoloc* is established, you can use the intranet socks5 proxy of the VPS server `127.0.0.1:1080`.
63+
一旦*ligolos* *ligoloc* 之间的连接建立成功,你即可使用VPS服务器`127.0.0.1:1080`的内网socks5代理.
6464

65-
### Options
65+
66+
### 反向端口映射
67+
- 在你的VPS主机中.
68+
69+
```
70+
./ligolos -p 0.0.0.0:13389
71+
```
72+
73+
- 在已控制的内网主机中.
74+
75+
```
76+
> ligoloc.exe -s your-vps-ip:443 -t 127.0.0.1:3389
77+
```
78+
79+
- 连接建立成功后,已经将以控制内网主机的3389映射到VPS-IP:13389.
80+
81+
82+
83+
### 选项
6684

6785
*ligolos* options:
6886

6987
```
70-
PS XXX\bin> .\ligolos_windows_amd64.exe -h
71-
Usage of D:\Code\git\go\src\ligolo\bin\ligolos_windows_amd64.exe:
88+
PS D:\xxx\bin> .\ligolos.exe -h
89+
Usage of D:\xxx\ligolos.exe:
7290
-cert string
7391
The TLS server certificate,Unnecessary (default "cert.pem")
7492
-key string
7593
The TLS server key,Unnecessary (default "key.pem")
7694
-l string
7795
The relay server listening address (the connect-back address) (default "0.0.0.0:443")
78-
-s5 string
79-
The local socks5 server address (your proxychains parameter) (default "127.0.0.1:1080")
96+
-p string
97+
The local socks5 server address or ip:port use to connect target (default "127.0.0.1:1080")
8098
```
8199

82100
*ligoloc* options:
83101

84102
```
85-
PS XXX\bin> .\ligoloc_windows_amd64.exe -h
86-
Usage of D:\Code\git\go\src\ligolo\bin\ligoloc_windows_amd64.exe:
103+
Usage of D:\XXX\ligoloc.exe:
104+
-proxy string
105+
Use proxy to connect ligolo server(e.g. http://user:[email protected]:8080 socks5://user:[email protected]:1080)
87106
-s string
88-
The relay server (the connect-back address) (default "example.com:443")
107+
The ligolo server (the connect-back address)(e.g. 0.0.0.0:443)
108+
-t string
109+
The destination server (a 192.168.1.3:3389, 192.168.1.3:22, etc.) - when not specified, Ligolo starts a socks5 proxy server
89110
```
90111

91-
### Compile
112+
### 编译
92113

93-
Refer to the compilation method of the original ligolo
114+
参考原版ligolo的编译方法
94115

95-
## Features
116+
## 特性
96117

97-
- TLS 1.3 encrypted tunnel
98-
- Multi-platform (Windows / Linux / Mac /...)
99-
- Multiple connection multiplexing (1 TCP connection transmits all traffic)
100-
- SOCKS5 proxy
118+
- TLS 1.3 加密隧道
119+
- 多平台 (Windows / Linux / Mac / ...)
120+
- 多连接复用 (1 TCP连接传输所有流量)
121+
- SOCKS5代理
101122

102123
## To Do
103124

104-
- Better timeout mechanism
105-
- SOCKS5 UDP support
106-
- mTLS mutual authentication
107-
- Reverse port mapping (mapping intranet port to internet)
125+
- 更好的超时机制
126+
- SOCKS5 UDP 支持
127+
- mTLS双向认证
108128

109129
## Licensing
110130

111-
GNU General Public License v3.0 (refer to LICENSING).
131+
GNU General Public License v3.0 (参考 LICENSING).
132+
133+
## 原版作者
134+
135+
* Nicolas Chatelain <n.chatelain -at- sysdream.com>
136+
112137

113-
## Original author
114138

115-
* Nicolas Chatelain <n.chatelain -at- sysdream.com>

README_EN.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Ligolo: Reverse tunnel for intranet penetration
2+
3+
[![forthebadge](https://forthebadge.com/images/badges/made-with-go.svg)](https://forthebadge.com)
4+
[![forthebadge](https://forthebadge.com/images/badges/gluten-free.svg)](https://forthebadge.com)
5+
6+
English | [简体中文](./README.md)
7+
8+
## introduce
9+
10+
The project is modified according to [ligolo](https://github.com/sysdream/ligolo), mainly for some functional tailoring, which is convenient to use.
11+
12+
**Ligolo** is a simple, lightweight reverse Socks5 proxy tool, all traffic is encrypted with TLS.
13+
14+
Its function is similar to *Autoroute + Socks4a* in *Meterpreter*, but it is more stable and faster.
15+
16+
## why you need this
17+
18+
When you have obtained the permission of a Windows / Linux / Mac host on the other party's intranet and the host can connect to the Internet.
19+
20+
At this point you want to establish a Socks5 proxy for the other party's intranet.
21+
22+
**Ligolo** can help you establish an agent to help you continue to penetrate the intranet.
23+
24+
> If the controlled host cannot access the Internet, you can try another tool [pystinger](https://github.com/FunnyWolf/pystinger)
25+
26+
## Instructions
27+
28+
### TL;DR
29+
30+
- Get the compiled binary file [release](https://github.com/FunnyWolf/ligolo/releases)
31+
32+
- In your VPS hosting.
33+
34+
```
35+
./ligolos
36+
```
37+
38+
- In the controlled intranet host.
39+
40+
```
41+
> ligoloc.exe -s your-vps-ip:443
42+
```
43+
44+
- After the connection is successfully established, the 127.0.0.1:1080 of the VPS has established the Socks5 proxy for the internal network of the controlled host.
45+
46+
### Detailed description
47+
48+
*Ligolo* contains two modules:
49+
50+
- ligolos (server)
51+
- ligoloc (client)
52+
53+
*ligolos* runs on your VPS server (attack server).
54+
55+
*ligoloc* runs on an already controlled intranet host.
56+
57+
*ligolos* can use the default settings. It will listen on port 0.0.0.0:443 (for waiting for ligoloc connection) and 127.0.0.1:1080 (for socks5 proxy).
58+
59+
*ligoloc* The server address must be specified when running, using the parameter `-s your-vps-ip:443`.
60+
61+
You can use the `-h` parameter to view the help.
62+
63+
Once the connection between *ligolos* and *ligoloc* is established, you can use the intranet socks5 proxy of the VPS server `127.0.0.1:1080`.
64+
65+
66+
### Reverse portfwd
67+
- In your VPS host
68+
```
69+
./ligolos -p 0.0.0.0:13389
70+
```
71+
- In controlled intranet host
72+
```
73+
> ligoloc. exe -s your-vps-ip:443 -t 127.0.0.1:3389
74+
```
75+
- After the connection is established successfully, the intranet host 127.0.0.1:3389 has been mapped to vps-ip:13389
76+
77+
78+
### Options
79+
80+
*ligolos* options:
81+
82+
```
83+
PS D:\xxx\bin> .\ligolos.exe -h
84+
Usage of D:\xxx\ligolos.exe:
85+
-cert string
86+
The TLS server certificate,Unnecessary (default "cert.pem")
87+
-key string
88+
The TLS server key,Unnecessary (default "key.pem")
89+
-l string
90+
The relay server listening address (the connect-back address) (default "0.0.0.0:443")
91+
-p string
92+
The local socks5 server address or ip:port use to connect target (default "127.0.0.1:1080")
93+
```
94+
95+
*ligoloc* options:
96+
97+
```
98+
Usage of D:\XXX\ligoloc.exe:
99+
-proxy string
100+
Use proxy to connect ligolo server(e.g. http://user:[email protected]:8080 socks5://user:[email protected]:1080)
101+
-s string
102+
The ligolo server (the connect-back address)(e.g. 0.0.0.0:443)
103+
-t string
104+
The destination server (a 192.168.1.3:3389, 192.168.1.3:22, etc.) - when not specified, Ligolo starts a socks5 proxy server
105+
```
106+
107+
108+
### Compile
109+
110+
Refer to the compilation method of the original ligolo
111+
112+
## Features
113+
114+
- TLS 1.3 encrypted tunnel
115+
- Multi-platform (Windows / Linux / Mac /...)
116+
- Multiple connection multiplexing (1 TCP connection transmits all traffic)
117+
- SOCKS5 proxy
118+
119+
## To Do
120+
121+
- Better timeout mechanism
122+
- SOCKS5 UDP support
123+
- mTLS mutual authentication
124+
- Reverse port mapping (mapping intranet port to internet)
125+
126+
## Licensing
127+
128+
GNU General Public License v3.0 (refer to LICENSING).
129+
130+
## Original author
131+
132+
* Nicolas Chatelain <n.chatelain -at- sysdream.com>

0 commit comments

Comments
 (0)