RedSiege / EyeWitness

EyeWitness is designed to take screenshots of websites, provide some server header info, and identify default credentials if possible.

Home Page:https://www.christophertruncer.com/eyewitness-usage-guide/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EyeWitness through SOCKS proxy v4 (Cobalt Strike)

Raikia opened this issue · comments

I figured I would leave this information here after my 30 minutes of debugging so someone else doesn't struggle. EyeWitness can be run through a SOCKS proxy v4 by using proxychains, but it requires a very specific setup otherwise everything will timeout.

Note: It looks like EyeWitness does actually support SOCKS v5 via "--proxy-type", but Cobalt Strike is v4 so that doesn't work.

Explanation and other issues:

  • In the latest versions of Kali, you cannot run EyeWitness as root (with sudo) otherwise you'll get a very vague error message of "Message: Unable to find a matching set of capabilities". If you read "geckodriver.log", you'll see the real error message of "Running Firefox as root in a regular user's session is not supported."

  • The EyeWitness directory must be user-writable because EyeWitness writes to that geckodriver.log file. So make sure you chmod the folder correctly.

  • If you run Kali's "proxychains" before "EyeWitness.py" (proxychains ./EyeWitness.py --single 'http://google.com' -d ~/output), you will see a ton of "|S-chain|-<>-SERVER:PORT-<><>-127.0.0.1:54665-<--denied". EyeWitness is trying to connect to the geckodriver that is listening on that port, but that request (127.0.0.1) is going through the SOCKS proxy instead of actually being a localhost request. Thus everything is denied and nothing works.

img

Instructions on how to make it work

  1. Make sure EyeWitness directory is user-writable:
chmod -R 777 /opt/eyewitness-git/
  1. Kali's proxychains does not allow you to exclude IPs from being passed through the SOCKS proxy (which is what is breaking EyeWitness). You need to use the latest support version of Proxychains-ng (the actively developed version of proxychains) that allows exclusions. Complete commands are below for github cloning and installing for your convenience for copy/paste:
git clone https://github.com/rofl0r/proxychains-ng ~/proxychains-ng
cd ~/proxychains-ng
make -s clean
./configure --prefix=/usr --sysconfdir=/etc
make -s
make -s install
ln -sf /usr/bin/proxychains4 /usr/local/bin/proxychains-ng
  1. Add the following line to your /etc/proxychains.conf file (I personally add it after "proxy_dns" but anywhere should work as long as its not at the very bottom under "[ProxyList]"):
localnet 127.0.0.0/255.0.0.0
  1. Add your proxychains server like normal to the bottom of /etc/proxychains.conf

  2. Run EyeWitness like normal by prefixing "proxychains-ng" (notice the "-ng" at the end)

proxychains-ng ./EyeWitness.py --single 'http://google.com' -d ~/output
  1. You should now see the NEW version of the "S-Chain" line where it no longer uses ASCII arrows, see below:

img

Done! You can now run EyeWitness through CobaltStrike as long as you prefix it with "proxychains-ng" instead of the old, crappy "proxychains"

Closing this since there is a Windows binary for this now, but thanks again for this issue as it shows solid documentation