jm33-m0 / emp3r0r

Linux/Windows post-exploitation framework made by linux user
https://infosec.exchange/@jm33
MIT License
1.25k stars 235 forks source link

Windows agent panic #210

Closed AdolfsGrandson closed 1 year ago

AdolfsGrandson commented 1 year ago

Windows agent crashes with "panic:" message. Agent OS: windows 10 CC OS: Blackarch

jm33-m0 commented 1 year ago

Can you provide the panic log?

jm33-m0 commented 1 year ago

Never mind, I tested it myself, without -verbose to slow down the goroutine it throws:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x40 pc=0x8b7297]

goroutine 22 [running]:
github.com/txthinking/socks5.(*Server).ListenAndServe(0x0, {0x0, 0x0})
        /home/booth/go/pkg/mod/github.com/txthinking/socks5@v0.0.0-20230325130024-4230056ae301/server.go:162 +0x57
github.com/jm33-m0/emp3r0r/core/lib/tun.StartSocks5Proxy({0x12424250, 0xd}, {0x12422320, 0x19}, 0x0)
        /home/booth/emp3r0r/core/lib/tun/proxy.go:30 +0x14d
github.com/jm33-m0/emp3r0r/core/lib/agent.Socks5Proxy.func1()
        /home/booth/emp3r0r/core/lib/agent/proxy.go:43 +0x5e
created by github.com/jm33-m0/emp3r0r/core/lib/agent.Socks5Proxy
        /home/booth/emp3r0r/core/lib/agent/proxy.go:42 +0x10e

https://github.com/jm33-m0/emp3r0r/blob/fb2d67843d5a6aadbbeb3aacd657d6e0f53062bb/core/cmd/agent/main_windows.go#L169

This goroutine started before

https://github.com/jm33-m0/emp3r0r/blob/fb2d67843d5a6aadbbeb3aacd657d6e0f53062bb/core/cmd/agent/main_windows.go#L73-L76

so it's unable to properly initialize https://github.com/jm33-m0/emp3r0r/blob/fb2d67843d5a6aadbbeb3aacd657d6e0f53062bb/core/lib/agent/proxy.go#L43

emp3r0r_data.ProxyServer is uninitialized when being used.