Modifier votre addresse MAC
Rédigé par BeHuman
Aucun commentaire
Classé dans : Shell/Bash, Hack

Voilà un petit pour changer votre addresse Mac à la volé. Ce script utilise macchanger
Utilisation:
$ sudo macedit eth0 xx:xx:xx:xx:d6:6e ----------------------------------------- Current MAC: xx:xx:xx:xx:c6:1e (GIGA-BYTE TECHNOLOGY CO.,LTD.) Permanent MAC: xx:xx:xx:xx:c6:1e (GIGA-BYTE TECHNOLOGY CO.,LTD.) New MAC: xx:xx:xx:xx:d6:6e (ZyXEL Communications Corporation) ----------------------------------------- eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:d6:6e inet adr:192.168.1.30 Bcast:192.168.1.255 Masque:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:136102 errors:0 dropped:0 overruns:0 frame:0 TX packets:71618 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 RX bytes:108035994 (103.0 MiB) TX bytes:8380184 (7.9 MiB) lo Link encap:Boucle locale inet adr:127.0.0.1 Masque:255.0.0.0 adr inet6: ::1/128 Scope:Hôte UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:174 errors:0 dropped:0 overruns:0 frame:0 TX packets:174 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:0 RX bytes:17108 (16.7 KiB) TX bytes:17108 (16.7 KiB)
Script:
#! /bin/bash if [[ "`whoami`" != 'root' ]]; then echo "restart with root permissions" exit 1 fi exist=`dpkg -l | grep macchanger` [[ $? -eq 1 ]] && apt-get install macchanger service network-manager stop service networking stop ifconfig $1 down echo "-----------------------------------------" macchanger --mac=$2 $1 echo "-----------------------------------------" ifconfig $1 up service networking start service network-manager start ifconfig exit 0++