ligolo-ng icon indicating copy to clipboard operation
ligolo-ng copied to clipboard

Feature request: add interfaces and proxy routes directly from ligolo.

Open LucasParsy opened this issue 1 year ago • 3 comments

Hi! Just discovered Ligolo, it's an excellent tool! the tool is so useful I only have one feature i'd like:

automatically create tunnels and routing from the tool.

feature description:

let's imagine I have an agent with this interface:

| Interface 6                          |
│ Name         │ tun0                  │
│ IPv4 Address │ 192.168.45.176/24     │

if i'd run the new command

tunnel_start_if 
    ? Specify an interface : 6

it would do under the hood:

sudo ip tuntap add user kali mode tun ligolo192_168_45_0
sudo ip link set ligolo192_168_45_0 up
sudo ip route add 192.168.45.0/24 dev ligolo192_168_45_0
tunnel_start --tun ligolo192_168_45_0

caveats

I don't know how complex it would be to create this feature and integrate it to the tool. It would require Sudo elevation of privilege from with ligolo to set interfaces (run elevated sub-process?)

I don't have knowledge in Go (yet!) and I'm pretty busy these next months, otherwise I would have tried for a pull request. And I think it's more polite to ask feedback for a new feature to the app's creator ;)

By the way, I'm curious, where does the name "ligolo" comes from?

LucasParsy avatar Feb 21 '24 17:02 LucasParsy

adding additional info as I am interested in developing this feature and would request your feedback before coding:

  • On developing the feature, there would be 2 philosophies:

    • using the netlink and water Go libraries
    • using the linux ip binary directly via exec command

    In my opinion, using exec may seem too simple and bad practice, but in the end it is just a matter of trusting a project and using it correctly, and I'm more confident doing so with ip than with the 2 libraries.

  • I know how to create interfaces/tunnels on Linux, as you documented it, but not in Windows. Is it possible to create from the command line/ libraries in Windows, or would you accept this feature as Linux only, at least initially?

LucasParsy avatar Feb 26 '24 10:02 LucasParsy

Good idea. For Windows, the tun interface is automatically created, but not for Linux.

I will implement this functionality soon.

nicocha30 avatar Mar 08 '24 11:03 nicocha30

Thanks a lot! (Great talk also 👍) Note that in the example I gave initially, the new tunnel name I gave is apparently not a valid name.

LucasParsy avatar Mar 08 '24 11:03 LucasParsy

This would be great to fully automate the proxying instead of having to type in manually 3 commands each time :)

arty-hlr avatar May 21 '24 11:05 arty-hlr

Implemented in Ligolo-ng v0.6!

nicocha30 avatar Jun 22 '24 19:06 nicocha30