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

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: [1]
1  Programación / Scripting / necesito ayuda con un problema en python soy nuevo en esto en: 9 Noviembre 2021, 22:36 pm
Código
  1. import subprocess
  2. import optparse
  3.  
  4. parser = optparse.OptionParser()
  5.  
  6. parser.add_option("-i", "--interface", dest = "interface", help="Interface para cambiar Direccion MAC")
  7. parser.add_option("-m", "--mac", dest = "new_mac", help="Nueva Direccion MAC")
  8.  
  9.  
  10. (options, arguments) = parser.parse_args()
  11.  
  12. interface = options.interface
  13. new_mac = options.new_mac
  14.  
  15. print("Cambiando Direccion Mac para " + interface + " a " + new_mac)
  16.  
  17. subprocess.call(["sudo ifconfig", interface, "down"])
  18. subprocess.call(["sudo ifconfig", interface, "hw", "ether", new_mac])
  19. subprocess.call(["sudo ifconfig", interface, "up"])
  20.  

┌──(kali㉿kali)-[~]
└─$ /usr/bin/python /home/kali/Documents/mac-changer.py                                                                                                                                          1 ⨯
Traceback (most recent call last):
  File "/home/kali/Documents/mac-changer.py", line 15, in <module>
    print("Cambiando Direccion Mac para " + interface + " a " + new_mac)
TypeError: cannot concatenate 'str' and 'NoneType' objects

MOD: Etiqueta GeSHi
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines