├── LICENSE ├── README.md └── spamcity.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 dbertho 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # spamcity 2 | Spam Numbeo and make your city the most dangerous place on Earth 3 | https://x.com/dbertho/status/1574761634840592384 4 | -------------------------------------------------------------------------------- /spamcity.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from bs4 import BeautifulSoup 3 | import urllib 4 | from random import choice 5 | from random import randint 6 | 7 | def proxy_generator(): 8 | proxy = choice(list(lines)) 9 | proxy = {"https": proxy} 10 | print(proxy) 11 | return proxy 12 | 13 | def pretty_print_POST(req): 14 | print('{}\n{}\r\n{}\r\n\r\n{}'.format( 15 | '-----------REQUEST-----------', 16 | req.method + ' ' + req.url, 17 | '\r\n'.join('{}: {}'.format(k, v) for k, v in req.headers.items()), 18 | req.body, 19 | )) 20 | 21 | def spam(): 22 | while True: 23 | proxy = proxy_generator() 24 | try: 25 | sleep(1) 26 | response = requests.get('https://api.myip.com/', proxies=proxy, timeout=5) 27 | print(response.json()) 28 | if response.status_code == 200: 29 | break 30 | else: 31 | pass 32 | except: 33 | print("Proxy is not responding, trying another one") 34 | pass 35 | 36 | session = requests.Session() 37 | url = 'https://www.numbeo.com/crime/form.jsp?country=France&city=Brest&returnUrl=https%3A%2F%2Fwww.numbeo.com%2Fcrime%2Fin%2FBrest' 38 | jsessionid = "0" 39 | try: 40 | response = session.get(url, proxies=proxy, timeout=10) 41 | soup = BeautifulSoup(response.text, "html.parser") 42 | checking = soup.find('input', {'name': 'checking'}).get('value') 43 | print(checking) 44 | session_cookies = session.cookies 45 | cookies_dictionary = session_cookies.get_dict() 46 | jsessionid = cookies_dictionary['JSESSIONID'] 47 | print(jsessionid) 48 | except: 49 | print("connection failed") 50 | 51 | ua=["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15"] 52 | 53 | level_of_crime = ["2.0", "2.0","2.0","2.0","2.0","1.0"] 54 | crime_increasing = ["2.0","2.0","2.0","2.0"] 55 | safe_alone_daylight = ["-2.0","-2.0","-2.0","-1.0","-1.0"] 56 | safe_alone_night = ["-2.0","-2.0","-2.0","-2.0","-2.0"] 57 | worried_home_broken = ["2.0","2.0","2.0","2.0","2.0","1.0"] 58 | worried_mugged_robbed = ["2.0","2.0","2.0","2.0","2.0","1.0","2.0","1.0"] 59 | worried_car_stolen = ["2.0","2.0","2.0","2.0","2.0","2.0","1.0"] 60 | worried_things_car_stolen = ["2.0","2.0","2.0","2.0","2.0","1.0"] 61 | worried_attacked = ["2.0","2.0","2.0","2.0","2.0","2.0"] 62 | worried_insulted = ["2.0","2.0","2.0","2.0","2.0","2.0","1.0"] 63 | worried_skin_ethnic_religion = ["2.0","2.0","2.0","2.0","2.0","1.0"] 64 | problem_drugs = ["2.0","2.0","2.0","2.0","2.0","2.0","1.0"] 65 | problem_property_crimes = ["2.0","2.0","2.0","2.0","1.0"] 66 | problem_violent_crimes = ["2.0","2.0","2.0","2.0","2.0","1.0"] 67 | problem_corruption_bribery = ["2.0","2.0","2.0","2.0","2.0","2.0","1.0"] 68 | 69 | headers = { 70 | "Host": "fr.numbeo.com", 71 | "User-Agent": choice(ua), 72 | "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" , 73 | "Accept-Language": "en-US,en;q=0.5" , 74 | "Accept-Encoding": "gzip, deflate, br" , 75 | "Content-Type": "application/x-www-form-urlencoded" , 76 | "Origin": "https://www.numbeo.com" , 77 | "DNT": "1" , 78 | "Connection": "keep-alive" , 79 | "Referer": 'https://fr.numbeo.com/criminalit%C3%A9/modifier?returnUrl=https%3A%2F%2Ffr.numbeo.com%2Fcriminalit%25C3%25A9%2Fville%2FBrest&tracking=getEnterDataHtml2ForExtendedModuos&locCity=Brest&locCountry=France' , 80 | "Cookie": "JSESSIONID="+jsessionid , 81 | "Upgrade-Insecure-Requests": "1" , 82 | "Sec-Fetch-Dest": "document" , 83 | "Sec-Fetch-Mode": "navigate" , 84 | "Sec-Fetch-Site": "same-origin" , 85 | "Sec-Fetch-User": "?1" , 86 | "Sec-GPC": "1", 87 | } 88 | data = { 89 | "locCountry":"France", 90 | "locCity":"Brest", 91 | "level_of_crime":choice(level_of_crime), 92 | "crime_increasing":choice(crime_increasing), 93 | "safe_alone_daylight":choice(safe_alone_daylight), 94 | "safe_alone_night":choice(safe_alone_night), 95 | "worried_home_broken":choice(worried_home_broken), 96 | "worried_mugged_robbed":choice(worried_mugged_robbed), 97 | "worried_car_stolen":choice(worried_car_stolen), 98 | "worried_things_car_stolen":choice(worried_things_car_stolen), 99 | "worried_attacked":choice(worried_attacked), 100 | "worried_insulted":choice(worried_insulted), 101 | "worried_skin_ethnic_religion":choice(worried_skin_ethnic_religion), 102 | "problem_drugs":choice(problem_drugs), 103 | "problem_property_crimes":choice(problem_property_crimes), 104 | "problem_violent_crimes":choice(problem_violent_crimes), 105 | "problem_corruption_bribery":choice(problem_corruption_bribery), 106 | "checking":jsessionid, 107 | "returnUrl":'https://fr.numbeo.com/criminalit%C3%A9/ville/Brest' 108 | } 109 | 110 | url = "https://fr.numbeo.com/crime/i18n-save" 111 | 112 | req = requests.Request('POST',url, headers=headers, data=data) 113 | prepared = req.prepare() 114 | pretty_print_POST(prepared) 115 | try: 116 | response = session.send(prepared, proxies=proxy, timeout=10) 117 | print(response.status_code) 118 | except: 119 | print("connection failed") 120 | 121 | 122 | response1 = requests.get("https://raw.githubusercontent.com/roosterkid/openproxylist/main/HTTPS_RAW.txt") 123 | response2 = requests.get("https://raw.githubusercontent.com/saschazesiger/Free-Proxies/master/proxies/ultrafast.txt") 124 | response3 = requests.get("https://raw.githubusercontent.com/mertguvencli/http-proxy-list/main/proxy-list/data.txt") 125 | response4 = requests.get("https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt") 126 | response5 = requests.get("https://raw.githubusercontent.com/jetkai/proxy-list/main/online-proxies/txt/proxies-https.txt") 127 | response6 = requests.get("https://raw.githubusercontent.com/rx443/proxy-list/main/online/https.txt") 128 | response7 = requests.get("https://raw.githubusercontent.com/officialputuid/KangProxy/KangProxy/https/https.txt") 129 | lines = response1.text.splitlines() 130 | lines.extend(response2.text.splitlines()) 131 | lines.extend(response3.text.splitlines()) 132 | lines.extend(response4.text.splitlines()) 133 | lines.extend(response5.text.splitlines()) 134 | lines.extend(response6.text.splitlines()) 135 | lines.extend(response7.text.splitlines()) 136 | 137 | while True: 138 | spam() 139 | --------------------------------------------------------------------------------