Skip to content

Instantly share code, notes, and snippets.

@wonderbeyond
Last active June 10, 2023 10:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wonderbeyond/6ef3cdc191490e02a6b12162deab4fd7 to your computer and use it in GitHub Desktop.
Save wonderbeyond/6ef3cdc191490e02a6b12162deab4fd7 to your computer and use it in GitHub Desktop.
viaproxy "socks5 127.0.0.1 1080" telnet some-host
#!/bin/bash
# Author: wonderbeyond@gmail.com
# Usage: viaproxy "socks5 127.0.0.1 1080" telnet some-host
command -v proxychains4 > /dev/null && PROXYCHAINS="proxychains4 -q" || PROXYCHAINS=proxychains
proxy="$1"
shift
temp_conf_file=$(mktemp /tmp/viaproxy-proxchains-conf-XXXX)
trap "rm $temp_conf_file" EXIT
/bin/echo -e "strict_chain\nproxy_dns\nlocalnet 127.0.0.0/255.0.0.0\n[ProxyList]\n$proxy" > $temp_conf_file
$PROXYCHAINS -f "$temp_conf_file" "$@"
@hunterhug
Copy link

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment