Results 1 to 3 of 3

Thread: Updated Guide: How to make random MAC address at each boot

  1. #1

    Updated Guide: How to make random MAC address at each boot

    Hi Guys,

    Here is my method to make your MAC address random with each reboot

    1. Open terminal and navigate to Desktop:
    cd Desktop

    2. Use command to create new text file:
    touch macc.sh

    3. Edit it in gedit or leafpad and add the following text:

    !#/bin/bash
    ifconfig wlan0 down
    macchanger -r wlan0
    ifconfig wlan0 up
    service network-manager restart


    4. Save the file and call it macc.sh (or whatever you choose)

    5. Change permissions on it to make it executable:
    chmod +a macc.sh

    6. in the terminal, navigate to /root/.config/

    7. Add directory called auto start like this:
    mkdir autostart

    8. Now you should have path:
    /root/.config/autostart

    9. Now in terminal, type:
    leafpad /root/.config/autostart/myscript.desktop

    10. Paste the following:


    [Desktop Entry]
    Name=MyScript
    GenericName=A descriptive name
    Comment=Some description about your script
    Exec=/root/Desktop/macc.sh
    Terminal=true
    Type=Application
    X-GNOME-Autostart-enabled=true

    11. Now save file and test it by rebooting, issue the reboot command

    12. Check ifconfig and verify the mac has changed!

    For some reason, this only works for me if the file is my desktop, I don't know why.

    I am not sure how working with network manager will effect this if you are using the drop downs, but for boot, it randomizes my MAC everytime

    Enjoy

  2. #2
    Senior Member
    Join Date
    Jul 2013
    Posts
    790
    To bluedangerforyou

    This approach has been seen before and will only work as long as Network Manager(NM) does not attempt to connect to a network. If NM attempts to connect to a network thru the device, the mac address will either revert to the device mac or will be changed to the cloned mac address in the NM drop-down menu. MTeams suggest you read thru:

    https://forums.kali.org/showthread.p...ight=netmanmac

    The above thread will give you a general overview and one approach to keep your spoofed mac address constant.

    Next read

    https://forums.kali.org/showthread.p...t-each-boot-up

    Pay particular attention to comments by hon3yb33 and especially the entries into the NM configuration file required to keep NM from affecting mac addresses made by macchanger.

    Musket Teams
    Last edited by mmusket33; 2017-05-09 at 10:31 AM.

  3. #3
    Junior Member
    Join Date
    Jul 2017
    Posts
    2
    Use crontab do crontab -e and if you have VI press I on your keyboard and you should be able to edit the file and go all the way on the bottom and type this @reboot macchanger -r wlan0 if you are using nano same thing go all the way to the bottom and type the exact same command then ctrl o and ctrl x and then reboot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •