Menú

Mostrar Mensajes

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ú

Temas - Baal.

#1
Saludos a toda la comunidad, este es mi primer post y aporte, es bastante sencillo pero espero que les pueda servir a muchos.
Debo agregar que este script lo hice en python 2.7.3 y fue creado hace bastante tiempo(cuando mis conocimientos en python eran de principiante.)

EDITO: espero no parecer molesto.. pero me gustaría que comenten.

PD: Esta es su versión simple todavía no he terminado el modo complejo.
Agrego, sucede que si el archivo a cifrar no esta en "C:/" no funciona, modifique el raw_input con ".replace" y funciono correctamente (aun que no se encuentre en dicha ruta), espero les sirva y cualquier problema dejen comentario o manden PM.
Código (python) [Seleccionar]

# !usr/bin/python
# -*- coding: utf-8 -*-
# ----------------

import os
import sys
import hashlib
import random
import time

print """
  ###############################
  #     .                     ___        ____                  #
  #     |\   /|     | ___    |   \ | _   |__/ _|._          #
  #     | \_/ |  ___| \__.   |     |/  | |     |             #
  #     |     | /___| ___|   |___/ |   | |     |           #
  #                                                                 #
  #        by: Baal                                          #
  #                               Happy hacking...          #
  ###############################
"""
def main():
print """
  |1)- Random MD5 Cryptik algorithm(modo complejo)
  |2)- String MD5 Cryptik algorithm(modo simple)
  |3)- Agregar bytes antes de cifrar(Recomendado)
  |4)- Leer estructura de un archivo
  |5)- Creditos
  |6)- Extras
  |7)- Salir
        """

choice= int(raw_input("elige una opcion[1-6]: "))
if choice==1:
hint= "Seleccione/Desplaze el archivo:"
_choiceFILE= raw_input(hint).replace('"', '')

_hint= "Numero de iteraciones?: "
print "   #Cuantas mas iteraciones se hagan, mas indetectable sera el archivo "
print "   #pero su peso incrementara notablemente.                            "
print "   #Demasiadas iteraciones no aseguran 100% de indetectabilidad        "
_iterFILE= int(raw_input(_hint))
rang = range(_iterFILE)
rang = 1
while _iterFILE >= rang :

#comienza a ejecutarse con random
r = random.randrange(1,90)

#secuencia algoritmica de ataque
Rndm_Sec_x= "CryptikFatalodMethod"
Rndm_Sec_y= "AttackqOfPunpkinHeack"
Rndm_Sec_z= "BaaLCrushStackSequency"
_codec= Rndm_Sec_x + Rndm_Sec_y + Rndm_Sec_z #1 and 15
__codec= Rndm_Sec_x + Rndm_Sec_z + Rndm_Sec_y # 16 and 30
__codec_= Rndm_Sec_y + Rndm_Sec_x + Rndm_Sec_z # 31 and 45
___codec= Rndm_Sec_y + Rndm_Sec_z + Rndm_Sec_x # 46 and 60
___codec__= Rndm_Sec_z + Rndm_Sec_y + Rndm_Sec_x # 61 and 75
____codec__= Rndm_Sec_z + Rndm_Sec_x + Rndm_Sec_y # 76 and 90

if r>=1 and r<=15:
h=hashlib.md5()
h.update(_codec)
h.hexdigest()
crypt1= h.hexdigest()
print crypt1

FILEr= open(_choiceFILE, "rb+")

while True:
allins= 9999*9999
fr= FILEr.readline(allins)
lr= [fr]
FILEr.flush()
print lr
if fr== "":
break
FILEr.close()
# r+
fo= open(_choiceFILE, "r+").read()
# modifica el string
fo= fo.replace("\x02", "\xc0")
foo= fo.replace("\x4d", "\x12")
fooo= fo.replace("\x3a", "\xa2")

_fo= fo.replace("\x2e", "\x00")
__fo= fo.replace("\xbb", "\xe2")
___fo= fo.replace("\x0d", "\x9c")

# remplaza el archivo o crea uno nuevo
open(_choiceFILE, "ab+").write(fo)
open(_choiceFILE, "ab+").write(foo)
open(_choiceFILE, "ab+").write(fooo)

open(_choiceFILE, "rb+").write(_fo)
open(_choiceFILE, "rb+").write(__fo)
open(_choiceFILE, "rb+").write(___fo)
fw= open(_choiceFILE, "a+").write(crypt1)
print "Encrypted rutine: 1,15"

