Jump to content

changing mac address wlan1


b0N3z
 Share

Recommended Posts

Ive tried to change the mac address of wlan1 but after it gets put in monitor mode it reverts back to the default 00-13-37-xx-xx-xx.  Is there a way to change this or should I just move on?

Link to comment
Share on other sites

On 7/4/2018 at 1:42 PM, b0N3z said:

 Is there a way to change this or should I just move on?

yep - although i thought this happened using the GUI macchanger but it seems i was wrong or it changed. EDIT - it was possible on FW 2.0.2

airmon-ng start wlan1
ifconfig wlan1mon down
macchanger wlan1mon -r
ifconfig wlan1mon up

 

Edited by Just_a_User
Link to comment
Share on other sites

8 minutes ago, Just_a_User said:

yep - although i thought this happened using the GUI macchanger but it seems i was wrong or it changed.


airmon-ng start wlan1
ifconfig wlan1mon down
macchanger wlan1mon -r
ifconfig wlan1mon up

 

you can change it with the GUI but the format for wlan1mon is different than wlan1.  for example wlan1 is 00:13:37:xx:xx:xx and once put in monitor mode it changes to 

00-13-37-xx-xx-xx-00-44-00-00-00-00-00-00-00-00

I can change wlan1 in the gui no biggie but once set in monitor mode it reverts back to the above.  I dont know if its something that I should just blow off or not?  Ive been changing all the mac address to 00:20:91:xx:xx:xx if you know the prefix of who that is, if not give it a look.  I already changed wlan0 via GUI and it stays persistant after a reboot,  I added eth0 but had to set that up via /etc/rc.local

Link to comment
Share on other sites

3 minutes ago, b0N3z said:

Ive been changing all the mac address to 00:20:91:xx:xx:xx if you know the prefix of who that is, if not give it a look.

Nice, I didn't know about that haha.

The reason you're seeing the original MAC address come back is because it is pulled from a system script whenever an interface comes up or goes down.

  • Like 1
Link to comment
Share on other sites

1 minute ago, b0N3z said:

you can change it with the GUI but the format for wlan1mon is different than wlan1.  for example wlan1 is 00:13:37:xx:xx:xx and once put in monitor mode it changes to 

Yeah i know, thats what i thought used to happen when macchanging an interface in monotor mode (e.g. wlan1moon) from the GUI. I thought it used to change the first half of the mac string.

Anyway the method i put above allows you to do that manually so you can use a monitor interface with a changed mac. But your right if you currently try to change a monitor interface now it resets the first half of the mac string to the hardware mac.

Link to comment
Share on other sites

4 minutes ago, Foxtrot said:
9 minutes ago, b0N3z said:

Ive been changing all the mac address to 00:20:91:xx:xx:xx if you know the prefix of who that is, if not give it a look.

 

thats very cool ?

  • Like 1
Link to comment
Share on other sites

It's an OpenWRT script that is editable, but I forgot the path for it and I'm not at the computer right now.

In any case; I wouldn't recommend editing the script, but instead would recommend just spoofing the MAC of the monitor interface once it comes up.

  • Like 1
  • Upvote 1
Link to comment
Share on other sites

2 minutes ago, Foxtrot said:

In any case; I wouldn't recommend editing the script, but instead would recommend just spoofing the MAC of the monitor interface once it comes up.

Haven't you got to do it when interface is down?

[ERROR] Could not change MAC: interface up or insufficient permissions: Device or resource busy

 

Link to comment
Share on other sites

OK thats what i thought and suggested bar the random or fixed mac part. cool.

Could that not be built into the GUI mac changer script for monitor interfaces? @Foxtrot  FW 2.0.2 changes monitor macs without reverting to hardware mac so looks like we have lost that functionality on latest firmware.

 

Heh that mac made me look further you also have  - 00-1C-3F

Edited by Just_a_User
Link to comment
Share on other sites

On 7/4/2018 at 9:07 AM, Just_a_User said:

Heh that mac made me look further you also have  - 00-1C-3F

That's awesome.  I'm definitely going to use that one for the nano lol

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

This might work : -

#!/bin/bash
# Cobbled together by Just_a_User
# Awful script to set monitor mode and change its MAC
# Forces first 3 Hex sets and randomises the last 3
# 00:1C:3F = In-ter-pol
# 00:20:91 = NoSuchAgency

iface=wlan1             #select interface here
ifacemon=$iface"mon"
hexchars="0123456789ABCDEF"
end=$( for i in {1..6} ; do echo -n ${hexchars:$(( $RANDOM % 16 )):1} ; done | sed -e 's/\(..\)/:\1/g' )
genmac=00:1C:3f$end     #enter first 3x hex set here


airmon-ng stop $ifacemon
airmon-ng start $iface
ifconfig $ifacemon down
macchanger -m $genmac $ifacemon
ifconfig $ifacemon up
clear
echo "mac change completed"

 

Edited by Just_a_User
  • Like 1
  • Upvote 1
Link to comment
Share on other sites

this is great!  I also editted the rc.local to change the mac of eth0 on boot so that it also changes and shows the same first 3 hex as all the wifi interfaces.  After this I got distracted with some other things and never did come back to it.  Ill to give this a try later tonight!

Link to comment
Share on other sites

@Just_a_User this script did not work.  I don't quite know why yet but im goin to dig into it a bit.   I hard coded a couple things and it worked just fine.

 

Edit: not the greatest at creating scripts but if we could get the last 3 hex of the users wlan1 mac and use that vs randomizing, I think it would work better.  

Edited by b0N3z
Link to comment
Share on other sites

#!/bin/bash
# Cobbled together by Just_a_User
# Heavily edited and hardcoded by b0n3z
# Version 1.1


# 00:1C:3F = In-ter-pol
# 00:20:91 = NoSuchAgency

end=:XX:XX:XX           #keep the colon at the beginning and choose your last
						 3 hex
genmac=00:20:91$end     #enter first 3x hex set here


ifconfig wlan1mon down
sleep 1
macchanger -m $genmac wlan1mon
sleep 1
ifconfig wlan1mon up
sleep 1
clear
read MAC </sys/class/net/wlan1mon/address
echo "wlan1mon $MAC"
echo "mac change completed"

Got this to work, had some errors with the randomizer and then iface"mon"  in the original script.  Hard coded wlan1mon and the mac itself.  would cool to find the last 3 hex of the tetras original mac and use that for $end but im not really looking that hard to figure it out.

Link to comment
Share on other sites

8 hours ago, b0N3z said:

this script did not work.

Strange, i just copy paste it into a quick test.sh and it works for me on my tetra. I did remove the guts of it from another script of mine but all seems fine - for me at least.

The random part on its own to test would be

#!/bin/bash
hexchars="0123456789ABCDEF"
end=$( for i in {1..6} ; do echo -n ${hexchars:$(( $RANDOM % 16 )):1} ; done | sed -e 's/\(..\)/:\1/g' )
echo $end

The ifacemon also works for me, so double weird ?   as a quick test try

Selection_010.png

One way to grab your last 3 hex sets from an interface could be using: -

#!/bin/bash
iface=wlan1mon
cat /sys/class/net/$iface/address | cut -c 9-17

Hope that helps, I am also terrible at bash but its fun to try?

Edited by Just_a_User
  • Like 1
Link to comment
Share on other sites

Ill give it another try later.   Stackoverflow is my friend sometimes lol

Edited by b0N3z
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...