🢀︎ tools :: 8274354


commit 8274354659152f1e9cbaed10777eed5278ab30b1
Author: acidvegas <acid.vegas@acid.vegas>
Date:   Fri Jun 7 00:17:45 2019 -0400

    Initial commit

diff --git a/altdns.py b/altdns.py
new file mode 100644
index 0000000..15eb190
--- /dev/null
+++ b/altdns.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+from socket import gethostbyname
+dns     = ('irc.domain1.com','irc.domain2.com','irc.domain3.com')
+servers = ('1.1.1.1','2.2.2.2','3.3.3.3')
+for hostname in dns:
+	try:
+		if gethostbyname(hostname) in servers:
+			print('OK\t\t'+hostname)
+		else:
+			print('FAIL\t'+hostname)
+	except:
+		print('ERROR\t'+hostname)
\ No newline at end of file
diff --git a/deploy-anope b/deploy-anope
new file mode 100755
index 0000000..752f07d
--- /dev/null
+++ b/deploy-anope
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+set -xev
+
+ANOPE=$HOME/services
+BACKUP=$HOME/services.backup
+SOURCE=$HOME/services.source
+
+setup() {
+	git clone --depth 1 https://github.com/supernets/anope.git $SOURCE
+	$SOURCE/Config -nointro -quick
+	make -C $SOURCE/build && make -C $SOURCE/build install
+	rm -rf $SOURCE
+}
+
+deploy() {
+	setup
+	# edit services.conf here
+}
+
+update() {
+	# kill watchdog process
+	mkdir $BACKUP
+	cp $NAOPE/conf/services.conf $BACKUP && cp $ANOPE/data/anope.db $BACKUP
+	pkill -9 services
+	rm -rf $ANOPE
+	setup
+	mv $BACKUP/services.conf $ANOPE/conf/
+	mv $BACKUP/anope.db $ANOPE/data
+	$ANOPE/bin/services
+	watchdog
+}
+
+watchdog() {
+	#abduco -fnr ircwatchdog     bash -c "while true; do [ ! -f $HOME/anope/data/services.pid ] && $HOME/anope/bin/services; sleep 15; done"
+	#screen -S   ircwatchdog -dm bash -c "while true; do [ ! -f $HOME/anope/data/services.pid ] && $HOME/anope/bin/services; sleep 15; done"
+}
+
+if [ $# -ne 1 ]; then
+	echo "usage: deploy-anope <deploy/update/watchdog>"
+elif [ $1 == "deploy"]; then
+	deploy
+elif [ $1 == "update"]; then
+	update
+elif [ $1 == "watchdog"]; then
+	watchdog
+else
+	echo "usage: deploy-anope <deploy/update/watchdog>"
+fi
\ No newline at end of file
diff --git a/deploy-nginx b/deploy-nginx
new file mode 100755
index 0000000..4c7cf0a
--- /dev/null
+++ b/deploy-nginx
@@ -0,0 +1,9 @@
+#!/bin/sh
+pacman -S certbot nginx-mainline
+git clone https://github.com/supernets/www $HOME
+wget -O /etc/nginx/nginx.conf https://raw.githubusercontent.com/supernets/nginx/master/files/nginx.conf
+systemctl enable nginx && systemctl start nginx
+certbot certonly --email admin@supernets.org --rsa-key-size 4096 --webroot -w $HOME/www/ -d supernets.org -d www.supernets.org
+echo -e "[Unit]\nDescription=Lets Encrypt renewal\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/certbot renew -n -q --agree-tos --post-hook=\"systemctl reload nginx\"" > /etc/systemd/system/certbot.service
+echo -e "[Unit]\nDescription=Twice daily renewal of Let's Encrypts certificates\n\n[Timer]\nOnCalendar=0/12:00:00\nRandomizedDelaySec=1h\nPersistent=true\n\n[Install]\nWantedBy=timers.target" > /etc/systemd/system/certbot.timer
+systemctl enable certbot.timer && systemctl start certbot.timer
\ No newline at end of file
diff --git a/deploy-unrealircd b/deploy-unrealircd
new file mode 100755
index 0000000..0030763
--- /dev/null
+++ b/deploy-unrealircd
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+set -xev
+
+BACKUP=$HOME/unrealircd.backup
+SOURCE=$HOME/unrealircd.source
+UNREAL=$HOME/unrealircd
+
+setup() {
+	git clone --depth 1 https://github.com/supernets/unrealircd.git $SOURCE
+	echo -e "\n" | $SOURCE/Config -nointro
+	make -C $SOURCE && make -C $SOURCE install
+	cd $HOME && rm -rf $SOURCE && rm $UNREAL/conf/*.conf
+}
+
+deploy() {
+	setup
+	read -p "Link Name: " NAME
+	SID=$(cat /dev/urandom | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 1)$(cat /dev/urandom | tr -dc 'A-Z0-9' | fold -w 2 | head -n 1)
+	echo "[NOTE] - Your remote include should be in (http/https)://USERNAME:PASSWORD@HOSTNAME:PORT format"
+	read -p "Remote Include: " REMOTE
+	for item in "aliases badwords except help ircd modules opers spamfilter"; do echo "$REMOTE/$item.conf" >> $UNREAL/conf/unrealircd.conf; done
+	echo "me { name \"$NAME.supernets.org\"; info \"Supernets IRC Network\"; sid $SID; }" >> $UNREAL/conf/unrealircd.conf
+	SPKI=$($UNREAL/unrealircd spkifp | sed -n 5p)
+	echo -e "\nAdd the following line into the hub\'s links.conf file for this link:\n$SPKI"
+}
+
+update() {
+	# kill watchdog process
+	mkdir $BACKUP
+	cp $UNREAL/conf/unrealircd.conf $BACKUP && cp $UNREAL/conf/ssl/server.*.pem $BACKUP
+	$UNREAL/unrealircd stop
+	rm -rf $UNREAL
+	setup
+	mv $BACKUP/unrealircd.conf $UNREAL/conf/ && mv $BACKUP/server.*.pem $UNREAL/conf/ssl
+	rm -r $BACKUP
+	$UNREAL/unrealircd start
+	watchdog
+}
+
+update_all() {
+	for LEAF in biscuit contra kratom spider swag trump; do
+		ssh $LEAF './deploy-unrealircd update'
+	done;
+}
+
+watchdog() {
+	#abduco -fnr ircdwatchdog     bash -c "while true; do [ ! -f $HOME/unrealircd/data/unrealircd.pid ] && $HOME/unrealircd/unrealircd start; sleep 15; done"
+	#screen -S   ircdwatchdog -dm bash -c "while true; do [ ! -f $HOME/unrealircd/data/unrealircd.pid ] && $HOME/unrealircd/unrealircd start; sleep 15; done"
+	#[ ! -f $HOME/services/data/services.pid     ] && $HOME/services/bin/services
+}
+
+if [ $# -ne 1 ]; then
+	echo "usage: deploy-unrealircd <deploy/update/watchdog>"
+elif [ $1 == "deploy" ]; then
+	deploy
+elif [ $1 == "update" ]; then
+	update
+elif [ $1 == "watchdog" ]; then
+	watchdog
+else
+	echo "usage: deploy-unrealircd <deploy/update/watchdog>"
+fi
\ No newline at end of file
diff --git a/files/nginx.conf b/files/nginx.conf
new file mode 100644
index 0000000..28090f6
--- /dev/null
+++ b/files/nginx.conf
@@ -0,0 +1,111 @@
+worker_processes auto;
+worker_cpu_affinity auto;
+
+events {
+	worker_connections 1024;
+	use epoll;
+	multi_accept on;
+}
+
+http {
+	include mime.types;
+	default_type application/octet-stream;
+	charset utf-8;
+	source_charset utf-8;
+
+	access_log off;
+	error_log logs/error.log error;
+	log_not_found off;
+	log_subrequest off;
+
+	sendfile on;
+	sendfile_max_chunk 512k;
+	tcp_nopush on;
+	tcp_nodelay on;
+
+	gzip on;
+	gzip_comp_level 5;
+	gzip_min_length 256;
+	gzip_proxied any;
+	gzip_vary on;
+	gzip_types application/javascript image/gif image/jpeg image/png image/x-icon image/x-png text/css;
+
+	client_body_buffer_size 128k;
+	client_body_timeout 12;
+	client_header_buffer_size 1k;
+	client_header_timeout 12;
+	client_max_body_size 10m;
+	keepalive_timeout 15;
+	large_client_header_buffers 4 4k;
+	output_buffers 1 32k;
+	postpone_output 1460;
+	reset_timedout_connection on;
+	send_timeout 10;
+
+	open_file_cache max=1000 inactive=5m;
+	open_file_cache_valid 20m;
+	open_file_cache_min_uses 1;
+	open_file_cache_errors on;
+
+	limit_req_zone $binary_remote_addr zone=ip_req:10m rate=1000r/s;
+	limit_req_zone $server_name zone=server_req:10m rate=1000r/s;
+	limit_req_status 429;
+	limit_req zone=ip_req burst=50 nodelay;
+	limit_req zone=server_req burst=100;
+	limit_conn_zone $binary_remote_addr zone=ip_conn:10m;
+	limit_conn_status 429;
+
+	index index.php index.htm index.html;
+
+	server {
+		listen 80;
+		listen [::]:80;
+		server_name supernets.org www.supernets.org;
+		return 301 https://$server_name$request_uri;
+	}
+
+	server {
+		listen 443 ssl http2;
+		listen [::]:443 ssl http2;
+		server_name www.supernets.org;
+		server_tokens off;
+
+		ssl_certificate /etc/letsencrypt/live/supernets.org/fullchain.pem;
+		ssl_certificate_key /etc/letsencrypt/live/supernets.org/privkey.pem;
+		ssl_ciphers "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES25$A-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS";
+		ssl_ecdh_curve secp384r1;
+		ssl_prefer_server_ciphers on;
+		ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
+		ssl_session_cache shared:SSL:10m;
+		ssl_session_tickets off;
+		ssl_session_timeout 1d;
+		ssl_stapling on;
+		ssl_stapling_verify on;
+		ssl_trusted_certificate /etc/letsencrypt/live/supernets.org/chain.pem;
+
+		resolver 208.67.222.222 208.67.220.220 valid=300s;
+        resolver_timeout 5s;
+
+		add_header X-Frame-Options SAMEORIGIN;
+		add_header X-Content-Type-Options nosniff;
+		add_header X-XSS-Protection "1; mode=block";
+		add_header Referrer-Policy "no-referrer";
+		add_header Strict-Transport-Security "max-age=31536000;";
+		add_header Content-Security-Policy "base-uri 'self'; block-all-mixed-content; child-src 'none'; connect-src 'none'; default-src 'self'; font-src 'self'; form-action 'self'; frame-ancestors 'none'; img-src 'self'; manifest-src 'none'; media-src 'none'; object-src 'none'; plugin-types 'none'; sandbox 'allow-forms allow-same-origin allow-scripts allow-popups allow-popups-to-escape-sandbox allow-top-navigation'; script-src 'self'; style-src 'self'; worker-src 'none';";
+
+		location / {
+			root /home/supernets/www;
+			error_page 401 403 404 /error.html;
+			expires epoch;
+		}
+
+		location ~ /\.git {
+			deny all;
+		}
+
+		location ^~ /.well-known/acme-challenge/ {
+			default_type "text/plain";
+			root /var/lib/letsencrypt;
+		}
+	}
+}
diff --git a/files/nginx_hub.conf b/files/nginx_hub.conf
new file mode 100644
index 0000000..a567931
--- /dev/null
+++ b/files/nginx_hub.conf
@@ -0,0 +1,31 @@
+worker_processes auto;
+worker_cpu_affinity auto;
+error_log logs/error.log;
+
+events {
+	worker_connections 1024;
+}
+
+http {
+	include mime.types;
+	default_type application/octet-stream;
+	access_log off;
+	sendfile on;
+	server_tokens off;
+	server {
+		listen CHANGEME_PORT;
+		listen [::]:CHANGEME_PORT;
+		root /home/supernets/www;
+		server_name localhost;
+		charset UTF-8;
+		#satisfy all;
+		allow 1.2.3.4; # Link 1
+		allow 1.2.3.4; # Link 2
+		allow 1.2.3.4; # Link 3
+		allow 1.2.3.4; # Link 4
+		allow 1.2.3.4; # Link 5
+		deny all;
+		auth_basic "Restricted";
+		auth_basic_user_file /home/supernets/www/.htpasswd;
+	}
+}
\ No newline at end of file
diff --git a/startbots b/startbots
new file mode 100755
index 0000000..98cea37
--- /dev/null
+++ b/startbots
@@ -0,0 +1,11 @@
+#!/bin/sh
+pkill -9 abduco && pkill -9 python
+cd $HOME/bots              && sleep 1 && abduco -n FUCKYOU      python 5000.py
+cd $HOME/bots/anythinggoes && sleep 1 && abduco -n anythinggoes python anythinggoes.py
+cd $HOME/bots              && sleep 1 && abduco -n cancer       python cancer.py
+cd $HOME/bots/dickserv     && sleep 1 && abduco -n dickserv     python dickserv.py
+cd $HOME/bots/irccex/efnet && sleep 1 && abduco -n irccex-efnet python irccex.py
+cd $HOME/bots/irccex/super && sleep 1 && abduco -n irccex-super python irccex.py
+cd $HOME/bots              && sleep 1 && abduco -n limitserv    python limitserv.py
+cd $HOME/bots/scroll       && sleep 1 && abduco -n scroll       python scroll.py
+cd $HOME/bots              && sleep 1 && abduco -n spiderweb    python spiderweb.py
\ No newline at end of file