Macxchange Script to Change MAC and Hostname in Backtrack.

When conducting a pentest, the first thing the pentester should do is to change its computer mac address and hostname because they are recorded in the logs and dhcp server. Macxchange is a very simple script. It is meant to work with backtrack or any other linux distro. It selects a random word from john the ripper wordlist for hostname, and for the mac address uses macchanger. Once your mac and hostname have been changed remember to restart networking or get an ip “dhclient <interface> “. So if you’re using other distro than backtrack, make sure to have macchanger installed, and edit the proper varialbe for wordlist. You can also download script from here

#author: Jorge L. Vazquez
#purpose: this script will change the mac address to random
#and will pick a random word from password.lst in jtr for hostname
#change variables "interface" and "file" to your settings
#also macchanger needs to be installed
WORD=$(sort -R $FILE | head -1)
#changing mac address to random
ifconfig $INTERFACE down > /dev/null
if [ $? == 0 ]; then
	printf "%s\nChanging mac address...\n"
	macchanger -r $INTERFACE
	printf "%sScript encounter an error, sorry...\n"
	exit 1
#changing hostname to random word from password.lst
printf "%s\nChanging Hostname...\n"
hostname $WORD
if [ $? == 0 ]; then
	printf "%sPrevius Hostname: $OLDHOST \n"
	printf "%sRandom Hostname: $WORD \n"
	printf "%sScript encounter an error, sorry...\n"
	exit 1
#putting interface up
ifconfig $INTERFACE up > /dev/null
printf "\n"
Share This!

Add a Comment

Your email address will not be published.

Sign up for our Newsletter

Download "Google Search Pro"

Enter your email and stay on top of things,