Skip to content

Instantly share code, notes, and snippets.

@woswos
woswos / tor-browser-selenium-wire.py
Last active February 22, 2023 07:32
This script creates a proxy server between the Tor Browser and Tor to capture requests/responses, using the seleniumwire library. You can access and modify the HTTP headers that are being sent/received, including the onion services. Note: You need to have Tor installed and running on the localhost while running this script.
import os
from seleniumwire import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
# Uncomment these if you need additional information for debugging
#import logging
#logging.basicConfig(level=logging.DEBUG)
# The location of the Tor Browser bundle