Código (python) [Seleccionar]
import subprocess
import optparse
parser = optparse.OptionParser()
parser.add_option("-i", "--interface", dest = "interface", help="Interface para cambiar Direccion MAC")
parser.add_option("-m", "--mac", dest = "new_mac", help="Nueva Direccion MAC")
(options, arguments) = parser.parse_args()
interface = options.interface
new_mac = options.new_mac
print("Cambiando Direccion Mac para " + interface + " a " + new_mac)
subprocess.call(["sudo ifconfig", interface, "down"])
subprocess.call(["sudo ifconfig", interface, "hw", "ether", new_mac])
subprocess.call(["sudo ifconfig", interface, "up"])
┌──(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