se for uma das versões micro
do dd-wrt, suas opções são limitadas, pois ssh e scp não estão disponíveis. Eu encontrei uma maneira que é bastante confiável se você tem acesso a uma máquina que você pode usar como um servidor web; copie o arquivo para o servidor web, e wget
ele da caixa dd-wrt:
jcomeau@aspire:~/rentacoder/jcomeau/ddwrt$ dd if=/dev/urandom bs=256 count=1 of=/tmp/test.dat
1+0 records in
1+0 records out
256 bytes (256 B) copied, 0.0012205 s, 210 kB/s
jcomeau@aspire:~/rentacoder/jcomeau/ddwrt$ scp /tmp/test.dat unixshell.jcomeau.com:/var/www/jcomeau/
test.dat 100% 256 0.3KB/s 00:00
jcomeau@aspire:~/rentacoder/jcomeau/ddwrt$ telnet 192.168.151.1
Trying 192.168.151.1...
Connected to 192.168.151.1.
Escape character is '^]'.
DD-WRT v24-sp2 micro (c) 2009 NewMedia-NET GmbH
Release: 10/10/09 (SVN revision: 13064)
plinksys login: root
Password:
==========================================================
____ ___ __ ______ _____ ____ _ _
| _ \| _ \ \ \ / / _ \_ _| __ _|___ \| || |
|| | || ||____\ \ /\ / /| |_) || | \ \ / / __) | || |_
||_| ||_||_____\ V V / | _ < | | \ V / / __/|__ _|
|___/|___/ \_/\_/ |_| \_\|_| \_/ |_____| |_|
DD-WRT v24-sp2
http://www.dd-wrt.com
==========================================================
BusyBox v1.13.4 (2009-10-10 04:23:29 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
\u@\h:\w\$ cd /tmp
\u@\h:\w\$ wget http://unixshell.jcomeau.com/test.dat
Connecting to unixshell.jcomeau.com (207.210.74.124:80)
\u@\h:\w\$ wc test.dat
0 6 256 test.dat
\u@\h:\w\$
para fazer o oposto, isto é, baixar um binário do roteador, pode-se fazer uso do diretório / tmp / www, que é mapeado para / user pelo daemon dd-wrt httpd
. use uma extensão .gif
para garantir que o httpd não faça qualquer tentativa de modificá-lo (como faria com uma extensão .asp
).
jcomeau@aspire:~/rentacoder/jcomeau/ddwrt$ telnet 192.168.151.1
Trying 192.168.151.1...
Connected to 192.168.151.1.
Escape character is '^]'.
DD-WRT v24-sp2 micro (c) 2009 NewMedia-NET GmbH
Release: 10/10/09 (SVN revision: 13064)
plinksys login: root
Password:
==========================================================
____ ___ __ ______ _____ ____ _ _
| _ \| _ \ \ \ / / _ \_ _| __ _|___ \| || |
|| | || ||____\ \ /\ / /| |_) || | \ \ / / __) | || |_
||_| ||_||_____\ V V / | _ < | | \ V / / __/|__ _|
|___/|___/ \_/\_/ |_| \_\|_| \_/ |_____| |_|
DD-WRT v24-sp2
http://www.dd-wrt.com
==========================================================
BusyBox v1.13.4 (2009-10-10 04:23:29 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
\u@\h:\w\$ wc /dev/mtd/*
751 12148 262144 /dev/mtd/0
751 12148 262144 /dev/mtd/0ro
11671 68047 3866624 /dev/mtd/1
11671 68047 3866624 /dev/mtd/1ro
4306 24098 1098752 /dev/mtd/2
4306 24098 1098752 /dev/mtd/2ro
0 551 65536 /dev/mtd/3
0 551 65536 /dev/mtd/3ro
4640 29046 2097152 /dev/mtd/4
4640 29046 2097152 /dev/mtd/4ro
42736 267780 14780416 total
\u@\h:\w\$ cp /dev/mtd/0ro /tmp/www/cfe.gif
\u@\h:\w\$ Connection closed by foreign host. [after typing Ctrl-D]
jcomeau@aspire:~/rentacoder/jcomeau/ddwrt$ wget -O/tmp/cfe.bin http://192.168.151.1/user/cfe.gif
--2014-06-15 23:53:54-- http://192.168.151.1/user/cfe.gif
Connecting to 192.168.151.1:80... connected.
HTTP request sent, awaiting response... 200 Ok
Length: 262144 (256K) [image/gif]
Saving to: ‘/tmp/cfe.bin’
100%[======================================>] 262,144 963KB/s in 0.3s
2014-06-15 23:53:54 (963 KB/s) - ‘/tmp/cfe.bin’ saved [262144/262144]