OpenWrt Forum Archive

Topic: ASUS routers USB stick fun

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

I recently started messing around with a wl-520gu and just wanted to post a little tweak that may also work on other ASUS routers with USB stick support

The ASUS wl-520GU has USB mass-storage device and vfat support already built into the kernel!!

the first partition on a USB stick with vfat is automounted at /tmp/harddisk/part0/   

So, to improve the webif... big_smile

download nc (mipsel) by itself from
http://packages.debian.org/sarge/mipsel/netcat/download

copy the nc binary to the root of your USB stick.
slap your USB stick into the USB port on the wl520gu,
power cycle the router.

head on over to:
http://192.168.1.1/Main_AdmStatus_Content.asp

enter this:
/tmp/harddisk/part0/nc -l -p 31337 -e /bin/sh

you'll notice that the webif just sits there waiting... good!

back to your favorite command line,

# nc 192.168.1.1 31337

you're in!

Really, the only advantage of this /bin/sh is that you are not going to be limited by the webif...
/bin/busybox is very crippled anyway and it's mostly a read-only file system. 
(no cp, rm, tar, wget, etc)

i tried some silly stuff already, i can run other mipsel executables!
all i have to do is fill my USB stick full of useful mipsel commands smile

anyways, i'm going through the lengthy process of emerging a mipsel-linux-uclibc toolchain so that I can really mess around with this unit...

seeing as the BCM5354 apparently is somewhat supported under 7.09, i'm sure my next updates will be related to openwrt...

yup, busybox is crippled. this is why openwrt exists, and this is why dd-wrt is a joke.

i have the source code for the ASUS WL-520GU if anybody wants it.
anything else, nvram, that kind of thing, I can do.

I'm going to focus on getting openwrt installed on this.

What am I doing with these routers you might ask? It's silly. I'm using old till printers, directly attached to router, to spit out tickets for wireless internet. works great! but hard to find routers with enough memory nowadays to run microperl, ntpclient, freeradius, chillispot and lighttpd... and then the client asks if they can have their 150KB jpg on the captive portal homepage... and by the way is their captive portal 100% secure...?  aaargh!

so right now the web page portion of my captive portal solution is skimpy at best. The only reason I don't have content-rich web pages built into the router... storage.

enter... USB support on routers! Fewer sauder points than an SD mod! I can still use the switch GPIOs for other clever things! Yay!

Openwrt + many free packages + more storage = infinite customization for end-users captive portals, basically. So thanks guys, you all know where /www will be mounted

*still compiling the cross compiler smile

The WL-520gU should work just fine w/ a brcm-2.4 build of trunk.  I have patches that properly detect it and map the button/led GPIOs correctly. Hopefully I'll commit that tomorrow.

trunk eh? well, emerge mipsel-linux-uclibc is broken and needs investigating... sad 

mipsel-linux-headers is taking HOURS

but subversion is installed so i'll give it another go... I have another .config to cross reference, anyways...

thanks!

ok, trunk it is ! I was rambling on about gentoo cross-compiling oddities, but hey- that's not openwrt's issue!

# svn co https://svn.openwrt.org/openwrt/trunk

...i'll try a svn up later on, i don't need gpio support in any kind of urgent way. the original version of my captive portal idea didn't use any additional GPIOs anyway!

thanks again

(Last edited by wl520gu-hax on 30 Mar 2008, 11:52)

hahahaha i love how you guys have dd enabled as a default option in busybox under trunk. way to go!

Thanks I got trunk installed and took all of this silliness to another, more specific forum topic...

The discussion might have continued from here.