gobuster icon indicating copy to clipboard operation
gobuster copied to clipboard

Add SOCKS proxy support

Open OJ opened this issue 6 years ago • 13 comments

At the moment we support HTTP/S proxies, but we don't support SOCKS from what I can tell. I have tried making use of the environment variables but this doesn't work.

So we need to bake this in.

OJ avatar Mar 29 '19 06:03 OJ

@OJ this should already be possible https://go-review.googlesource.com/c/go/+/35488/

Have you tried socks5://host:port as a proxy url?

HTTP_PROXY="socks5://127.0.0.1:1080/" ./gobuster

firefart avatar Mar 29 '19 07:03 firefart

Didn't work with my socks4 proxy.

OJ avatar Mar 29 '19 07:03 OJ

Jeah the source code change only adds socks5:// support. So is it worth to implement socks4 support manually?

firefart avatar Mar 29 '19 07:03 firefart

Looks like the main problem here is https://godoc.org/golang.org/x/net/proxy not supporting SOCKS4 at all which sucks :/

firefart avatar Mar 29 '19 07:03 firefart

Yeah exactly. Maybe I just need to skip that idea then.

Seems stupid.

OJ avatar Mar 29 '19 08:03 OJ

sock5 is important

jjhesk avatar Aug 24 '19 09:08 jjhesk

Hi guys! Gobuster has done wonders for me so I thought it was time to give back to help you guys if I could!

As I type this, I'm successfully running Gobuster over socks5 with zero problems within my PWK/OSCP labs!

  1. I installed/configured Ligolo (HIGHLY recommend) on my Kali (attack machine) machine https://github.com/sysdream/ligolo
  2. Dropped the Ligolo binary on a compromised Windows machine (victim machine)
  3. Started up listener on the attack machine
  4. Ran the connection binary on the victim machine to receive a connection on attack machine
  5. Per Ligolo instructions, added socks5 127.0.0.1 1080 to /etc/proxychains.conf
  6. Ran the following Gobuster call: gobuster dir -p socks5://127.0.0.1:1080 -u http://<IP> -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt

and it's running as fast as it would be directly connecting to a server (much faster than wfuzz ;) )

I'll also attempt socks4 as soon as I can in the lab to see if I can replicate the same results!

leejamison avatar Jun 20 '20 19:06 leejamison

'--proxy socks5://host:port' work just fine. Seems like https://godoc.org/golang.org/x/net/proxy now supports socks5.

Pernat1y avatar Jun 27 '20 12:06 Pernat1y

5. Per Ligolo instructions, added **socks5 127.0.0.1 1080** to /etc/proxychains.conf
6. Ran the following Gobuster call: **gobuster dir -p socks5://127.0.0.1:1080 -u http:// -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt**

You doing it wrong. You just running 'gobuster' as usual. To get use of proxychains, you should start it like this: 'proxychains gobuster [your_args]'. Your example works just because gobuster now have built-in socks5 support.

Pernat1y avatar Jun 27 '20 12:06 Pernat1y

Confirmed socks4 does not function as of Gobuster 3.0.1 (told you I'd get around to socks4 testing eventually! )

  1. Configure SSH Dynamic Port Forwarding ssh -N -D 127.0.0.1:8081 user@host

  2. set /etc/proxychains.conf to socks4 127.0.0.1 8081

  3. Using gobuster dir -p socks4://127.0.0.1:8081 -u http://host -w <wordlist> resulted in Error: error on running gobuster: unable to connect to http://host/: Get "http://host/": EOF

  4. Using proxychains gobuster dir -u http://host -w <wordlist> resulted in Error: error on running gobuster: unable to connect to http://host/: Get "http://host /": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

Hope this helps! It would be great to see this implemented!

leejamison avatar Jul 03 '20 20:07 leejamison

See https://godoc.org/golang.org/x/net/proxy socks5:// works just fine

Pernat1y avatar Jul 09 '20 18:07 Pernat1y

Hey, I try to run this command "gobuster dir -p socks5://127.0.0.1:1080 -u http://10.20.115.31/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt" but i get " Error: error on parsing arguments: pattern file "socks5://127.0.0.1:1080" does not exist: stat socks5://127.0.0.1:1080: no such file or directory"

0xIapetus avatar Jun 26 '22 11:06 0xIapetus

Hey, I try to run this command "gobuster dir -p socks5://127.0.0.1:1080 -u http://10.20.115.31/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt" but i get " Error: error on parsing arguments: pattern file "socks5://127.0.0.1:1080" does not exist: stat socks5://127.0.0.1:1080: no such file or directory"

use —proxy

firefart avatar Jun 26 '22 12:06 firefart

gobuster -q dir --proxy socks5://127.0.0.1:1080 -u http://127.0.0.1:80 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt works for me

cybertuxh4xor avatar Mar 02 '23 12:03 cybertuxh4xor

still no socks4 support so closing this

firefart avatar Nov 19 '23 16:11 firefart