#!usr/bin/env python
# -*- coding:utf-8 -*-
# Antichat PM flooder
import time
import urllib
import urllib2
import cookielib
import threading
from Tkinter import *
from tkMessageBox import showerror
PAUSE = False
STOP = False
Headers = {"User-Agent" : "Opera/9.64 (Windows NT 5.1; U; en) Presto/2.1.1",
"Accept" : "text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1",
"Accept-Language" : "ru,uk-UA;q=0.9,uk;q=0.8,en;q=0.7",
"Accept-Charset" : "iso-8859-1, utf-8, utf-16, *;q=0.1",
"Accept-Encoding" : "identity, *;q=0",
"Connection" : "Keep-Alive",
"Referer" : "http://forum.antichat.ru/"}
def login_(login, password):
login_table = urllib.urlencode({"do":"login",
"forceredirect":u"1",
"url":"http://forum.antichat.ru/forum36.html",
"vb_login_md5password":"",
"vb_login_md5password_utf":"",
"s":"",
"vb_login_username":login.encode("cp1251"),
"vb_login_password":password.encode("cp1251"),
"cookieuser":"1"})
cookies = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies))
urllib2.install_opener(opener)
login_request = urllib2.Request("http://forum.antichat.ru/login.php", login_table, Headers)
try:
login_page = urllib2.urlopen(login_request).read()
except:
return None
if "http://forum.antichat.ru/forum36.html" in login_page:
return cookies
else:
return None
def send_message(cookies, victim):
message = MessageText.get(0.0, "end")
header = HeaderEntry.get()
send_table = urllib.urlencode({"recipients":victim.encode("cp1251"),
"title":header.encode("cp1251"),
"mode":"0",
"message":message.encode("cp1251"),
"iconid":"0",
"s":"",
"do":"insertpm",
"forward":"",
"receipt":"0",
"sbutton":u"Создать сообщение".encode("cp1251"),
"savecopy":"0",
"parseurl":"1"})
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies))
urllib2.install_opener(opener)
flood_request = urllib2.Request("http://forum.antichat.ru/private.php", send_table, Headers)
try:
flood_page = urllib2.urlopen(flood_request).read()
except:
pass
def flood(login, password, victim, howmany):
global Counter
cnter = 0
cookies = login_(login, password)
if cookies is None:
YournickEntry["state"] = "normal"
YourpasswordEntry["state"] = "normal"
VictimEntry["state"] = "normal"
CountSpinbox["state"] = "readonly"
StartButton["state"] = "normal"
PauseButton["state"] = "disabled"
StopButton["state"] = "disabled"
PauseButton["text"] = u"Подождать11"
showerror(u"Ошибка", u"Неверные имя пользователя/пароль")
return
else:
while not STOP:
if PAUSE:
time.sleep(0.1)
else:
if cnter == howmany:
return
else:
send_message(cookies, victim)
cnter += 1
Counter.set(cnter)
time.sleep(60)
YournickEntry["state"] = "normal"
YourpasswordEntry["state"] = "normal"
VictimEntry["state"] = "normal"
CountSpinbox["state"] = "readonly"
StartButton["state"] = "normal"
PauseButton["state"] = "disabled"
StopButton["state"] = "disabled"
PauseButton["text"] = u"Подождать11"
return
def Start_Button():
PAUSE = False
STOP = False
login = YournickEntry.get()
password = YourpasswordEntry.get()
victim = VictimEntry.get()
howmany = int(CountSpinbox.get())
YournickEntry["state"] = "disabled"
YourpasswordEntry["state"] = "disabled"
VictimEntry["state"] = "disabled"
CountSpinbox["state"] = "disabled"
StartButton["state"] = "disabled"
PauseButton["state"] = "normal"
StopButton["state"] = "normal"
threading.Thread(target=flood, args=[login, password, victim, howmany]).start()
return
def Pause_Button():
global PAUSE
if PAUSE:
PAUSE = False
PauseButton["text"] = u"Подождать11"
elif not PAUSE:
PAUSE = True
PauseButton["text"] = u"Ждемс11"
return
def Stop_Button():
global STOP
global PAUSE
PAUSE = False
STOP = True
YournickEntry["state"] = "normal"
YourpasswordEntry["state"] = "normal"
VictimEntry["state"] = "normal"
CountSpinbox["state"] = "readonly"
StartButton["state"] = "normal"
PauseButton["state"] = "disabled"
StopButton["state"] = "disabled"
PauseButton["text"] = u"Подождать11"
MainWindow = Tk()
MainWindow.title(u"Antichat.ru PM flooder")
MainWindow["bd"] = 5
Counter = StringVar()
YournickLabel = Label(MainWindow, text=u"Ваш ник :", anchor="w", width=15)
YournickEntry = Entry(MainWindow, width=20)
YournickLabel.grid(row=0, column=0, sticky="w")
YournickEntry.grid(row=0, column=1, sticky="e")
YourpasswordLabel = Label(MainWindow, text=u"Ваш пароль :", anchor="w", width=15)
YourpasswordEntry = Entry(MainWindow, width=20)
YourpasswordLabel.grid(row=1, column=0, sticky="w")
YourpasswordEntry.grid(row=1, column=1, sticky="e")
VictimLabel = Label(MainWindow, text=u"Ник жертвы :", anchor="w", width=15)
VictimEntry = Entry(MainWindow, width=20)
VictimLabel.grid(row=2, column=0, sticky="w")
VictimEntry.grid(row=2, column=1, sticky="e")
CountLabel = Label(MainWindow, text=u"Количество(шт) :", anchor="w", width=15)
CountSpinbox = Spinbox(MainWindow, width=5, state="readonly", wrap=True, from_=0, to_=1000)
CountLabel.grid(row=3, column=0, sticky="w")
CountSpinbox.grid(row=3, column=1, sticky="e")
SendedLabel = Label(MainWindow, text=u"Отправлено(шт) :", anchor="w", width=15)
SendedCount = Label(MainWindow, textvariable=Counter, width=20, anchor="e")
SendedLabel .grid(row=4, column=0, sticky="w")
SendedCount.grid(row=4, column=1, sticky="e")
HeaderLabel = Label(MainWindow, text=u"Заголовок мессаги :", anchor="w", width=15)
HeaderEntry = Entry(MainWindow, width=20)
HeaderLabel.grid(row=5, column=0, sticky="w")
HeaderEntry.grid(row=5, column=1, sticky="e")
MessageLabel = Label(MainWindow, text=u"Текст мессаги :", anchor="w", width=15)
MessageText = Text(MainWindow, width=5, height=5)
MessageLabel.grid(row=6, column=0, columnspan=2, sticky="we")
MessageText.grid(row=7, column=0, columnspan=2, sticky="we")
ButtonsFrame = Frame(MainWindow)
ButtonsFrame.grid(row=8, column=0, columnspan=2)
StartButton = Button(ButtonsFrame, text=u"Отаке!!11", command=Start_Button)
StartButton.grid(row=0, column=0)
PauseButton = Button(ButtonsFrame, text=u"Подождать11", state="disabled", command=Pause_Button)
PauseButton.grid(row=0, column=1)
StopButton = Button(ButtonsFrame, text=u"Стоять!!", state="disabled", command=Stop_Button)
StopButton.grid(row=0, column=2)
MainWindow.mainloop()