lundi 2 avril 2012

nano-hack : wrt54g v2 plus ddwrt plus ssh


$ ps
PID USER       VSZ STAT COMMAND
    1 root      1464 S    /sbin/init noinitrd 
    2 root         0 SW   [keventd]
    3 root         0 SWN  [ksoftirqd_CPU0]
    4 root         0 SW   [kswapd]
    5 root         0 SW   [bdflush]
    6 root         0 SW   [kupdated]
    9 root         0 SW   [mtdblockd]
   13 root      1500 S    watchdog 
   91 root      1460 S    resetbutton 
  141 root      1100 S    telnetd 
  160 root       808 S    dnsmasq --conf-file=/tmp/dnsmasq.conf 
  164 root      1456 S    wland 
  168 root       692 S    udhcpc -i vlan1 -p /var/run/udhcpc.pid -s /tmp/udhcpc
  172 root       692 S    cron 
  179 root      1424 S    ttraff 
  200 root      2140 S    httpd -p 80 
  381 root      1536 S    dropbear -b /tmp/loginprompt -r /tmp/root/.ssh/ssh_ho
  419 root      1456 S    process_monitor 
  572 root      1104 S    sh -c alias ping='ping -c 3'; eval "ps" > /tmp/ping.l
  573 root      1104 R    ps 
  574 root      1104 S    sh -c /sbin/ledtool 1 
  575 root      1104 R    sh -c /sbin/ledtool 1


$ uname -a
Linux DD-WRT 2.4.35 #3392 Mon Nov 2 13:19:34 CET 2009 mips unknown

That, is the output of commands using ddwrt on a wrt54g v2.

Finally tried to upgrade this old device. It uses 192.168.1.1 which collides with my actual internet gateway so I had to think (far too long) to connect to the wrt54g without stopping the gateway. Stopping my laptop's wifi and using ethernet wire between both gave me a functionning network, ping 192.168.1.1 was responding. 
I forgot that I set up https on the linksys webadmin. After uploading an almost random firmware found on ddwrt page I saw a 'upload success' but something failed. Rebooting it twice didn't bring the webadmin page back (http nor https). I could ping to the box so I tried to upload another firmware using tftp. First to attempts failed, the third printed a message saying it was cleaning nvram flash then exited. The process was a bit too quick to feel right. I consider resetting using the back button, hoping to reinitiate an upload, then I saw a webpage .. but it was ddwrt webadmin. Somehow it works now, so I fiddled with it, enabled ssh. And that's about it, what's next ?

- Adding usb ports. Nice if you use the device as a server
- Better antennas
- Heatsink
- More recent software. ddwrt last firmware uses linux 2.4 and busybox. Running 3.3 kernel and such might be fun, for the sake of it.

ps: A+ on the hackability of this thing. The case has no screw, just stiff surface bumps that hold the board into a two part case. Really nice.

Aucun commentaire:

Enregistrer un commentaire