You are not logged in.

#1 2009-01-11 14:57:26

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Any ways to change the MAC address permanently?

Are there?:)


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#2 2009-01-11 15:02:11

theringmaster
Member
From: Air Force
Registered: 2007-07-16
Posts: 581
Website

Re: Any ways to change the MAC address permanently?

get a new computer, because the mac address is built into hardware. It identifies the hardware you could say.


Check me out on twitter!!! twitter.com/The_Ringmaster

Offline

#3 2009-01-11 15:17:47

Anamn3sis
Member
Registered: 2008-12-30
Posts: 12

Re: Any ways to change the MAC address permanently?

macchanger can spoof the mac, you could write a shell script the executes at bootup to change the MAC.

Offline

#4 2009-01-11 16:22:40

dw
Member
From: Vienna, Austria
Registered: 2006-11-25
Posts: 160

Re: Any ways to change the MAC address permanently?

hi, i have a file called change_mac with the following content in /etc/rc.d and start in on boot by placing change_mac in the daemons-array in rc.conf. you just need to adjust XX:XX:XX:XX:XX:XX by the mac-address you want to have and change the device of course. this script basically just calls macchanger als already suggested.

#!/bin/bash

start()
{
    echo "Changing MAC ..."
    /usr/bin/macchanger --mac=XX:XX:XX:XX:XX:XX ethX
}

stop()
{
    echo "Macchanger stops"

}

case "$1" in
 start)
 start
 ;;
 stop)
 stop
 ;;
 *)
 echo "Use $0 [start] to change the MAC!"
 ;;
esac
exit 0

hope this helps,
bernhard

Last edited by dw (2009-01-11 16:23:12)

Offline

#5 2009-01-11 17:21:33

initbox
Member
Registered: 2008-09-27
Posts: 172

Re: Any ways to change the MAC address permanently?

ifconfig eth0 hw ether 00:01:02:03:04:05

I guess it won't be permanent

Offline

#6 2009-01-11 23:25:10

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Any ways to change the MAC address permanently?

initbox wrote:
ifconfig eth0 hw ether 00:01:02:03:04:05

I guess it won't be permanent

But if it is stared on system startup, what doesn't make it permanent ? wink


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#7 2009-01-11 23:40:09

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Any ways to change the MAC address permanently?

initbox wrote:
ifconfig eth0 hw ether 00:01:02:03:04:05

Is there any way for another computer to get the real mac address or determine that this is fake once this has been set?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#8 2009-01-12 01:11:48

RedShift
Member
From: Belgium
Registered: 2004-07-16
Posts: 230

Re: Any ways to change the MAC address permanently?

Xyne wrote:
initbox wrote:
ifconfig eth0 hw ether 00:01:02:03:04:05

Is there any way for another computer to get the real mac address or determine that this is fake once this has been set?

No.


:?

Offline

#9 2009-01-12 01:28:49

xaiviax
Member
From: Michigan
Registered: 2008-11-04
Posts: 282

Re: Any ways to change the MAC address permanently?

Xyne wrote:
initbox wrote:
ifconfig eth0 hw ether 00:01:02:03:04:05

Is there any way for another computer to get the real mac address or determine that this is fake once this has been set?

No, mac address's were not developed for security purposes.  However, for the truly paranoid, all major manufacturers follow their own numbering system, so it could be determined that a made up mac address was not a "real" one.

Offline

#10 2009-01-12 01:38:47

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Any ways to change the MAC address permanently?

I tried to find it by searching, but failed... how can I reset the true mac address without rebooting (or just get the true mac address)?

*edit*

xaiviax wrote:

No, mac address's were not developed for security purposes.  However, for the truly paranoid, all major manufacturers follow their own numbering system, so it could be determined that a made up mac address was not a "real" one.

That wasn't a completely paranoid question. I also immediately thought of using nmap to get mac addresses in order to bypass mac filters on networks (I always though spoofing mac addresses was harder than this).

Btw, do  you know a way to hide the network card vendor?


*edit 2*
What's the best way to change the mac address at boot before the network goes up on Arch? A line in /etc/rc.local?

Last edited by Xyne (2009-01-12 01:53:04)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#11 2009-01-12 02:36:46

xaiviax
Member
From: Michigan
Registered: 2008-11-04
Posts: 282

Re: Any ways to change the MAC address permanently?

Xyne wrote:

how can I reset the true mac address without rebooting (or just get the true mac address)?

ifconfig gives the mac address (hardware address).  Once changed, I don't know of a way to see what it was.

Xyne wrote:

Btw, do  you know a way to hide the network card vendor?

