Created
June 17, 2014 12:03
-
-
Save vgmoose/57b1207629fa7515a06f to your computer and use it in GitHub Desktop.
spoof.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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