Skip to content

Instantly share code, notes, and snippets.

@prinsharma1999
Forked from jivoi/proxying-cli-tools.sh
Created April 9, 2021 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prinsharma1999/ba1da2c833eed6251d03088c99c2d762 to your computer and use it in GitHub Desktop.
Save prinsharma1999/ba1da2c833eed6251d03088c99c2d762 to your computer and use it in GitHub Desktop.
proxying-cli-tools
#######################
### Proxy curl/wget ###
#######################
export http_proxy=localhost:8080
export https_proxy=localhost:8080
curl -k https://ifconfig.io
wget --no-check-certificates https://ifconfig.io
#######################
### Proxy Java JARs ###
#######################
# Find JAVA_HOME
java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home'
# Import Burp CA - default PW: changeit
$JAVA_HOME/bin/keytool -import -alias burpsuite -keystore $JAVA_HOME/lib/security/cacerts -file $HOME/certs/burpca.crt -trustcacerts
# Proxy Java
java -Dhttp.nonProxyHosts= -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8080 -jar <yourjar>.jar
#############################
### Proxy Python Requests ###
#############################
# Ensure you run the right Python interpreter
# Find CA Bundle with certifi:
python -c "import certifi; print(certifi.where())"
# Add Burp CA PEM to end of file
cat ~/certs/burpca.pem >> <pythonhome>/libexec/lib/python3.7/site-packages/certifi/cacert.pem
##################################
### Proxy Node JS/NPM Packages ###
##################################
# Download global-agent
mkdir nodeproxy && cd nodeproxy
npm install global-agent
# Export env variables and inject dependency
export NODE_EXTRA_CA_CERTS=$HOME/certs/burpca.crt
export GLOBAL_AGENT_HTTP_PROXY=http://127.0.0.1:8080
node -r 'global-agent/bootstrap' <path_to_module>
#########################
### Proxy Go Binaries ###
#########################
# Install Burp CA into your OS trused certificates
# Export environemnt variable and run
https_proxy=127.0.0.1:8080 <gobinary>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment