1

I want to load html content through the Tor network and execute JavaScript that comes with the loaded content to load additional content through the Tor network via AJAX or similar techniques. But I can't use the Tor browser for this. This must be done automated by a script that runs on a Linux server without any human interaction. There is no GUI (graphical user interface) installed on the computer.

Is there a application that ...

  1. can use the Tor network to connect to the internet
  2. can execute JavaScript to load additional content via AJAX or similar techniques
  3. runs on a linux server that has no graphical user interface
  4. offers an API that can be controlled by a Perl script or any other

?

2

I found a way to do that on linux:

  • apt-get install tor
  • download Multi-TOR from here: https://github.com/jseidl/Multi-TOR
  • run ./multi-tor.sh 10 for 10 socks ports (for example)
  • You can use selenium or splinter python (for example) and import socks port
  • put the script on a while or for statement as u wish
  • good luck


from pyvirtualdisplay import Display
import stem.process
from stem import Signal
from stem.control import Controller
from splinter import Browser


proxyIP = "127.0.0.1"
proxyPort = 9051

proxy_settings = {"network.proxy.type":1,
    "network.proxy.ssl": proxyIP,
    "network.proxy.ssl_port": proxyPort,
    "network.proxy.socks": proxyIP,
    "network.proxy.socks_port": proxyPort,
    "network.proxy.socks_remote_dns": True,
    "network.proxy.ftp": proxyIP,
    "network.proxy.ftp_port": proxyPort
}

display = Display(visible=0, size=(800, 600))
display.start()

browser = Browser('firefox', profile_preferences=proxy_settings)
browser.visit("http://yourpage url here")
browser.quit()

display.stop()
2

Any application can connect over Tor if it supports SOCKS, or if it can be properly wrapped using torsocks or usewithtor. Aside from that, it seems like you just need a headless browser or some other Javascript execution environment, of which there are many.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.