LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-10-2008, 10:02 PM   #1
jack89
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
D-Link Router Telnet - BusyBox v1, need help to manipulate files


Hi,

I've managed to get inside my WBR1310 router via telnet. The first thing I notice: it's running BusyBox v1.00. Driven by curiosity, I decide to explore a bit, mostly in the www folder.

Now, is there a way I could manipulate files in at least one of the following manner?
- Edit files (doesn't seem to have a file editor such as vi)
- Dump files to an other computer in the network
- Import files from the Internet or a local computer

The way it is now, I can only view files (with cat) but not modify them.

Here is the list of the commands it understands:
Code:
\[             dirname        killall        reboot         tlogs 
asession       dnrd           klogd          rgbin          touch 
atp            dyndns         ln             rgcfg          tr 
basename       echo           logger         rgdb           trigger 
bdtool         egrep          login          rm             true 
bpalogin       false          ls             rmmod          udhcpc 
brctl          fgrep          lsmod          route          udhcpd 
busybox        free           mfc            runtimed       umount 
cabletest\:1   fresetd        mkdir          scut           uname 
cabletest\:2   gethostip      mknod          sed            upnpd 
cabletest\:3   grep           modprobe       sh             uptime 
cabletest\:4   gunzip         mount          sleep          vconfig 
cabletest\:5   gzip           msh            slinktype      wan 
cat            hnap           mv             smtpclient     wc 
chmod          hostapd        ntpclient      stats          wlanconfig 
chnet          httpd          pfile          submit         wlxmlpatch 
cp             ifconfig       ping           switch         xgi 
ctest          init           portt          sys            xmldb 
cut            insmod         pppd           syslog         yes 
date           iptables       ps             syslogd        zcat 
dayconvert     iwconfig       psts           telnetd 
dhcpxmlpatch   iwpriv         ptgen          test 
diagnostic     kill           pwd            time
Any help is greatly appreciated!
Thank you.
jack89
 
Old 11-10-2008, 10:52 PM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
you can use echo or cat to create or append files (well actually any of the tools will do that since its really the > & >> that are creating/appending). you can use sed, tr, cut, grep, egrep to "edit" existing files. make sure you backup the original file before trying to "edit" them (cp is great for that). It's more tedious then when you have an editor, but with those tools you can pretty much make any edit you'd care to.

some examples:
cat > filename ; this will let you add as many lines as you want to a new file, type Ctrl-D to finish
cat >> filename ; same thing but appends instead of creating.
echo "simple content" > filename
echo "simple content" >> filename

removing a line from a file (sed probably has a nice inline thing, but might not under busybox)
mv in_file in_file.tmp
grep -v "offending content" in_file.tmp > in_file

remove 3rd line from file
mv in_file in_file.tmp
sed {3d} in_file.tmp > in_file

and so on...
 
Old 11-11-2008, 08:00 AM   #3
jack89
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Wow thank you for this perfect answer!
 
Old 11-11-2008, 04:14 PM   #4
jack89
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
...Just tried,

'Read-Only file system', of course. Any way to bypass this?
 
Old 11-11-2008, 05:40 PM   #5
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
probably not, you could try remounting it rw, but I'm guessing its a read-only fs image like cramfs or squashfs

mount -o remount,rw /
 
Old 11-27-2008, 08:14 AM   #6
chef_boyardy
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
Noob real deal

Hey I hate to sound like a noob, but I am desperately trying to telnet into the same router that you have. Is there a way I can find out what user account and password can telnet into my router? is there a default d-link username and password?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: CLI Magic: Using GNOMEvfs to manipulate files LXer Syndicated Linux News 0 04-08-2008 08:40 AM
Small Linux Router/firewall behind D-Link Hardware router dleidlein Linux - Networking 6 04-30-2007 05:12 AM
WPA works with D-Link Router, but not Belkin Router Bladesonfire Linux - Wireless Networking 0 10-07-2006 04:15 PM
Manipulate .ISO files in Linux????? Garrett_80 Linux - Software 3 12-15-2004 09:53 AM
What's the purpose of tar.gz files and how do I manipulate them? altair401 Linux - Newbie 7 12-21-2003 07:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration