Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Port frowarding not working #120

Open
PeanTaster opened this issue Dec 8, 2024 · 2 comments
Open

[BUG] Port frowarding not working #120

PeanTaster opened this issue Dec 8, 2024 · 2 comments

Comments

@PeanTaster
Copy link

PeanTaster commented Dec 8, 2024

Describe the bug
If we try to forward the port and access the web server that is on C2, we get a decode error.

To Reproduce
Steps to reproduce the behavior:

1.1.1.1 - C2 host
9.9.9.9 - Compromised host

  1. Start proxy

./proxy -selfcert -selfcert-domain tunnels

  1. Start web server on port 8000

goshs

  1. Start agent

./agent.exe -connect 1.1.1.1:11601 -ignore-cert

  1. Set up listener on pivot host

listener_add --addr 9.9.9.9:8000 --to 1.1.1.1:8000
or
listener_add --addr 0.0.0.0:8000 --to 127.0.0.1:8000

  1. Try connecting to the web server through a browser or something else
firefox 9.9.9.9:8000
  1. See error
[Agent : dom\user@test] » listener_add --addr 9.9.9.9:8000 --to 1.1.1.1:8000
INFO[0872] Listener 0 created on remote agent!
[Agent : dom\user@test] » ERRO[0891] Listener relay failed with error: decode called for unknown payload type: 69  agent="dom\\user@test" listener="[#0] (tcp) [Agent] 9.9.9.9:8000 => [
Proxy] 1.1.1.1:8000"
[Agent : dom\user@test] »

Expected behavior
Can get access to web server without problems

Proxy information:

  • OS: Linux kali 6.8.11-amd64
  • Architecture amd64
  • Version Ligolo-ng 0.7.2-alpha

Agent information:

  • OS: Linux kali 6.8.11-amd64, Windows 10
  • Architecture amd64
  • Version Ligolo-ng 0.7.2-alpha
@PeanTaster PeanTaster changed the title [BUG] Proxy not working [BUG] Port frowarding not working Dec 9, 2024
@nicocha30
Copy link
Owner

Can you run with verbosity enabled both on agent and proxy? (-v option)

@n2ryx
Copy link

n2ryx commented Dec 12, 2024

Can you run with verbosity enabled both on agent and proxy? (-v option)

Version:0.7.3
Proxy:
[Agent : root@dmz01] » listener_add --addr 0.0.0.0:2222 --to 127.0.0.1:2222 --tcp
INFO[0126]/home/runner/work/ligolo-ng/ligolo-ng/cmd/proxy/app/app.go:520 github.com/nicocha30/ligolo-ng/cmd/proxy/app.Run.func14() Listener 0 created on remote agent!
[Agent : root@dmz01] » DEBU[0130]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/netstack/handlers.go:92 github.com/nicocha30/ligolo-ng/pkg/proxy/netstack.HandlePacket() Got packet source : 172.16.2.128 - endpointID : 172.16.8.120:2222
DEBU[0130]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/netstack/handlers.go:127 github.com/nicocha30/ligolo-ng/pkg/proxy/netstack.HandlePacket() Awaiting response...
DEBU[0130]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/netstack/handlers.go:92 github.com/nicocha30/ligolo-ng/pkg/proxy/netstack.HandlePacket() Got packet source : 172.16.2.128 - endpointID : 172.16.8.120:2222
DEBU[0130]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/netstack/handlers.go:127 github.com/nicocha30/ligolo-ng/pkg/proxy/netstack.HandlePacket() Awaiting response...
DEBU[0131]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/listeners.go:135 github.com/nicocha30/ligolo-ng/pkg/proxy.(*LigoloListener).relayTCP() New socket opened : 1
DEBU[0131]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/netstack/handlers.go:137 github.com/nicocha30/ligolo-ng/pkg/proxy/netstack.HandlePacket() Connection established on remote end!
DEBU[0131]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/netstack/handlers.go:137 github.com/nicocha30/ligolo-ng/pkg/proxy/netstack.HandlePacket() Connection established on remote end!
ERRO[0131]/home/runner/work/ligolo-ng/ligolo-ng/cmd/proxy/app/app.go:525 github.com/nicocha30/ligolo-ng/cmd/proxy/app.Run.func14.1() Listener relay failed with error: msgpack: invalid code=a9 decoding uint64 agent=root@dmz01 id=c5488a14-5189-4525-b702-9a119428d353 listener="[#0] (tcp) [Agent] 0.0.0.0:2222 => [Proxy] 127.0.0.1:2222"
DEBU[0131]/home/runner/work/ligolo-ng/ligolo-ng/pkg/proxy/listeners.go:164 github.com/nicocha30/ligolo-ng/pkg/proxy.(*LigoloListener).relayTCP.func1() Listener relay established!

Agent:
DEBU[0076]/home/runner/work/ligolo-ng/ligolo-ng/pkg/agent/handler.go:100 github.com/nicocha30/ligolo-ng/pkg/agent.HandleConn() Got connect request to 172.16.8.120:2222
DEBU[0077]/home/runner/work/ligolo-ng/ligolo-ng/pkg/agent/handler.go:100 github.com/nicocha30/ligolo-ng/pkg/agent.HandleConn() Got connect request to 172.16.8.120:2222
DEBU[0105]/home/runner/work/ligolo-ng/ligolo-ng/pkg/agent/handler.go:100 github.com/nicocha30/ligolo-ng/pkg/agent.HandleConn() Got connect request to 172.16.8.120:2222
DEBU[0105]/home/runner/work/ligolo-ng/ligolo-ng/pkg/agent/handler.go:100 github.com/nicocha30/ligolo-ng/pkg/agent.HandleConn() Got connect request to 172.16.8.120:2222

v0.6.2 is work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants