Created
May 15, 2018 03:51
Revisions
-
infosec-intern created this gist
May 15, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ SERVER=100.100.100.100 USER=username PROXY="$USER@$SERVER" function setProxy() { export http_proxy=http://127.0.0.1:8888/ export https_proxy=$http_proxy export ftp_proxy=$http_proxy export rsync_proxy=$http_proxy export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" export HTTP_PROXY=$http_proxy export HTTPS_PROXY=$https_proxy export FTP_PROXY=$ftp_proxy export RSYNC_PROXY=$rsync_proxy export NO_PROXY=$no_proxy echo "[*] Proxy vars set" echo "[*] ssh -D 8888 -i ~/.ssh/proxy -C -f -N -q $PROXY" ssh -D 8888 -i ~/.ssh/proxy -C -f -N -q $PROXY } function unsetProxy() { unset http_proxy unset https_proxy unset ftp_proxy unset rsync_proxy unset no_proxy unset HTTP_PROXY unset HTTPS_PROXY unset FTP_PROXY unset RSYNC_PROXY unset NO_PROXY echo "[*] Proxy vars unset" echo '[*] kill -9 `pgrep "ssh" -a -U 1000 | grep $PROXY | cut -d\s -f1`' kill -9 `pgrep "ssh" -a -U 1000 | grep $PROXY | cut -d\s -f1` } setProxy