if r>=16 and r<=30:
h=hashlib.md5()
h.update(__codec)
h.hexdigest()
crypt2= h.hexdigest()
print crypt2

FILEr= open(_choiceFILE, "rb+")

while True:
allins= 9999*9999
fr= FILEr.readline(allins)
lr= [fr]
FILEr.flush()
print lr
if fr== "":
break
FILEr.close()
# r+
fo= open(_choiceFILE, "r+").read()
# modifica el string
fo= fo.replace("\x0e", "\x78")
foo= fo.replace("\xef", "\xb2")
fooo= fo.replace("\x20", "\xff")

_fo= fo.replace("\x10", "\x2a")
__fo= fo.replace("\xa1", "\xa2")
___fo= fo.replace("\x44", "\xcb")

# remplaza el archivo o crea uno nuevo
open(_choiceFILE, "ab+").write(fo)
open(_choiceFILE, "ab+").write(foo)
open(_choiceFILE, "ab+").write(fooo)

open(_choiceFILE, "rb+").write(_fo)
open(_choiceFILE, "rb+").write(__fo)
open(_choiceFILE, "rb+").write(___fo)
fw= open(_choiceFILE, "a+").write(crypt2)
print "Encrypted rutine: 16,30"

if r>=31 and r<=45:
h=hashlib.md5()
h.update(__codec_)
h.hexdigest()
crypt3= h.hexdigest()
print crypt3

FILEr= open(_choiceFILE, "rb+")

while True:
allins= 9999*9999
fr= FILEr.readline(allins)
lr= [fr]
FILEr.flush()
print lr
if fr== "":
break
FILEr.close()
# r+
fo= open(_choiceFILE, "r+").read()
# modifica el string
fo= fo.replace("\xcc", "\xd8")
foo= fo.replace("\xa0", "\x42")
fooo= fo.replace("\x1d", "\x12")

_fo= fo.replace("\x23", "\x20")
__fo= fo.replace("\x2a", "\xaa")
___fo= fo.replace("\x10", "\xf7")

# remplaza el archivo o crea uno nuevo
open(_choiceFILE, "ab+").write(fo)
open(_choiceFILE, "ab+").write(foo)
open(_choiceFILE, "ab+").write(fooo)

open(_choiceFILE, "rb+").write(_fo)
open(_choiceFILE, "rb+").write(__fo)
open(_choiceFILE, "rb+").write(___fo)
fw= open(_choiceFILE, "a+").write(crypt3)
print "Encrypted rutine: 31,45"

if r>=46 and r<=60:
h=hashlib.md5()
h.update(___codec)
h.hexdigest()
crypt4= h.hexdigest()
print crypt4

FILEr= open(_choiceFILE, "rb+")

while True:
allins= 9999*9999
fr= FILEr.readline(allins)
lr= [fr]
FILEr.flush()
print lr
if fr== "":
break
FILEr.close()

fo= open(_choiceFILE, "r+").read()
# modifica el string
fo= fo.replace("\x78", "\xda")
foo= fo.replace("\x18", "\xb0")
fooo= fo.replace("\x3a", "\x32")

_fo= fo.replace("\x00", "\x2c")
__fo= fo.replace("\xb3", "\x40")
___fo= fo.replace("\xda", "\x5d")

# remplaza el archivo o crea uno nuevo
open(_choiceFILE, "ab+").write(fo)
open(_choiceFILE, "ab+").write(foo)
open(_choiceFILE, "ab+").write(fooo)

open(_choiceFILE, "rb+").write(_fo)
open(_choiceFILE, "rb+").write(__fo)
open(_choiceFILE, "rb+").write(___fo)
fw= open(_choiceFILE, "a+").write(crypt4)
print "Encrypted rutine: 46,60"

if r>=61 and r<=75:
h=hashlib.md5()
h.update(___codec__)
h.hexdigest()
crypt5= h.hexdigest()
print crypt5

FILEr= open(_choiceFILE, "rb+")

while True:
allins= 9999*9999
fr= FILEr.readline(allins)
lr= [fr]
FILEr.flush()
print lr
if fr== "":
break
FILEr.close()
# r+
fo= open(_choiceFILE, "r+").read()
# modifica el string
fo= fo.replace("\xff", "\x80")
foo= fo.replace("\xda", "\x4c")
fooo= fo.replace("\x2a", "\xc6")

_fo= fo.replace("\x30", "\xae")
__fo= fo.replace("\x5f", "\x62")
___fo= fo.replace("\x58", "\xdd")

# remplaza el archivo o crea uno nuevo
open(_choiceFILE, "ab+").write(fo)
open(_choiceFILE, "ab+").write(foo)
open(_choiceFILE, "ab+").write(fooo)

open(_choiceFILE, "rb+").write(_fo)
open(_choiceFILE, "rb+").write(__fo)
open(_choiceFILE, "rb+").write(___fo)
fw= open(_choiceFILE, "a+").write(crypt5)
print "Encrypted rutine: 61,75"

if r>=76 and r<=90:
h=hashlib.md5()
h.update(____codec__)
h.hexdigest()
crypt6= h.hexdigest()
print crypt6

FILEr= open(_choiceFILE, "rb+")

while True:
allins= 9999*9999
fr= FILEr.readline(allins)
lr= [fr]
FILEr.flush()
print lr
if fr== "":
break
FILEr.close()
# r+
fo= open(_choiceFILE, "r+").read()
# modifica el string
fo= fo.replace("\xf2", "\xdf")
foo= fo.replace("\x21", "\x34")
fooo= fo.replace("\x82", "\x6e")

_fo= fo.replace("\x13", "\x54")
__fo= fo.replace("\x3a", "\x21")
___fo= fo.replace("\x5f", "\x7a")

# remplaza el archivo o crea uno nuevo
open(_choiceFILE, "ab+").write(fo)
open(_choiceFILE, "ab+").write(foo)
open(_choiceFILE, "ab+").write(fooo)

open(_choiceFILE, "rb+").write(_fo)
open(_choiceFILE, "rb+").write(__fo)
open(_choiceFILE, "rb+").write(___fo)
fw= open(_choiceFILE, "a+").write(crypt6)
print "Encrypted rutine: 76,90"

# rompe el ciclo
rang += 1
#fileOpen= open(_choiceFILE, "r")
#fileOpen.readlines()
if choice==2:
hint___= "Seleccione/Desplaze el archivo:"
_choiceFILE= raw_input(hint___)

ENCODING= raw_input("cadena/frase con la que se encriptara el archivo: ")

_hint__= "Numero de iteraciones?: "
_iterFILE= int(raw_input(_hint__))
rang = range(_iterFILE)
rang = 1

hint_data= "Guardar cadena de encriptacion en un .txt?(s/n)"
chDATA= raw_input(hint_data)

while _iterFILE >= rang :
h=hashlib.md5()
h.update(ENCODING)
h.hexdigest()
cryptik= h.hexdigest()
print cryptik

FILEr= open(_choiceFILE, "rb+")

while True:
allins= 9999*9999
fr= FILEr.readline(allins)
lr= [fr]
FILEr.flush()
print lr
if fr== "":
break
FILEr.close()
fw= open(_choiceFILE, "a+").write(cryptik)

#¿guardara la data? ¿si/no?
if chDATA.lower()== 's' and chDATA.upper()=='S':
fr__DATA= open("MD5__data.txt", "w")
fr__DATA.write("\n")
fr__DATA.write("Cadena original: ")
fr__DATA.write(ENCODING)
fr__DATA.write("\n")
fr__DATA.write("Cadena cifrada: ")
fr__DATA.write(h.hexdigest())
#rompe ciclo
rang += 1


if choice==3:
print """
#Agregar strings vacios previene bugs y fallos
#el peso se agregara en Bytes
#ej: 1024b = 2kb
"""
hint= "Seleccione/Desplaze el archivo:"
addBytes= raw_input(hint)

print "\n"
print "#No agregar caracteres ni strings!"
_hint= "\nNumero de bytes?: "
NumBytes= int(raw_input(_hint))
rang= range(NumBytes)
rang= 1

while NumBytes >= rang :
fw= open(addBytes, "a+").write(".")
#1025 = 2kb
fr= open(addBytes, "r")
fb= fr.readlines()
lr= [fb]
print lr
rang += 1


if choice==4:
___hint= "Seleccione/Desplaze el archivo:"
ChRF= raw_input(___hint)
fr= open(ChRF, "r")
fb= fr.readlines()
lr= [fb]
print lr

if choice==5:
print """

programa y algoritmos:
     Creado por Baal.
     version: python 2.7
"""
if choice==6:
print """
sección en construccion...
"""
if choice==7:
# salir del programa
sys.exit()

if __name__ == "__main__":
main()


Debo mencionar que el modo complejo falla hay veces, y deja los archivos inutiles, es decir que no siempre sirve.. lo tal vez positivo es que trae una pequeña opción de iteracion, al estilo backtrack 5 (encoder: shikata ga nai)