http://www.erg.abdn.ac.uk/users/gorry/c … codes.html

Offline

#12 2009-01-12 02:44:43

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Any ways to change the MAC address permanently?

Thanks for the replies, xaiviax.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#13 2009-01-12 02:53:23

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Re: Any ways to change the MAC address permanently?

Wow! This has evolved since my last post...

I do change my MAC address with this command:

ifconfig wlan0 down hw ether  xx:xx:xx:xx:xx:xx 
ifconfig wlan0 up

Just the same as what has posted...This temporarily changes my MAC and resets to default after reboot...But I can just enter my default MAC again without the needs of restarting and its fine...


I have macchanger and kismet...I'm confused what to use on the "source:" part of my "kismet.conf"...I'm using an atheros b/g...I need some help...:)


Thanks...

Last edited by kaola_linux (2009-01-12 02:57:13)


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#14 2009-01-12 03:23:10

xaiviax
Member
From: Michigan
Registered: 2008-11-04
Posts: 282

Re: Any ways to change the MAC address permanently?

kaola_linux wrote:

I have macchanger and kismet...I'm confused what to use on the "source:" part of my "kismet.conf"...I'm using an atheros b/g...I need some help...:)
Thanks...

I use : source=iwl3945,wlan0,wlan0       so substitute accordingly to your system

Offline

#15 2009-01-12 03:26:29

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Re: Any ways to change the MAC address permanently?

Here is what I got by issuing lspci on my wireless device:

03:00.0 Ethernet controller: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01)

How do I determine it?:)


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#16 2009-01-12 03:32:28

archlinuxsagi
Member
Registered: 2008-09-12
Posts: 259

Re: Any ways to change the MAC address permanently?

kaola_linux wrote:

How do I determine it?:)

ifconfig | grep HWaddr

To know your mac address change..

Offline

#17 2009-01-12 03:45:08

kaola_linux
Member
From: Bacolod City/Philippines
Registered: 2008-09-23
Posts: 513

Re: Any ways to change the MAC address permanently?

No, I mean to determine on what should be used on the "source:" part of "kismet.conf" smile But thanks that's informative...:)

Last edited by kaola_linux (2009-01-12 03:51:56)


Netbook (Acer Aspire One 110 || 160gb SATA HD || 1.5gb ram): archlinux i686 / KDEmod 4.3
Registered Linux User # 481212 / Machine Registration # 390468
"In a world without walls and fences, who needs windows and gates?"

Offline

#18 2009-01-12 04:02:53

archlinuxsagi
Member
Registered: 2008-09-12
Posts: 259

Re: Any ways to change the MAC address permanently?

You can also use the following

sudo macchanger -A wlan0

basically you can see macchanger options
through

macchanger --help

Offline

#19 2009-01-12 05:22:54

xaiviax
Member
From: Michigan
Registered: 2008-11-04
Posts: 282

Re: Any ways to change the MAC address permanently?

kaola_linux wrote:

No, I mean to determine on what should be used on the "source:" part of "kismet.conf" smile But thanks that's informative...:)

lsmod

Offline

#20 2009-01-12 18:04:09

RedShift
Member
From: Belgium
Registered: 2004-07-16
Posts: 230

Re: Any ways to change the MAC address permanently?

Xyne wrote:

I tried to find it by searching, but failed... how can I reset the true mac address without rebooting (or just get the true mac address)?

*edit*

xaiviax wrote:

No, mac address's were not developed for security purposes.  However, for the truly paranoid, all major manufacturers follow their own numbering system, so it could be determined that a made up mac address was not a "real" one.

That wasn't a completely paranoid question. I also immediately thought of using nmap to get mac addresses in order to bypass mac filters on networks (I always though spoofing mac addresses was harder than this).

Btw, do  you know a way to hide the network card vendor?


*edit 2*
What's the best way to change the mac address at boot before the network goes up on Arch? A line in /etc/rc.local?

Do something like:

eth0mac="eth0 hw ether 00:01:02:03..."
eth0="eth0 192.168.0.1 netmask 255.255.255.0"
INTERFACES=(eth0mac eth0)


:?

Offline

#21 2009-01-12 18:18:25

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Any ways to change the MAC address permanently?

