sliverarmory / armory

The Official Sliver Armory
https://sliver.sh/
82 stars 11 forks source link

add chisel #35

Open MrAle98 opened 1 year ago

MrAle98 commented 1 year ago

Hello I report here another extension that you may find useful.

I decided to modify chisel project to a windows DLL that can be loaded as an extension of a sliver agent, and manage multiple socks/port forwarding operations. Here the link to the repository with modified version of chisel supporting loading as sliver extension: https://github.com/MrAle98/chisel

The project now has two additional commands:

I hope this extension to be useful when it is necessary to have a more powerful socks proxy without dropping anything to disk nor injecting in other processes.

It might be also considered as an example for showing how to introduce go tooling in C2s supporting the execution of DLLs in memory.

Build

Requires mingw-w64, it is already install on a kali linux instance.

With the following commands, chisel dlls are generated and is automatically created the extension chisel in sliver.

$ mkdir ~/.sliver-client/extensions/chisel
$ cp extension.json ~/.sliver-client/extensions/chisel
$ make windowsdll_64
$ make windowsdll_32

Run

Reverse socks proxy (server running on attacker box)

  1. Start chisel server on attacker box. image
  2. Start chisel client in sliver agent. image

Now on port 1080 on attacker box there is a socks proxy towards internal network.

Listing chisel tasks currently running. image

Stop chisel client in sliver agent. image

socks proxy (server running inside sliver agent)

  1. start sliver server in sliver agent. image
  2. start client on attacker box. image

Now on port 1081 on attacker box there is a socks proxy towards internal network.

Here output of netstat on attacker box. image

Testing

I tested only x64 version of the dll not x86. I just tested the extension on a x64 windows 10 pro build 10.0.19044.