[HomePass][Linux] Rudimentary Mac Cycler for Linux

Discussion in '3DS - Tutorials' started by Mr.Leb, Dec 6, 2013.

  1. Mr.Leb
    OP

    Mr.Leb Advanced Member

    Newcomer
    65
    3
    Jul 19, 2008
    United States
    (Disclaimer: I don't code, so much as I just hack around with random Internet searches. At this point in time, scripted input and random number generation is beyond anything that I am capable of and/or willing to spend the time to do for this script. So for now, this script is sequential.)
    What is this?
    I have modified somebunny's script to include the 161 extended prime MAC addresses from the spreadsheet. It functions just as before, except you can call spoof1 all the way through spoof161. I have also put together an extremely simple script to automate MAC shifting.

    Requirements:
    -A working HomePass system that uses somebunny's script. I am not here to help you set up your network; dicamarques already has a perfectly good guide for that.
    -An understanding of how to use the Find and Replace function of a text editor. (Or a willingness to follow directions.)


    Step 1: If you haven't already done so, follow the tutorial for a Linux machine on this guide: http://gbatemp.net/threads/how-to-have-a-homemade-streetpass-relay.352645/
    Once you have successfully gotten a streetpass with this guide, you should be able to use the modifications that I have made to it.

    Step 2: Download this zip file that contains the modified version of somebunny's script and the mac cycling script. (Attached to this post)

    Step 3: Extract the two scripts to your home folder.

    Step 4: The automation script is really, really simple, but it saves quite a bit of typing. This means it's time to fire up the text editor. Open mac_cycle_script with your text editor of choice (gedit, leafpad, mousepad, etc.).

    Step 5: Find your text editor's "Find and Replace" feature. In most cases, it can be opened by pressing Control+H on your keyboard, otherwise, just look around in the menus until you find it.

    Step 6: Set your wlan number. In the "Find What" field, type "wlanY" (without quotes). In the "Replace with" field, type the interface name that you'll be using as your access point (on my machine, it's wlan4). Make sure that the checkbox labeled "replace all" or "replace all at once" is checked. Then mash go; find and replace those entries.

    Step 7: Set your internet interface. In the "Find What" field, type "INTERNET_INTERFACE" (without quotes). In the "Replace with" field, type the name of your internet interface. (E.g. lan0, wlan0, etc, etc. If you have already gotten this working without my mods, you should know what to put here.) Again, be sure to check the "replace all" box, then hit enter, click find and replace, or what have you.

    Step 8: Set your cycling interval. In the "Find What" field, type "200" (without quotes). The "Replace with" field is up to you. Just input the number of seconds you want to wait before cycling (good numbers include 900 (15 minutes) and 3600 (1 hour). After that, check your checkbox and go.
    The "sleep 200" command instructs the shell to wait 200 seconds before changing MACs. If you leave the interval at 200, you should get back around to the 1st MAC address in roughly nine hours, so you could theoretically just let this thing go on indefinitely while trying to, say, rack up pokemiles. This isn't practical if you actually want to be connected to the Internet with your DS, because you'll get kicked off every 3 minutes or so.

    Step 9: Save the script.

    Step 10: Fire up the terminal and enter these two commands:
    sudo chmod +x ./home_zone_161
    sudo chmod +x ./mac_cycle_script

    Step 11: Run the mac cycler! (With root privileges, of course.)
    sudo ./mac_cycle_script

    With any luck, you should have a HomePass station on Linux that sequentially cycles through 161 MACs at an interval of your choice.
    **Mileage may vary. It usually takes my Linux machine a minute or two to get the Internet connection back up, and I find Linux in general to be very picky. This script works for me, but I can't promise that it will work for you. If anyone with greater knowledge of Linux and bash scripting wants to take my work and improve upon it, all I ask is that you give due credit to somebunny and dicamarques.

    Also, if you have any trouble connecting, check, the original tutorial thread, and then double check this one. If you have never been able to get streetpasses on linux, please post in the other thread.

    See snailface's post below for a randomized version!
     

    Attached Files:

    Margen67 likes this.
  2. Snailface

    Snailface My frothing demand for 3ds homebrew is increasing

    Member
    4,324
    1,981
    Sep 20, 2010
    Engine Room with Cyan, watching him learn.
    I've made a python script (attached) that'll auto-generate the home_zone script with the 160 prime macs randomly shuffled so each person gets a unique combination (this is good).

    As far as automatic cycling goes, it really isn't practical now we have 6 tags per hit. It only takes running the command:
    sudo ./home_zone spoof0 wlan0 eth0
    twice (press up arrow shortcut to recall the command) to get a max 10 SP Miis. Any further cycling beyond that is nonsensical
    because you just lose the surplus hits anyway unless you stop and play them.

    Okay simple instructions time : )
    Simply copy all three files to wherever you want to run the program on linux and type,
    sudo python maclist.py
    ... to generate the home_zone file then,
    sudo ./home_zone spoof0 wlan0 eth0
    Replace the 0s above for your appropriate situation. (macs are spoof1 - spoof160). Enjoy!
     

    Attached Files:

    Margen67 and Mr.Leb like this.
  3. Mr.Leb
    OP

    Mr.Leb Advanced Member

    Newcomer
    65
    3
    Jul 19, 2008
    United States
    That's awesome! Thanks!
    Also, I use automatic cycling to let my console streetpass for pokemiles. The cap there is 99 tags, and you usually only get 1 every relay or so. For my purposes, it's more practical to run through a ton of MACs quickly without having to interact with the machine.
     
  4. Snailface

    Snailface My frothing demand for 3ds homebrew is increasing

    Member
    4,324
    1,981
    Sep 20, 2010
    Engine Room with Cyan, watching him learn.
    Got your automatic 160 mac cycler. Let me know what you think, instructions inside. :P
     

    Attached Files:

    Margen67 and Mr.Leb like this.
  5. Mr.Leb
    OP

    Mr.Leb Advanced Member

    Newcomer
    65
    3
    Jul 19, 2008
    United States
    That is excellent! I've just been backgrounding my script with ctrl+z to pause it, but the fact that it remembers the last address it used is great.
    If my work got somebody with more skills to make (and publicly post) a truly useful Linux homepass, I'm happy.
     
    Snailface likes this.
  6. FRITZINATOR

    FRITZINATOR Advanced Member

    Newcomer
    81
    9
    Sep 27, 2013
    United States
    Step 10: Fire up the terminal and enter these two commands:
    sudo chmod +x ./home_zone_161
    sudo chmod +x ./mac_cycle_script

    Step 11: Run the mac cycler! (With root privileges, of course.)
    sudo ./mac_cycle_script

    With any luck, you should have a HomePass station on Linux that sequentially cycles through 161 MACs at an interval of your choice.
    **Mileage may vary. It usually takes my Linux machine a minute or two to get the Internet connection back up, and I find Linux in general to be very picky. This script works for me, but I can't promise that it will work for you. If anyone with greater knowledge of Linux and bash scripting wants to take my work and improve upon it, all I ask is that you give due credit to somebunny and dicamarques.

    Also, if you have any trouble connecting, check, the original tutorial thread, and then double check this one. If you have never been able to get streetpasses on linux, please post in the other thread.

    See snailface's post below for a randomized version![/quote]


    I tried to do this step by step and all I get is home zone 161 not found and sleep interval is invalid. Please help!
     
    Margen67 likes this.
  7. zarqy

    zarqy Newbie

    Newcomer
    9
    0
    Sep 28, 2008
    Canada
    I absolutely loved home_zone and your maclist.py script. Unfortunately my linux box died (RIP Linux Mint) and all I'm left with is my mac mini.
    There is NOTHING of this calibre available on the mac (yet). Any chance you'd be up to converting it so the mac can use it?

    Even if you can't do home_zone maybe convert maclist.py to work?

    I know many would benefit from this (myself included!)