Welcome back all, today I'm just gonna go ahead and continue with the MAC changer
Now, in this lecture I will actually use it and I will show you how to change your MAC address
this is primarily meant to be applied in real life circumstances and since these are only learning and training
videos, since this is for learning purposes and these are only training videos,
we're going to do it in the virtual machine, keep in mind that even though this is possible to do
from the Linux command line within the virtual machine it will effectively kill your internet connectivity
on the virtual machine, on real machines or bootable USBs it won't because how it is meant to be used
I will show you how you can also change a MAC address in virtual box without actually losing internet connectivity
Anyway, let just type in "macchanger -r eth0" which is
our interface, actually before that, let's type in
"ifconfig eth0" and we see the MAC address here, I've already changed it but let's revert it back..
let's just go ahead and continue, let's change it again, so let's type in "macchanger - r eth0"
Enter, so it says Permanent MAC, this is our original MAC address, this is the current MAC address which
I've changed it prior to the beggining of this tutorial, and this is the new MAC address
When it says New MAC address, yep, there we go, this is the one that shall be used
So new MAC address is the one that will be used, permanent MAC address is the original one
and the current one, the one that is currently being used is this one, but as soon as you have a new one
then this will be applied, let me show you, so "ifconfig eth0", and you can see that this one
this output and this output are completely the same, but as you can see I can type in
"ping google.com" and this is not going to work, If I type in "macchanger -p" to restore the permanent one
If I type in "ping google.com" you see that the internet connection does work
So you won't have this problem on the physical machine or with the bootable USB
There will be no difficulties there whatsoever but with a virtual machine is a little bit different
If you wish to change it in a virtual machine and if you're using virtual box, it fairly simple but I
as I already stated it makes little sense because the address is already fairly...
I mean, it's basically the MAC address of the virtual machine, who cares?
It's not like, It's a machine that you bought with your own money somewhere or something like that, it's the MAC
address of the virtual machine, so who cares? so just from a logical perspective it makes little sense
but let me show you in case you really want you
Ok, so go ahead and clear the screen and I can type in... So this one is 08:00:27:03:5a:75
feel free to memorize it, feel free not to memorize it.
You can remember the last set so it's 75 and let's see how that changes
So the very first thing we need to do is completely power off our machine,
power off the virtual machine that is. Just wait for it
And there we go, so let's right click on our virtual machine, go to settings, go into network
let's change it to bridge, go into Advanced, it doesn't need to be in bridge,
you can leave it in NAT if you wish, just so you know.
So promiscuous mode allowed all and down below I have a MAC address
and now let's go ahead and rotate it, let's change it to something else
So you see it's randomizing these bits here... yeah, you won't be able to change manufacturer from here
You'll just be able to randomize the device bits, so the manufacturer remains the same
but the device bits will change completely, but either way you are fairly anonymous anyway
but using a virtual machine so no worries there, just go ahead and click on Ok
Are you serious? Please?
I love it when it bugs out like this, it's something that I love the most
Ok, so once again, going to settings and go into network, I'm gonna go ahead and switch to bridge
go into Advanced, click on this green circle to change the MAC address, click on Ok
and then you can power the machine on and the MAC address will be changed
So you can't change the manufacturer but you can change the bits identify the machine
However as I said, it's just a virtual machine so no need to pretty much worry at all, it can be deleted any time you wish and you can create a new one
Anytime you wish, but on a real system and on a bootable USB this would make a lot of difference
So every time you're gonna use this in the real world this would make a lot of difference, but on a virtual machine
which you're using now, for learning purposes I'm just demonstrating it so you know how to do it
Ok so booting in, booting and booting and booting really slowly
I've always loved the speed of virtual machines, just close this and close this and open up our terminal
there is another thing that can be implemented and Linux allows for scheduling of tasks so you can
schedule a task, you run at boot time so you can have your MAC address changed every time you boot
your machine so if you type in "crontab -e" in Kali Linux 2.0 it's gonna ask you which editor would you
like to use. I've always liked to use VIM but I've noticed that people have had problems with to put it on udemy
because it can be quite a bit complicated but it is very powerful however for this purpose I'm gonna use
Nano as it is a lot simpler and easier to use and by far less powerful although for this purpose
we just need a basic editor to change a few things so there's no need to use a very powerful tool
in the first place.
So let's go ahead and, let's pick and option, number 1
And let's go down, so at the bottom you have "m h dom mon dow comand" so what are these options?
M stands for minutes, H stands for hours dom is day of the month, mon is just month and dw is day of the week
and the command that you wish to run, so in a physical or a USB device, you can run something like this
"@reboot" so you disregard these options completely and you just state "@reboot" and then you could
type in something like ''macchanger -r eth0''
you could also bring the interface down and change the MAC address if that doesn't work
so for example you have ''@reboot macchanger -r eth0'' this should work, if it does not
you can do the following
So we're somewhere on the file system, let's go into Documents and we can type in
''mkdir" I don't know, how should we name this file? "whatever.sh"
and then we're gonna type in ''nano whatever.sh''
No, wait, mkdir creates a directory, my sincere apologies for that
I'm just gonna go ahead and type in ''nano whatever.sh'' and then I'm gonna create a small script
for myself here /bin/bash and then you can type in a set of commands basically
exactly the same commands that you would use in the terminal so,
ifconfig eth0 down
Notice also that this is primarily used for wireless interfaces and I am using a wired interface
for these tests so, also you want generally change the MAC address on a wired interface
you would generally change it on a wireless interface, but the procedure is exactly the same
the only thing that differs is the name of the interface, so you don't need to copy this part
or anything like that, I'm just creating this script for demonstration purposes
of what you can do, so you can create entire sets of commands but you want to be executed
at boot time, you configure your system to tune your system the way you want it to be tuned
at boot time, so you wouldn't have to do it every time manually, so you could automate the tasks
type in back maccchanger -r eth0
and then ifconfig eth0 up
and you can also to ensure that it runs smoothly, you type in sleep 2, and we can do this
as well, sleep 2, sleep just puts the execution of... executes ifconfig then sleeps for 2 seconds
then executes the macchanger, then sleeps for 2 seconds and then it brings
the interface back up, this is just to ensure that everything runs smoothly
So Control + O to save, Enter, Control + X to exit, then we do ls, we see the script is there
and now we, we need to make it executable, so type in chmod +x whatever.sh
and then if we do ls again you will see that it's a different color, and you can see that
it is indeed an executable file, this x symbolizes that it is executable,
so the first three are for the user, the second three permissions are for the group
and then third three permissions are for everybody so the user can read, write and execute
the owner of the file is root, the group to which root belongs is called root as well
so the root group can read and execute but it cannot write
Yeah, but if you're root you can do pretty much anything, so if there's another user
Let's say... user called test, that is a member of the root group, he would be able to read,
and execute the file, so read and execute, but it wouldn't be able to write anything
to it, and the rwxr also can read and execute, so everybody else belongs to any other group
Anyway, I know the type perhaps lost you a little bit there, but no worries, this will
clear out the tutorial progresses, let's go ahead and type in crontab -e
Notice how I didn't get prompted for an editor this time, scroll down to the bottom
type in pwd to see that you're currently working in directory, so it's root and then Documents
feel free to copy this, so Control + Shift + C, and then let's go ahead and type in crontab -e once again
Scroll down to the bottom, type in @reboot /root/Documents (with Control + Shift + V) and then whatever.sh
so I haven't really tested this out in this machine but it should work without difficulties and you can
press Control + O to save, Enter to write and Control + X to exit
If I type in ifconfig I can see that the last set of the address is e7:43 let's test the script
to see if it actually works, "sleep is not functional", okay, no big deal, but you can see that
it works even without sleep quite well so the current MAC and the permanent MAC and the new MAC
you can see that it has indeed changed it, let me just reconfigure this a little bit
should've used a capital S just lower case S if I'm not mistaken, if it doesn't no big deal
There you go, you've noticed that the execution of this script was a bit slower because you had
sleep intervals of 2 seconds but indeed again it changes and it will change it every time it reboots
we can make sure of this by just typing in reboot
Running a bit short of time here but well, we should wrap the tutorial up fairly soon
You can put in anything you want in that script so it will, it should run every time that the machine
reboots which is very nice as I said, you can have a preconfigured machine in one single script
so you can change your DNS settings, you can connect to a VPN, you can do whatever
it is that you want to do and put it in one script that will run every time that you boot
so everything will be like 2 seconds instead if you go in manually from here to there
configuring that, ect.
Booting, give me the terminal, zoom, and let's type in macchanger -s eth0
and there we go, so it says that the current MAC is this one and the permanent MAC
is this one so indeed has changed it at reboot
Anyway, I thank you for watching, this will conclude the Macchanger Section
I hope that you have enjoyed it and I bid you all farewell.