MAC Address Random

Bueno e aqui un sencillo codogp en C para generar MAC Address Random:

macRandom.c
Código
#include<stdio.h>
 
int main()      {
       unsigned long mac[2];
       register unsigned char *t =(char*) &mac;
       srandomdev();
       mac[0] = random();
       mac[1] = random();
       printf("%x:%x:%x:%x:%x:%x\n",t[0],t[1],t[2],t[3],t[4],t[5]);
       return 0;
}
 

Después de compilarlo y ejecutarlo:

Código
Anon@localhost# gcc -o macRandom macRandom.c
Anon@localhost# ./macRandom
86:1e:cc:23:d4:6
 

Vemos la salida de las direcciones mac Aleatorias con las cuales podemos configurar nuestra interfaz de red para que cada vez que nos conectemos tengamos una dirección "Física" Diferente.

En mi caso con FreeBSD se realiza así:

Citar
Anon@localhost# ifconfig wpi0 ether `./macRandom `

Donde wpi0 se cambia por la interfaz que sea de tu sistema, y el resultado:

Código
Anon@localhost# ifconfig wpi0
wpi0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 34:5d:e8:74:e9:41
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ssid "" channel 1 (2412 Mhz 11b)
authmode OPEN privacy OFF txpower 50 bmiss 7 scanvalid 60 bintval 0
Anon@localhost# ifconfig wpi0 ether `./macRandom `
Anon@localhost# ifconfig wpi0
wpi0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 4c:1e:0f:5e:a6:c2
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
status: no carrier
ssid "" channel 1 (2412 Mhz 11b)
authmode OPEN privacy OFF txpower 50 bmiss 7 scanvalid 60 bintval 0
 
 

Mirar que cambio la Dirección "Física".

Saludos.

--
- Anon

Comentarios

Entradas populares de este blog

Clave WPA2 por Defecto de equipos TotalPlay (Huawei HG8245H)

Cable modem Ubee - WPA2 y WPS por defecto