Skip to content

Instantly share code, notes, and snippets.

@vgmoose
Created June 17, 2014 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgmoose/57b1207629fa7515a06f to your computer and use it in GitHub Desktop.
Save vgmoose/57b1207629fa7515a06f to your computer and use it in GitHub Desktop.
spoof.pl
print(" Old:");
print(`ifconfig en0 | grep ether`);
$oldmac=sprintf(`ifconfig en0 | grep ether`);
do{
if (length($ARGV[$0])==17)
{$mac=$ARGV[$0]."\n";}
elsif (length($ARGV[$0])!=0)
{
print(" New: ether ".$ARGV[$0]."\n");
die();
}
else
{
$mac="";
for($x=0;$x<6;$x++){
$mlist[$x]=int(rand()*256);
}
$mac=(lc(sprintf("%02x:%02x:%02x:%02x:%02x:%02x\n", $mlist[0],$mlist[1],$mlist[2],$mlist[3],$mlist[4],$mlist[5],)));
}
print("Target: ether $mac");
chomp $mac;
print(`sudo ifconfig en0 ether $mac`);
print(" New:");
print(`ifconfig en0 | grep ether`);
$newmac=sprintf(`ifconfig en0 | grep ether`);
if ($oldmac ne $newmac)
{
print("Changes successful!\n");
}
else{
print("Change unsuccessful.\n");}
} while ($newmac eq $oldmac && length($ARGV[$0])==0);
1. download spoof.pl
2. sudo perl spoof.pl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment