Lo segundo es, que toquetear un router y jugar con su firmware sin saber lo que se hace puede provocar que el router se estropee, y el autor de este texto no se hace responsable de nada. Este blog, de hecho, se ha realizado para que el autor pueda tener siempre a mano algunas notas que le interesan por motivos personales en cualquier parte del mundo, y que no le importa compartir con mas gente. Por este motivo no se hace responsable de los estropicios causados por usar las entradas de este blog.
El procedimiento para ejecutar la version 1.19 de busybox mas avanzada que la que lleva el router Homestation ADB P.DG A4001N es la que sigue:
Descargar la version busybox de aqui, y la guardaremos en un pendrive.
Conectaremos el pendrive al router Homestation y obtendremos acceso root tal y como se explica en esta entrada. Una vez obtenido el acceso en modo root ejecutaremos lo siguiente:
# dmesg
..
sb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
scsi 0:0:0:0: Direct-Access Generic USB Flash Disk 2.00 PQ: 0 ANSI: 2
usb-storage: device scan complete
ready
sd 0:0:0:0: [sda] 2047488 512-byte hardware sectors: (1.04 GB/999 MiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
sda:
sd 0:0:0:0: [sda] Attached SCSI removable disk
# mkdir /tmp/p
# mount /dev/sda /tmp/p
# cd /tmp/p
# ls
busybox-mips
# ./busybox-mips
BusyBox v1.19.0 (2011-08-14 23:54:39 CDT) multi-call binary.
Copyright (C) 1998-2011 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Usage: busybox [function] [arguments]...
or: busybox --list[-full]
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as.
Currently defined functions:
[, [[, acpid, add-shell, addgroup, adduser, adjtimex, arp, arping, ash,
awk, base64, basename, beep, blkid, blockdev, bootchartd, brctl,
bunzip2, bzcat, bzip2, cal, cat, catv, chat, chattr, chgrp, chmod,
chown, chpasswd, chpst, chroot, chrt, chvt, cksum, clear, cmp, comm,
cp, cpio, crond, crontab, cryptpw, cttyhack, cut, date, dc, dd,
deallocvt, delgroup, deluser, depmod, devmem, df, dhcprelay, diff,
dirname, dmesg, dnsd, dnsdomainname, dos2unix, du, dumpkmap,
dumpleases, echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake,
expand, expr, fakeidentd, false, fbset, fbsplash, fdflush, fdformat,
fdisk, fgconsole, fgrep, find, findfs, flock, fold, free, freeramdisk,
fsck, fsck.minix, fsync, ftpd, ftpget, ftpput, fuser, getopt, getty,
grep, groups, gunzip, gzip, halt, hd, hdparm, head, hexdump, hostid,
hostname, httpd, hush, hwclock, id, ifconfig, ifdown, ifenslave,
ifplugd, ifup, inetd, init, insmod, install, ionice, iostat, ip,
ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel,
kbd_mode, kill, killall, killall5, klogd, last, less, linux32, linux64,
linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread,
losetup, lpd, lpq, lpr, ls, lsattr, lsmod, lspci, lsusb, lzcat, lzma,
lzop, lzopcat, makedevs, makemime, man, md5sum, mdev, mesg, microcom,
mkdir, mkdosfs, mke2fs, mkfifo, mkfs.ext2, mkfs.minix, mkfs.vfat,
mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount,
mountpoint, mpstat, mt, mv, nameif, nbd-client, nc, netstat, nice,
nmeter, nohup, nslookup, ntpd, od, openvt, passwd, patch, pgrep, pidof,
ping, ping6, pipe_progress, pivot_root, pkill, pmap, popmaildir,
poweroff, powertop, printenv, printf, ps, pscan, pstree, pwd, pwdx,
raidautorun, rdate, rdev, readahead, readlink, readprofile, realpath,
reboot, reformime, remove-shell, renice, reset, resize, rev, rm, rmdir,
rmmod, route, rpm, rpm2cpio, rtcwake, run-parts, runlevel, runsv,
runsvdir, rx, script, scriptreplay, sed, sendmail, seq, setarch,
setconsole, setfont, setkeycodes, setlogcons, setserial, setsid,
setuidgid, sh, sha1sum, sha256sum, sha512sum, showkey, slattach, sleep,
smemcap, softlimit, sort, split, start-stop-daemon, stat, strings,
stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root, sync,
sysctl, syslogd, tac, tail, tar, tcpsvd, tee, telnet, telnetd, test,
tftp, tftpd, time, timeout, top, touch, tr, traceroute, traceroute6,
true, tty, ttysize, tunctl, ubiattach, ubidetach, ubimkvol, ubirmvol,
ubirsvol, ubiupdatevol, udhcpc, udhcpd, udpsvd, umount, uname,
unexpand, uniq, unix2dos, unlzma, unlzop, unxz, unzip, uptime, users,
usleep, uudecode, uuencode, vconfig, vi, vlock, volname, wall, watch,
watchdog, wc, wget, which, who, whoami, whois, xargs, xz, xzcat, yes,
zcat, zcip
#
Ahora ya estamos en disposicion de poder hacer un backup del firmware del router, para lo cual usaremos la version de busybox que tenemos en el pendrive y comando dd:
# ls -l /dev/mt*
crw-r--r-- 1 1234 root 90, 0 Jul 4 19:51 /dev/mtd0
crw-r--r-- 1 1234 root 90, 2 Jul 4 19:51 /dev/mtd1
brw-r--r-- 1 1234 root 31, 0 Jul 4 19:51 /dev/mtdblock0
brw-r--r-- 1 1234 root 31, 1 Jul 4 19:51 /dev/mtdblock1
brw-r--r-- 1 1234 root 31, 2 Jul 4 19:51 /dev/mtdblock2
brw-r--r-- 1 1234 root 31, 3 Jul 4 19:51 /dev/mtdblock3
brw-r--r-- 1 1234 root 31, 4 Jul 4 19:51 /dev/mtdblock4
brw-r--r-- 1 1234 root 31, 5 Jul 4 19:51 /dev/mtdblock5
brw-r--r-- 1 1234 root 31, 6 Jul 4 19:51 /dev/mtdblock6
brw-r--r-- 1 1234 root 31, 7 Jul 4 19:51 /dev/mtdblock7
Comando para realizar el backup:
# ./busybox-mips dd if=/dev/mtdblock0 of=mtdblock0.bin
11224+0 records in
11224+0 records out
5746688 bytes (5.5MB) copied, 3.679483 seconds, 1.5MB/s
# ls -l
-rwxr-xr-x 1 1234 root 1694608 Jul 4 20:03 busybox-mips
-rwxr-xr-x 1 1234 root 5746688 Jul 4 20:08 mtdblock0.bin
El archivo que se ha creado llamado mtdblock0.bin es el backup del firmware de nuestro router (pendiente de confirmar)
Recopilatorio de entradas tratando este tema aqui