Instructions for writing a simple DDoS Tool in Python – LLODO


Note 1: This tool is for research and learning purposes only. Please do not use the tool for bad purposes and perform illegal acts.

Note 2: This article is for you to familiarize yourself with Python and Python Modules, not to write a DDoS Tool to attack others, when finished, absolutely do not use the Tool on a system that is not managed by your friend.

Note 3: Actually this is Tool DoS, not DDoS, I write DDoS in the title so that you can easily distinguish between Deny of service and MS-DOS

Today I will show you how to make a simple TCP Flood tool in Python. This is a pretty powerful tool, which can make your computer or your computer that wants to attack will overflow with some spam packets that are sent and cause the CPU to increase up to 100%. If the device is weak, it will probably crash or buy a new one.

Before going into writing tools, I want to give you an understanding of Dos and the advanced of DoS is DDoS. So, what is Dos? And how does DoS work? You need to carefully read the article What is DDOS before practicing the content below.

First you have to Download Python. You can go to Youtube to see how to download and download Python, it’s also quite simple, I don’t guide in this article.

Install Python: At the first installation screen, remember to check the line Add python xx to path

Now open CMD on your Windows machine and enter the command: pip install termcolor , this is a font color library only, and those who don’t like it can skip it.

Because this is a DoS Tool, using resources from your Modem and PC, it only works well in a LAN environment, if it attacks outside, it is quite weak and sometimes counter-damaged.

Ok, now you will import the following modules:

import module ddos ​​python

After the import is complete, you proceed to decorate the interface for the tool, this decorates it beautifully, and anyone who does not like to decorate can go in and write code.

code tool ddos ​​python

Those of you who want to decorate like me can go to google and type keywords figlet online Then go to any website to get a sample.

As you can see, the code os.system('cls') This is the line of code that executes the command on the system’s cmd, when you run the tool, this code will delete all the existing letters on the cmd, leaving only the big DOS text below.

Oh, and one more problem is the word colored This is a module of termcolor and you notice that there are words like ‘red’, ‘green’, ….. at the end of the code, that is the color of the text that you want to print.

OK, so let’s take the next step:

Now we write a short code to get user input or “input”.

vietnamese tool ddos ​​python

Here, you can create any variable, and then we will take user input.

As you can see,str is a character string in Python, so because IP numbers often have different character strings separated by dots, I set it as ‘str’. And ‘int’ stands for Internet to be a data type, used in Python to represent integers.

Like that done. Now I will proceed to decorate the attack part. I decorate it to look at my father, and if you don’t like it, you can ignore it.

python ddos ​​tool

Ok, this is the code interface when the tool works to attack. The first sentence of code, the second sentence of code and the font color library have already been explained, so that’s it.

Now on to the most important issue for the tool to work here.

how to use python ddos

You proceed to create yourself a function and any 2 variables as shown in the picture.

Here I create a function named syn() and 2 variables named hevin and bb.

You see the variable 1. I called the random module available in Python and imported it in the first step, after the word random is the word urandom , both are random hash functions Implemented a pseudo-random number generator and contains functions that allow us to solve many different programming problems directly using randomness. What about variables? bb then I leave the integer as 0.

Come on, let’s create a loop for yourself while True: This is a loop that helps a certain piece of code work over and over again until I want to stop.

Now you make a pair try, except to catch errors in Python:

First, I create a variable named h in that variable I called the built-in socket module in Python. Socket are endpointsincubateamot communication channelsluggishp two chiyesu. It willeh dmoundng to ksluggishtnohiveh?imoonlyummother program onlyyesy per mot other computers on the Internet. USAoonlyummprogramyesyou caneh? Seh dmoundchildrenyesu socket same mot time,uh Doh yeahyesu chummthe program caneh? Seh dmoundInternet with meot time.

Tinext is h.connect This is me connecting to the ip and port of the attacker machine

Next is h.send(hevin), I use this code to send the victim’s computer random parameters from 0 to 900, that’s enough, and if you want to adjust it higher, you can.

Next up :>>, that is Jaw range() in Python which is used to create an object that contains elements that are a sequence of consecutive numbers from 0 to a value, whose value does not pass the specified argument you created the input for. user input

The next code, I explained earlier, now we will explain bb+=1 Please:

The code sentence can be translated as “add anything to the right of the sign.” += into the variable to the left of the . sign +=.

Eg. If you havea = 10 then a += 5 will: a = a + 5

So “a” now equals 15.

The remaining part in I have already explained it above

Let’s get to the ‘except’ part

Here I use KeyboardInterrupt to fix errors when stopping the tool. To stop the tool we press the key combination Ctrl+C to stop. And if you don’t like it, you can use it except: it’s okay.

Go to section h.close() I called the function close() so that every time it stops, the tool will stop running. The remaining part print(….) I will explain through that every time you stop the tool, it will appear Done.

Until the very end!!!!

At the end is the part for i in range(thread) I have already explained it to you as above, so I’ll skip it

Next to the last 2 lines of code, I proceeded to call module threads Available in Python this is a multithreaded module. That way we can understand Thread is a basic unit in CPU. A thread will share with other threads in the same process about its data information, data. Thread creation makes it possible for programs to run multiple jobs at the same time.

Not only that, Python provides thread Module and threading Module so that you can start a new thread as well as some other tasks during multi-threaded programming. Each Thread has a common life cycle of start, run and end. A Thread can be interrupted (interrupt), or be temporarily stopped (sleeping) while other Threads are running – this is called yielding.

Summary of the Code DoS above you can download from your Github. But I recommend that you practice the code according to the instructions above to better understand Python instead of pre-downloaded to use, so it will not improve programming knowledge.

How to use the Tool:

After you’re done, open cmd on your computer and point to the file you’ve placed (name).py and then enter the command.

python (name).py

Now the tool interface you have done will appear on the cmd screen asking you to enter the parameters: IP of the machine to attack, Port (port) computer, Threads (attack stream), Packet (Number of packages to send).

ddos lan

Attack Result:

Instructions for writing a simple DDoS Tool in Python 7

As you can see, I entered extremely low parameters but the result of the attack was very effective. Please note when testing on your own device =)). I let it take more than 5 seconds, my computer has reached 76% CPU

cpu ddos ​​lan

SO I TUTORED YOU TO FINDING HOW TO WRITE TOOL DOS IN PYTHON. Hope you will start learning Python basics with this article. I hope you guys should not use this Dos tool for bad purposes, instead, you can study how to prevent and prevent it.

Author: Van Son



Link Hoc va de thi 2021

Chuyển đến thanh công cụ