Skip to content

Instantly share code, notes, and snippets.

@royharoush
Last active February 8, 2023 03:32
Show Gist options
  • Save royharoush/a5379092d1ff301087a30562a4f54348 to your computer and use it in GitHub Desktop.
Save royharoush/a5379092d1ff301087a30562a4f54348 to your computer and use it in GitHub Desktop.
Silly little bash functions to easily set and unset various options for proxy (usually burp), useful for running various cli tools via burp, or anything really
#put me in your bashrc file and source me 8-)
#If running on linux, this is probably the easiast way to set your cli to go through proxy\burp
function proxy-on-burp-8080(){
export http_proxy=http://127.0.01:8080
export https_proxy=http://127.0.0.1:8080
export HTTP_PROXY=http://127.0.0.1:8080
export HTTPS_PROXY=http://127.0.0.1:8080
printf "All of the apps started from this terminal will now use burp"
}
#provide the ip of your choice as proxy(change port if needed), and copy paste the outout to change your proxy
function proxy-on-burp-8080-with-your-ip(){
printf "export http_proxy=http://$1:8080\n"
printf "export https_proxy=http://$1:8080\n"
printf "export HTTP_PROXY=http://$1:8080\n"
printf "export HTTPS_PROXY=http://$1:8080\n"
printf "Copy paste the the above lines to change your terminals proxy"
}
function proxy-on-ip-port(){
printf "export http_proxy=http://$1:$2\n"
printf "export https_proxy=http://$1:$2\n"
printf "export HTTP_PROXY=http://$1:$2\n"
printf "export HTTPS_PROXY=http://$1:$2\n"
printf "Copy paste the the above lines to change your terminals proxy"
}
#if you're running inside wsl, this will auto grab your windows ip and set it as proxy (you need to cmake sure your proxy accepts connections on all interfaces, and also, mind the port )
function proxy-on-windows-burp(){
export proxy=`route -n | grep ^0.0.0 | awk '{print $2}'`
printf "gonna set your proxy to $proxy, which is likely the windows host of your wsl \n"
export http_proxy=http://$proxy:8080
export https_proxy=http://$proxy:8080
export HTTP_PROXY=http://$proxy:8080
export HTTPS_PROXY=http://$proxy:8080
printf "All of the apps started from this terminal will now use burp"
}
#unsets all proxies you might have set, you can just open a new terminal as well.
function proxy-unset(){
unset http_proxy
unset https_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
printf "Burp is turned off from applications executed from this terminal"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment