OpenWrt Forum Archive

Topic: Successful "Port" of AutoAP to OpenWRT on TP-Link 703N (Atheros)

The content of this topic has been archived on 16 Jun 2017. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Ok, this is right about where the skriptkiddie stuff Ill be doing may not be as useful to other people, so its a good time to share what I have done.

First off, for compatibility' sake, I have a TP-Link TL-WR703N, which means this will be a breeze if you have one of those!

The changes Ive made are lengthy. I'll try to keep track of everything and if I suddenly remember stuff I'll come back and post it here.

In a jiff, this is what this (collection of) script[s] will do:
-------------------------------------------------
1. Scan for networks
2. Compose a list, automatically ignoring all encrypted nets
3. Check remaining nets against a filter list
4. Connect to strongest network
5. Verify connectivity with a ping of arbitrary site (set to google.com)
----
6. Create a new wireless network called "Ghost"
7. Relay all dhcp requests and other traffic invisibly to host network from step 5
8. Do a bunch of convoluted shite to create an accessible node with sshd access in same ip range
9. Continue monitoring and if connectivity is lost, start again.
10. Make a sandwich. <----currently broken.
---------------------------------------------------

ZIP FILE:
https://drive.google.com/file/d/0Bx2sj- … sp=sharing




INSTALL NOTES:

#install directions
#create folder /jffs/bin/ (mkdir /jffs/bin)
#copy everything but ETCCONFIG folder there (cp * /jffs/bin)
#chmod a+x the whole lot (chmod a+x /jffs/bin/*)
#cd into ETCCONFIG 
#copy everything there to /etc/config (cp * /etc/config)
#make sure wireless-tools and relayd is installed (opkg update; opkg install relayd; opkg install wireless-tools)
#run script by ./autoap.sh


#once satisfied, to have it run at every boot, 
#add "/jffs/bin/autoap.sh >> /tmp/autoap.output &" to /etc/inittab

NOTE: the file locations are hardcoded. if this stuff isnt in /jffs/bin/ it wont work.

So...for Holy Shit' sake, I could try to list the bajillions of changes from the DD-WRT copy, but its been over a month of daily hackage and I'm not sure I'd be able to.

I use it to have (nearly) constant wifi AP in my vehicle.

I would be thrilled if this proves 'useful' to others and maybe we get some collaborative scripting going on.

SO: Please share any upgrayeds you make!!

heres a look at a likely output:

No AP's found in range. Sleep for a moment..

