View Single Post
Posts: 9 | Thanked: 1 time | Joined on Nov 2010
#10
Originally Posted by h4xx0r View Post
I wrote a little handy script that help me a lot when needing a new mac fast on my n900 (its just bash so it works on every linux dist that names their vlan interface wlan0):

Create a file in /usr/bin/ called macchanger, make it executable:
chmod +x /usr/bin/macchanger
edit /usr/bin/macchanger and insert this text:

#!/bin/bash
echo "they block my mac"
ifconfig wlan0 down
ole=`ifconfig wlan0|grep HWaddr|awk '{print $5}'`
one=`df |md5sum |awk '{print }'|grep -o ..`
two=`free |md5sum |grep -o ..`
thr=`ps auxww |md5sum |grep -o ..`
ifconfig wlan0 hw ether 00:1FF:`echo $one`:`echo $two`:`echo $thr`
new=`ifconfig wlan0|grep HWaddr|awk '{print $5}'`
ifconfig wlan0 up
echo $ole "->" $new
echo "i fist their fish"

Reason i am using 3 strings md5sumed is to get decent randomization as this is hard to accomplish in bash
After installing enhanced bash package, these lines don't work anymore:
Code:
one=`df |md5sum |awk '{print }'|grep -o ..`
two=`free |md5sum |grep -o ..`
thr=`ps auxww |md5sum |grep -o ..`
It (the ifconfig) stops at $one, resulting in truncated addreas (only 4 out of 6, ie 00:1FF:xx). Tried changing to:
Code:
one=`df |md5sum |awk '{print }'|head -c 2`
two=`free |md5sum |head -c 2`
thr=`ps auxww |md5sum |head -c 2`
Now it works again

Last edited by anagarika; 2012-01-04 at 13:52.