Created
December 23, 2023 11:47
-
-
Save socrateslee/63c0d86effcca91b0fcb300375129d5a to your computer and use it in GitHub Desktop.
Use proxychains in wsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# wsl's host ip address may change every time it reboots, | |
# this is a problem if you map your host address as proxy. | |
# Use the script to generate a new config of proxychains | |
# each time proxychains runs. | |
# put an entry | |
# http wsl-host 3128 | |
# in your /etc/proxychains.conf | |
# Copy the script as ./local/bin/wsl-proxychains.sh | |
# run your program with proxychains like | |
# wsl-proxychains.sh <YOUR PROGRAM> | |
gateway=`ip route|grep default|grep eth0|cut -d' ' -f 3` | |
sed "s/wsl-host/${gateway}/g" /etc/proxychains4.conf > /tmp/proxychains.conf | |
proxychains -f /tmp/proxychains.conf $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment