elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
29 Mayo 2012, 05:14  


Tema destacado: ¡Aprende hacking con práctica! - WarZone, el wargame de elhacker.net

+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting (Moderadores: Novlucker, Leo Gutiérrez., EleKtro H@cker)
| | |-+  [Python] FTP Manager
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Python] FTP Manager  (Leído 109 veces)
Doddy

Desconectado Desconectado

Mensajes: 220



Ver Perfil
[Python] FTP Manager
« en: 7 Octubre 2011, 01:34 »

Hola

Aca traigo un simple cliente FTP

Código
#!usr/bin/python
#FTP Manager 0.2 (C) Doddy Hackman 20111
 
from ftplib import FTP
import sys
 
 
def head():
print "\n -- == FTP Manger == --\n\n"
 
def copyright():
print "\n\n(C) Doddy Hackman 2011\n"
sys.exit(1)
 
def show():
print "\nSintax : "+sys.argv[0]+" <host> <user> <pass>\n"
 
def menu():
print "\n"
print "1 : dir"
print "2 : cwd"
print "3 : chdir"
print "4 : delete dir"
print "5 : delete file"
print "6 : rename file"
print "7 : make directory"
print "8 : size"
print "9 : abort\n\n"
op = input("[Option] : ")
return op
 
 
def enter(host,user,password):
print "[+] Connecting to ",host,"\n"
enter = FTP(host,user,password)
print "\n[+] Enter in the system\n"
 
def menu2():
 op = menu()
 if op == 1:
  try:
   lista = enter.dir()
   for a in lista:
    print a
   menu2()
  except:
   menu2()
 elif op == 2:
  try:
   print "\n\n[+] Path : "+enter.pwd()+"\n\n"
   menu2()
  except:
   menu2()
 elif op == 3:
  try:
   dir = raw_input("\n\n[Directory] : ")
   enter.cwd(dir)
   print "\n\n[+] Directory Changed\n\n"
   menu2()
  except:
   menu2()
 elif op == 4:
  try:
   dir = raw_input("\n\n[Directory] : ")
   enter.rmd(dir)
   print "\n\n[+] Directory Deleted\n\n"
   menu2()
  except:
   menu2()
 elif op == 5:
  try:
   file = raw_input("\n\n[File] : ")
   enter.delete(file)
   print "\n\n[+] File Deleted\n\n"
   menu2()
  except:
   menu2()
 elif op == 6:
  try:
   oldfile = raw_input("\n\n[Name] : ")
   newfile = raw_input("\n[New Name] : ")
   enter.rename(oldfile,newfile)
   print "\n\n[+] Name Changed\n\n"
   menu2()
  except:
   menu2()
 elif op == 7:
  try:
   dir = raw_input("\n\n[New Directory] : ")
   enter.mkd(dir)
   print "\n\n[+] Directory Created\n\n"
   menu2()
  except:
   menu2()
 elif op == 8:
  try:
   file = raw_input("\n\n[File] : ")
   peso = enter.size(file)
   print "\n\n[+] ",peso," KB \n\n"
   menu2()
  except:
   menu2()
 elif op == 9:
  enter.quit()
  copyright()
 
 else:
  menu2()      
menu2()
 
 
 
head()
 
if len(sys.argv) != 4:
show()
else:
enter(sys.argv[1],sys.argv[2],sys.argv[3])
 
copyright()
 


« Última modificación: 8 Octubre 2011, 19:05 por Doddy » En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
(Python)Existen ventanas de entrada y salida de datos en python
Scripting
tonilogar 11 4,346 Último mensaje 29 Noviembre 2009, 00:49
por tonilogar
[Python] Abrir una página web con comandos de Python. « 1 2 »
Scripting
CaronteGold 28 8,120 Último mensaje 7 Enero 2010, 17:04
por ^Tifa^
[python]VideoTraining Aprende A Programar En Python desde 0 « 1 2 »
Scripting
juh 22 5,571 Último mensaje 16 Octubre 2010, 13:12
por sheevalum
[Python] Importar Funciones de C++ a Modulo de Python
Scripting
Di6it4Lj4ck4L 2 898 Último mensaje 2 Mayo 2011, 19:08
por Di6it4Lj4ck4L
[Python] Kaley, Keylogger simple en Python
Scripting
Fyrox 0 1,071 Último mensaje 21 Septiembre 2011, 23:24
por Fyrox
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines