19-07-2020, 20:51
Jeg har skrevet en simple MAC changer, her er koden:
Håber den kan bruges ;)
PS: DNS spoofer kommer snart.
Kode:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import subprocess
import optparse
import re
def g_args():
p = optparse.OptionParser()
p.add_option("-i", "--iface", dest="i_face", help="Interface du vil ændre MAC adresse på")
p.add_option("-m", "--mac", dest="n_mac", help="Den nye MAC adresse")
(opt, args) = p.parse_args()
if not opt.i_face:
p.error("[-] Vær så venlig at specificere et interface, brug --help for mere info")
elif not opt.n_mac:
p.error("[-] Vær så venlig at specificere en ny mac adresse, brug --help for mere info")
return opt
def cha_mac(i_face, n_mac):
print("[+] Skifter MAC adresse for " + i_face + " til " + n_mac)
subprocess.call(["ifconfig", i_face, "down"])
subprocess.call(["ifconfig",i_face, "hw", "ether", n_mac])
subprocess.call(["ifconfig", i_face, "up"])
def g_c_mac(i_face):
iconf_res = subprocess.check_output(["ifconfig", i_face])
m_search_res = re.search(r"\w\w:\w\w:\w\w:\w\w:\w\w:\w\w", iconf_res)
if m_search_res:
return m_search_res.group(0)
else:
print("[-] Kunne ikke finde en mac adresse.")
opt = g_args()
c_mac = g_c_mac(opt.i_face)
print("Nuværrende mac adresse -> " + str(c_mac))
cha_mac(opt.i_face, opt.n_mac)
c_mac = g_c_mac(opt.i_face)
if c_mac == opt.n_mac:
print("[+] MAC adressen blev ændret til " + c_mac)
else:
print("[-] MAC adressen blev IKKE ændret.")
Håber den kan bruges ;)
PS: DNS spoofer kommer snart.