Successfully collected access point scan data, analysing...
FILTERED: PT chamber of commerce-guest matches PT chamber of commerce-guest
FILTERED: PT chamber of commerce matches PT chamber of commerce
FILTERED:  matches
FILTERED:  matches
FILTERED:  matches
FILTERED:  matches
FILTERED:  matches
FILTERED:  matches
FILTERED:  matches
FILTERED:  matches
Ignoring open AP PT chamber of commerce-guest 02:F8:B3:A3:BE:20 10 00
Ignoring open AP  00:03:52:AB:2B:01  1 00
Ignoring WPA AP myqwest5001 50:67:F0:F3:A9:01 11 00
Ignoring WPA AP myqwest1623 00:24:7B:0C:89:78  6 00
Ignoring WPA AP krickemeyer 00:24:7B:61:B3:5C  1 00
Ignoring WPA AP PT chamber of commerce 48:F8:B3:A3:BE:1F 10 00
Ignoring WPA AP CenturyLink7545 B2:B2:DC:1A:28:A4  5 00
Ignoring WPA AP CenturyLink7473 10:5F:06:C8:17:28  6 00
Ignoring WEP AP kindle-2g 00:23:69:DE:E1:7E 11 00
Ignoring WEP AP Namo Buddhaya E8:DE:27:25:6B:34  1 00
Ignoring WEP AP  00:1A:1E:B9:0A:C3  6 00
Ignoring WEP AP  00:1A:1E:B9:0A:C2  6 00
Ignoring WEP AP  00:1A:1E:B9:0A:C1  6 00
Ignoring WEP AP  00:1A:1E:B9:0A:C0  6 00
Ignoring WEP AP  00:03:52:AB:2B:02  1 00
Ignoring WEP AP  00:00:00:00:00:00  6 00
Ignoring WEP AP  00:00:00:00:00:00  1 00
Found open AP safewaywifi 00:03:52:AB:2B:00  1 00
Found open AP pt-wireless 00:18:39:D0:3E:CD  6 00
Trying to connect to open AP: "safewaywifi" with MAC Address: 00:03:52:AB:2B:00
cur_ssid: Current SSID: off/any
cur_bssid: dBm
Setting wlan0 essid to: safewaywifi
DHCP Request IP....
Failed to ping: "safewaywifi" Gateway: 0.0.0.0 Received IP Address:
Trying to connect to open AP: "pt-wireless" with MAC Address: 00:18:39:D0:3E:CD
cur_ssid: safewaywifi
cur_bssid: 00:03:52:AB:2B:00
Setting wlan0 essid to: pt-wireless
DHCP Request IP....
Connected to: "pt-wireless" with MAC Address: 00:18:39:D0:3E:CD Gateway: 0.0.0.0 WLAN IP: 10.10.10.121
Relay bridge SSH Accessiblity: 10.10.10.69 will be assigned...
./autoap.sh: line 569: : Permission denied
All new commands finished.
Monitoring connection every 2 minute(s), rescanning in 120 minute(s). 0% packet loss. Ping round-trip min/avg/max = 18.996/31.984/41.381 ms
Monitoring connection every 2 minute(s), rescanning in 118 minute(s). 0% packet loss. Ping round-trip min/avg/max = 18.687/34.094/70.111 ms
Monitoring connection every 2 minute(s), rescanning in 116 minute(s). 0% packet loss. Ping round-trip min/avg/max = 19.780/30.184/40.720 ms
Monitoring connection every 2 minute(s), rescanning in 114 minute(s). 0% packet loss. Ping round-trip min/avg/max = 15.669/18.812/23.954 ms
Monitoring connection every 2 minute(s), rescanning in 112 minute(s). 0% packet loss. Ping round-trip min/avg/max = 20.641/31.155/58.983 ms
Monitoring connection every 2 minute(s), rescanning in 110 minute(s). 0% packet loss. Ping round-trip min/avg/max = 20.063/26.008/32.337 ms
Monitoring connection every 2 minute(s), rescanning in 108 minute(s). 0% packet loss. Ping round-trip min/avg/max = 25.714/35.616/49.884 ms
Monitoring connection every 2 minute(s), rescanning in 106 minute(s). 0% packet loss. Ping round-trip min/avg/max = 16.207/20.668/26.202 ms
Monitoring connection every 2 minute(s), rescanning in 104 minute(s). 0% packet loss. Ping round-trip min/avg/max = 25.431/27.622/31.168 ms
Monitoring connection every 2 minute(s), rescanning in 102 minute(s). 0% packet loss. Ping round-trip min/avg/max = 20.394/25.741/29.977 ms
Monitoring connection every 2 minute(s), rescanning in 100 minute(s). 0% packet loss. Ping round-trip min/avg/max = 20.027/37.322/65.850 ms
Monitoring connection every 2 minute(s), rescanning in 98 minute(s). 0% packet loss. Ping round-trip min/avg/max = 20.055/23.774/26.574 ms
Monitoring connection every 2 minute(s), rescanning in 96 minute(s). 0% packet loss. Ping round-trip min/avg/max = 37.052/591.151/1170.909 ms
Monitoring connection every 2 minute(s), rescanning in 94 minute(s). 0% packet loss. Ping round-trip min/avg/max = 21.509/24.901/26.735 ms
Monitoring connection every 2 minute(s), rescanning in 92 minute(s). 0% packet loss. Ping round-trip min/avg/max = 17.672/21.420/26.028 ms
Monitoring connection every 2 minute(s), rescanning in 90 minute(s). 0% packet loss. Ping round-trip min/avg/max = 17.794/24.572/27.119 ms
Monitoring connection every 2 minute(s), rescanning in 88 minute(s). 0% packet loss. Ping round-trip min/avg/max = 18.442/26.901/36.504 ms
Monitoring connection every 2 minute(s), rescanning in 86 minute(s). 0% packet loss. Ping round-trip min/avg/max = 18.829/24.794/32.286 ms
Monitoring connection every 2 minute(s), rescanning in 84 minute(s). 0% packet loss. Ping round-trip min/avg/max = 23.337/28.228/36.732 ms

Notice there's some errors. If you demand an explanation, see my username.

Hi, thanks for this port.

Most of the Wifis that I found when travel are those support 802.1X Port Authentication,when you can connect,but need to log on with your mobile phone and get a txt back for a code to finally connect to internet.

Directly open wifi these days are rare,if there are,there are most phishing with "cains" behind to scan any your passcode....not dare to connect to those "free" wifi these days.

If you can change with auto logon with 802.1x authentication,it would be better.

Thanks anyway.

uh, you must not understand how Cain works, or have your entire networking configuration set to blindly accept new security certs. It's a shitty, very obvious MITM, and the rest of the info it can glean anybody with a packet sniffer could see anyway.

Aside from that, 802.1x Auth would still be awesome. Lots of other things too like auto login to common free portals, maybe making it work hand in hand with a proxy server setup..

I'll be definitely doing more and hope it turns out some others do too.

Hi, I'm new to openWrt, I just receive a wr703n and want to do "AutoAP" with it. I just look at yours files and I'm thankful with all the comment you add to it.

I'm a PLC programmer so I have many thing to learn first !

If you have update file I would be grateful to start with them.

Thanks

The discussion might have continued from here.