I've rebooted and my "fake" mac address is still listed by ifconfig. I don't remember changing any files and grepping for the new address in /etc/* and ~/* yields nothing.

I'll try setting it to something else and see what happens.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#22 2009-01-13 08:14:11

cylonmath
Member
Registered: 2009-01-09
Posts: 2

Re: Any ways to change the MAC address permanently?

There is no macchanger package in AUR right
The current macchanger cant be compiled as makepkg -s  as it doesnt have a PKGBuilt file inside that tarball...

Offline

#23 2009-01-13 08:19:49

RedShift
Member
From: Belgium
Registered: 2004-07-16
Posts: 230

Re: Any ways to change the MAC address permanently?

cylonmath wrote:

There is no macchanger package in AUR right
The current macchanger cant be compiled as makepkg -s  as it doesnt have a PKGBuilt file inside that tarball...

Why would you need that macchanger script anyway? It's just a wrapper for a single ifconfig command, and you can perfectly change an interface's NIC via rc.conf.


:?

Offline

#24 2009-01-14 02:15:09

kludge
Member
Registered: 2008-08-03
Posts: 294

Re: Any ways to change the MAC address permanently?

when i was still using netcfg2, i was doing the following to get a randomized, manufacturer-valid mac address every time i connected an access point:

in each network profile:

PRE_UP='. $SUBR_DIR/spoof.subr; ifconfig $INTERFACE down; ifconfig $INTERFACE hw ether $(generate_random_mac)'

the 'ifconfig $INTERFACE down' is necessary for my card, annoying belkin-made rtl8185 pcmcia card.

/usr/lib/network/spoof.subr:

#!/bin/bash

SPOOF_DIR=$SUBR_DIR"spoof/"
SPOOF_VEND_FILE="stefan-maclist.txt"

generate_random_mac() {

        echo $(${SPOOF_DIR}/fakeap.pl --vendors ${SPOOF_DIR}${SPOOF_VEND_FILE})

}

the following is extracted from Black Alchemy Weapons Lab's fakeap.pl

/usr/lib/network/spoof.pl

#!/usr/bin/perl

use strict;
use warnings;
use Getopt::Long;
use Time::HiRes;

use vars
  qw( $vendors_opt $wep_opt );

my @vendors = ( "00:00:0C:", "00:00:CE:", "00:00:EF:" );

# load_vendors
#
# args: none
# rets: none
# 
# Loads vendor mac prefix file into @vendors

sub load_vendors {
    @vendors = ();
    open( my $FH, "<$vendors_opt" ) or die "Could not open $vendors_opt: $!\n";
    while ( my $line = <$FH> ) {
        chomp $line;
        $line =~ /^(\w\w:\w\w:\w\w)/;
        push @vendors, "$1:";
    }
    close $FH;

    return;
}

# gen_mac
# 
# args: none
# rets: none
#
# Returns a random MAC address with first three octets from @vendors
# last three random.

sub gen_mac {

    return sprintf(
        "%s%02X:%02X:%02X",
        $vendors[ int( rand $#vendors ) ],
        int( rand 256 ),
        int( rand 256 ),
        int( rand 256 )
    );

}

################################################################
# 
# Main
# 

GetOptions(
    "vendors=s"   => \$vendors_opt
);

load_vendors() if $vendors_opt;

my $mac = gen_mac();

print( $mac );

i know of two sources for a list of valid manufacturer mac address triples.  stefan-maclist.txt comes with fakeap.pl.  a much more comprehensive list is the file 'manuf' in the root directory of the wireshark source, but it needs some editing before it will work with the fakeap.pl code snippet.

one thing this doesn't do is avoid using your actual mac address.

Last edited by kludge (2009-01-14 02:16:54)


[23:00:16]    dr_kludge | i want to invent an olfactory human-computer interface, integrate it into the web standards, then produce my own forked browser.
[23:00:32]    dr_kludge | can you guess what i'd call it?
[23:01:16]    dr_kludge | nosilla.
[23:01:32]    dr_kludge | i really should be going to bed.  i'm giggling madly about that.

Offline

#25 2009-01-15 23:28:25

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: Any ways to change the MAC address permanently?

Just started to use this script, simple and ?effective?.

#!/bin/bash

MAC=`dd if=/dev/urandom bs=3 count=1 status=noxfer 2>/dev/null | od -t x1 | sed -e "s/^0* //;s/ /:/g;q"`

ifconfig wlan0 down hw ether 00:13:$MAC
ifconfig wlan0 up

00:13 is ?vendor? ID, I think. And I cant change that.

I'm trying to exec this at startup... tried xinitrc, it wont work, X cant start.
Anyone got idea?

P.S.
ifconfig says that MAC has changed, but look at this.

MAC (00:13:E8:D3:B6:93)

This is the output from aireplay-ng.
That what it says is old MAC.
Why ifconfig and aireplay-ng have diffirent outputs? Should not aireplay also read faked MAC?

Last edited by ammon (2009-01-16 01:39:02)

Offline

Board footer

Powered by FluxBB