Tutorial [HOW-TO] Have a homemade Streetpass Relay

What method you are using?

  • Linux

    Votes: 93 7.9%
  • Android

    Votes: 133 11.4%
  • Router

    Votes: 226 19.3%
  • Windows

    Votes: 426 36.4%
  • A pony with a wifi antenna O.o?

    Votes: 292 25.0%

  • Total voters
    1,170
Status
Not open for further replies.

Sev501

Well-Known Member
Member
Joined
Nov 5, 2012
Messages
161
Trophies
1
Location
127.0.0.1
XP
198
Country
Philippines
Of course, I can make an "atheros version" and upload it. I'll post in this thread when that's done. Also, do you mean Virtual router stops? or the entire hosted network stops?
The virtual wifi mini port stops so you need to type in again
Code:
netsh wlan start hostednetowrk
to re-enable it after a macshift hehe...

Thanks! Atm I'm just using my own timed script to restart hostednetwork ..
it's a basic vb script set off to run after macshift timer expires (I use your default 15 mins)

Anyone needs it, here's the code:
Code:
Option Explicit
Dim shell
set shell=createobject("wscript.shell")
do
WScript.Sleep 930000
shell.Run "netsh wlan start hostednetwork"
loop
 

Chaldron

GBATemp's Official Attorney
Member
Joined
Mar 29, 2013
Messages
434
Trophies
0
Location
`Murica
XP
439
Country
United States
The virtual wifi mini port stops so you need to type in again
Code:
netsh wlan start hostednetowrk
to re-enable it after a macshift hehe...

Thanks! Atm I'm just using my own timed script to restart hostednetwork ..
it's a basic vb script set off to run after macshift timer expires (I use your default 15 mins)

Anyone needs it, here's the code:
Code:
Option Explicit
Dim shell
set shell=createobject("wscript.shell")
do
WScript.Sleep 930000
shell.Run "netsh wlan start hostednetwork"
loop


yeah I've added this features. check my thread in tuts. and faqs
 
  • Like
Reactions: Sev501

BerserkLeon

Not-so-new member
Member
Joined
Mar 22, 2010
Messages
460
Trophies
1
Age
34
Location
Pennsylvania
XP
538
Country
United States
root@Nintendo-ROUTER:~# ifconfig ath0 down
root@Nintendo-ROUTER:~# ifconfig ath0 hwaddr=4E:53:50:4F:4F:40
root@Nintendo-ROUTER:~# ifconfig ath0 up


try ifconfig ath0 hw ether 4e:53:50:4f:4f:40
instead of ifconfig at0 hwaddr=4e:53:50:4f:4f:40

if that doesn't work, try subbing eth0 for ath0 as that's the only interface that has packets.
 

Genosync

Member
Newcomer
Joined
Aug 14, 2013
Messages
17
Trophies
0
Age
38
XP
41
Country
United States
Turns out that in my haste to try to get this set up, I make the noobiest of noob mistakes ever--plugged the damn cable into the wrong ports.

I was setting up a router as a switch by accident, and not connecting the daisy chained router through its WAN port.

Shooting myself, I'm sure it's going to work at this point as the DD-WRT router is finally pulling a system time.
 

trinest

Well-Known Member
Newcomer
Joined
Nov 20, 2004
Messages
84
Trophies
0
Age
32
Location
Australia
Website
anothercodelabs.co.uk
XP
237
Country
Have a random issue where it decides to look for a connection while broadcasting and thus breaks the StreetPass relay.

Oh well.

Might end up getting a router for it, as that allows cycling through the mac addresses and seems more stable/pratical.
 

Genosync

Member
Newcomer
Joined
Aug 14, 2013
Messages
17
Trophies
0
Age
38
XP
41
Country
United States
ALRIGHT, I've got something here finally on the quest to get this fixed.

It's telling me there's an arithmetic error on line 5 when trying to run this script (I telnet'd in).

And, here's lines 1 through 5:

Code:
#!/bin/sh
TITLES="OO@OOAOOBOOCOODOOEOOFOOGOOHOOIOOJOOKOOLOOMOONOOO"
BASE="NSP"
RANDOM=$(head -c 2 /dev/urandom | hexdump -e '1/2 "%u"')
CTR=$(($RANDOM%$(($(expr length $TITLES)/3))))

well, it's also telling me this:

Code:
root@DD-WRT:/tmp# /tmp/nzone
head: invalid option -- c
/tmp/nzone: line 5: arithmetic syntax error

So... Yeah, I'm kind of stuck here.


Edit:

Been messing around with it more. Took the -c option off the head commands in the script, the script RUNS, but my Wireless MAC Clone address doesn't change. At all.

I'm also having to put it in via console rather than the GUI. If I try to pump it through the GUI, it doesn't overwrite what's already there.


Edit2:

Tried to run the "head" command directly at commandline like printed in the script posted, noted that -c denotes the number of bytes to pull from file. so "head -c 2 /dev/urandom" is trying to pull the first two bytes out of whatever's in urandom, but my build of dd-wrt is not liking the -c option on the head command one freaking bit. Thoughts?
 

Chango007

New Member
Newbie
Joined
Aug 14, 2013
Messages
1
Trophies
0
Age
48
XP
124
Country
is this normal?
iveh.png
 

alpha_noj

Well-Known Member
Member
Joined
May 29, 2009
Messages
287
Trophies
0
XP
518
Country
United States
This is for routers with DD-WRT firmware.

Well, lets move on to the title-based StreetPass!
MAC generated in a following way:
the first three octets are ASCII codes for "NSP" (4E:53:50)
the last three octets are CTR title code (i.e. CTR-XXX.-...)

Here you can find a list of game CTR codes: StreetPass CTR

For automatic MAC rotation just create a string from CTR-codes without any separators and add it to the following scripts just after [email protected] (you can choose to remove [email protected] as well if you do not want to use a common StreetPass MACs)

Insert script in Administration - Commands
Code:
echo -e "#!/bin/sh\nTITLES=\"OO@OOAOOBOOCOODOOEOOFOOGOOHOOIOOJOOKOOLOOMOONOOO\"\nBASE=\"NSP\"\nRANDOM=\$(head -c 2 /dev/urandom | hexdump -e '1/2 \"%u\"')\nCTR=\$((\$RANDOM%\$((\$(expr length \$TITLES)/3))))\nMAC=\$(echo -e \$BASE\$TITLES | cut -c 1-3,\$((\$CTR*3+4))-\$((\$CTR*3+6)) | hexdump -e '6/1 \"%02X:\"' | head -c 17)\nWLINT=\$(nvram get wl0_ifname)\nAPDCNF=/tmp/\${WLINT}_hostap.conf\nAPDPID=/var/run/\${WLINT}_hostapd.pid\nif [ -e \$APDCNF ]; then\nkill \$(cat \$APDPID)\nsed -ri s/bssid=.*/bssid=\$MAC/ \$APDCNF\nhostapd -B -P \$APDPID \$APDCNF\nelse\nifconfig \$WLINT down\nifconfig \$WLINT hw ether \$MAC\nifconfig \$WLINT up\nfi" >/tmp/nzone; chmod 555 /tmp/nzone
hit Run Commands, insert again, hit Save Startup
Code:
#!/bin/sh
TITLES="OO@OOAOOBOOCOODOOEOOFOOGOOHOOIOOJOOKOOLOOMOONOOO"
BASE="NSP"
RANDOM=$(head -c 2 /dev/urandom | hexdump -e '1/2 "%u"')
CTR=$(($RANDOM%$(($(expr length $TITLES)/3))))
MAC=$(echo -e $BASE$TITLES | cut -c 1-3,$(($CTR*3+4))-$(($CTR*3+6)) | hexdump -e '6/1 "%02X:"' | head -c 17)
WLINT=$(nvram get wl0_ifname)
APDCNF=/tmp/${WLINT}_hostap.conf
APDPID=/var/run/${WLINT}_hostapd.pid
if [ -e $APDCNF ]; then
kill $(cat $APDPID)
sed -ri s/bssid=.*/bssid=$MAC/ $APDCNF
hostapd -B -P $APDPID $APDCNF
else
ifconfig $WLINT down
ifconfig $WLINT hw ether $MAC
ifconfig $WLINT up
fi
In Administration - Management - Cron insert:
Code:
*/10 1-7 * * * root /tmp/nzone
and Apply Settings. Now your router will change to a random MAC from a selected list every 10 minutes starting from 1:00 to 7:50

Q: Why do we need a title-specific MACS? I feel comfortable with common 16 MACS
A: There are over 130 StreetPass-enabled games now. If you're using less common games, you may pass hundreds of streetpasses to get a StreetPass data for them. The dedicated MAC for a title will guarantee you will get data for that title, as soon as somebody else is using it.

Q: Why not to use a siple cycle through all common MACs
A: In case it is not randomized, you have a big probability to get a StreetPass data from the same partner several times in a row

Q: Can a change MAC more often to get more streetpasses?
A: Since you can only get one StreetPass from a unique MAC per 8 hours, switching MAC too often will at least do nothing for you and at worst spam all used MACs with your data. I suggest you shold change MAC not more than (Number_of_MACS / 8)*2 times per hour

Q: Your script is not working as it should
A1: Depending on router model it can tike upto two minutes for Access Point to restart with new MAC
A2: Though this script was tested on DD-WRT v24 preSP2 (Build 21061), it may not run properly on your device because of the DD-WRT build differences for a variety of hardware. If this is the case, please make sure you have the latest DD-WRT available for your router and PM me output for this commands
Code:
cat /proc/cpuinfo
nvram get wl0_ifname
ifconfig
iwconfig
ps
- support multi-ssid configuration
- check script with Realtek-baset routers


Just a quick question. When I first set this up, Nintendo Zone shows up fine because of the SSID, but do I need to turn MAC cloning on or will the commands work on their own? Also, is there a way to set this to run 24/7 instead of just during a time frame?
 

Genosync

Member
Newcomer
Joined
Aug 14, 2013
Messages
17
Trophies
0
Age
38
XP
41
Country
United States
"Just a quick question. When I first set this up, Nintendo Zone shows up fine because of the SSID, but do I need to turn MAC cloning on or will the commands work on their own? Also, is there a way to set this to run 24/7 instead of just during a time frame?"

From what I've figured out so far:

1. You've gotta still turn MAC Cloning on
2. You can change time that it runs on the cron command part; the "1-7" is what's defining the window of "hours" that it runs on. Change "1-7" to just a "*" and it will run all the time. The first part is what defines when it runs based on minutes, so */10 = once every 10 minutes, */15 = once every 15, etc.

But I'm still stuck because even though I'm on the same build that duke is, DD-WRT is not liking the "-c" option on the head command :(
 

alpha_noj

Well-Known Member
Member
Joined
May 29, 2009
Messages
287
Trophies
0
XP
518
Country
United States
"Just a quick question. When I first set this up, Nintendo Zone shows up fine because of the SSID, but do I need to turn MAC cloning on or will the commands work on their own? Also, is there a way to set this to run 24/7 instead of just during a time frame?"

From what I've figured out so far:

1. You've gotta still turn MAC Cloning on
2. You can change time that it runs on the cron command part; the "1-7" is what's defining the window of "hours" that it runs on. Change "1-7" to just a "*" and it will run all the time. The first part is what defines when it runs based on minutes, so */10 = once every 10 minutes, */15 = once every 15, etc.

But I'm still stuck because even though I'm on the same build that duke is, DD-WRT is not liking the "-c" option on the head command :(

Thanks, going to give it a try now and try and test it. Also, does this change the wireless MAC or WAN MAC? I've been inputting all of these MAC addresses in Wireless and having no problems, but I tried WAN initially and it didn't work.
 

Genosync

Member
Newcomer
Joined
Aug 14, 2013
Messages
17
Trophies
0
Age
38
XP
41
Country
United States
Thanks, going to give it a try now and try and test it. Also, does this change the wireless MAC or WAN MAC? I've been inputting all of these MAC addresses in Wireless and having no problems, but I tried WAN initially and it didn't work.

Setup -> MAC Address Clone -> Enable -> Clone Wireless MAC is the only one you need to change to get it to register as a Nintendozone, as long as the router's got access to the interwebs.
 

srwgin

Well-Known Member
Member
Joined
Aug 13, 2013
Messages
520
Trophies
0
XP
425
Country
China
Genosync
so you also can not change mac auto?
which router do you use?
I use tplinkwr703n
 

Genosync

Member
Newcomer
Joined
Aug 14, 2013
Messages
17
Trophies
0
Age
38
XP
41
Country
United States
a Linksys E1200, but I've figured out that the problem is that even though I'm (and probably you) are using the same DD-WRT build the person that wrote the script is on, for some reason it's not allowing us to use the "-c" option on the head command, which means it's not able to properly pull the random value to make it work the way he intended.

And it's way too late for me to figure out how to get it to work with a random value; I'm about to go to bed as is already.

I'm hoping he hops on within the next 24 hours, otherwise I can't test this again until probably Sunday.


Minor edit:

Not to mention, there's probably the fact that you have to make sure it's setting system time properly on the router for his cron line to work. Maybe. I don't freaking know anymore--all I know is my dd-wrt router isn't liking "head -c".
 

alpha_noj

Well-Known Member
Member
Joined
May 29, 2009
Messages
287
Trophies
0
XP
518
Country
United States
Setup -> MAC Address Clone -> Enable -> Clone Wireless MAC is the only one you need to change to get it to register as a Nintendozone, as long as the router's got access to the interwebs.

Ok, I think I have everything set up correctly, but it doesn't appear as if the MAC has changed yet. I set the number low to test
Setup -> MAC Address Clone -> Enable -> Clone Wireless MAC is the only one you need to change to get it to register as a Nintendozone, as long as the router's got access to the interwebs.

Testing everything now. Settings should all be correct, but not sure if my commands are good. I changed Cron to "*/5 * * * * root /tmp/nzone", and am awaiting results now. The 5 minutes is just temporary, to make sure everything is working proper.
 

srwgin

Well-Known Member
Member
Joined
Aug 13, 2013
Messages
520
Trophies
0
XP
425
Country
China
first you make sure your 3ds only has a wifi setting ssid is attwifi,then test can you use this ssid go on interent
if ok, try to change mac and waiting for the green light
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: This movie rip so werid has 1080p quality but the audios ripped with movie theater audio quality