Controlling O2's Wireless Box · Nov 24, 01:56 AM
Routers are supposed to be easy to work with, beyond the web control panel. But ones for domestic use often have the really useful features hidden away. O2’s Wireless Box is a rebadged Thompson SpeedTouch 780. It has a wealth of features that aren’t on view in the web interface.
Luckily these undocumented features are accessible with a bit of poking around. To start with there is a ‘SuperUser’ account and password that have been leaked on the web. This works for the web control panel and unlocks a few features – one of the more useful being a ‘save or restore configuration’. The same login details also work for a command line interface accessible through ‘telnet’.
If you connect to the router with telnet using the SuperUser password there is a whole range of commands including a help command that tells you how to use them. If that’s not enough, compare the commands with the saved config file from earlier… each section in the config file matches to a command so it’s very easy to figure out how to do things.
Using ‘expect’ I wrote a script to log in to the router and enable or disable some wireless clients with the ‘wireless macacl’ command. expect allows for complex interactions but in this case you only need to chain together some simple ‘send’s followed by some ‘expect’s like this:
#!/usr/bin/expect
spawn telnet 192.168.1.254
expect “Username : “
send “SuperUser\r”
expect “Password : “
send “O2Br0ad64nd\r”
expect “SuperUser”
send “wireless macacl modify hwaddr=00:19:d2:12:34:56 permission=allow\r”
The saved config file has all the details of the hardware address and the names of the clients – if in doubt you can use the command ‘wireless macacl list’ to list them. To disable a client use permission=deny instead of permission=allow.
With a one line command to enable and disable clients, we can use crontab to apply any scheduling we care to enable and disable those clients for different time periods in the day, for different time periods at weekends, and so on. I called my command ‘thompson’ in honour of the people that didn’t disable all the good features. Here is my crontab file:
# off at 9:30pm sun-thurs and 11pm fri and sat
30 21 * * 0-4 thompson off > /dev/null
0 23 * * 5,6 thompson off > /dev/null
# on at 6am every day
0 6 * * * thompson on > /dev/null
# off at 7:30 on weekdays for school
30 7 * * 1-5 thompson off > /dev/null
# on at 2pm after school
0 14 * * 1-5 thompson on > /dev/null
It’s not perfect yet because it doesn’t disconnect a client that is already connected. I think a bit more delving through the help command might give some results.
<<<Requiem for a prophetically named Linux distribution · Christmas Fun>>>

