sliver icon indicating copy to clipboard operation
sliver copied to clipboard

implant does not uses socks5 proxy

Open cristal-node opened this issue 2 years ago • 4 comments

Describe the bug generated implant does not uses proxy from "ALL_PROXY" environment variable in linux.

To Reproduce

  1. generate command: generate -o linux -m 192.168.0.2 -d
  2. run the implant ALL_PROXY=socks5h://127.0.0.1:8080 ./implant

Expected behavior implant connects with socks5 server.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: linux(amd64)
  • Version: v1.5.41 - f2a3915c79b31ab31c0c2f0428bbd53d9e93c54b

Additional context

  • generated with http: only reads proxy from "HTTPS_PROXY", while "ALL_PROXY" and "HTTP_PROXY" still does not work. if I use "HTTPS_PROXY=socks5h://127.0.0.1:8080", it still treats the proxy as a http proxy. implant log:
    gohttp.go:84: Found proxy &proxy.proxy{protocol:"socks5h", host:"127.0.0.1", port:0x1f90, user:(*url.Userinfo)(nil), src:"Environment[HTTPS_PROXY]"}
    gohttp.go:91: Proxy URL = 'socks5h://127.0.0.1:8080'
    
    netcat log:
    CONNECT 192.168.0.2:443 HTTP/1.1
    Host: 192.168.0.2:443
    User-Agent: Go-http-client/1.1
    
  • generated with mtls: does not use "ALL_PROXY", "HTTPS_PROXY" or "HTTP_PROXY"

I am trying to use the implant with tor hidden service. so I need to use "socks5h" proxy.

cristal-node avatar Jul 30 '23 18:07 cristal-node

Only HTTP/S proxies are supported by the implant currently.

moloch-- avatar Jul 30 '23 19:07 moloch--

thanks for clearing this up. I'll try using http proxy. but still humbly request for socks5 proxies 😅

cristal-node avatar Jul 30 '23 22:07 cristal-node

I still wonder why only "HTTPS_PROXY" works. wiki says,

Environment Variable: HTTPS_PROXY, HTTP_PROXY, FTP_PROXY, or ALL_PROXY. NO_PROXY is respected.

cristal-node avatar Jul 30 '23 22:07 cristal-node

Oh that's probably a bug.

moloch-- avatar Jul 30 '23 23:07 moloch--