Forum Thread: Home Router Command Line??

Home Router Command Line??

OK,

so I understand that router are linux embedded devices, but the commands are different cause they use mips, mipsel, arm, etc.....and I have been on google trying to research if I could learn the command line for theses different types of routers....I guess more specifically my questions would be how to find out if the router is usings mips, mipsel or arm..etc... because I know for a fact that using uname -m or uname -a doesn't tell you anything so the commands have to be different don't they??

14 Responses

depends on the device and how you connect to it.

So what device and how did you connect to it?

you can search openwrt,tomato

I am not exactly sure the device, but I would be connected to it thru ssh.....this is my problem is that I can't find a good tutrorials that tells me how to use the commands to find out the architecture of the routers that I connect through with ssh and of course I have permission to do so I am doing a research of routers and malware, but its kind of difficult when I don't no what version firmware or if the router is running mips or mispel or arm etc...thank you

Assuming that it is a Linux system (it could be something else), check /proc/cpuinfo. You can also download one of the binaries from the router and run file on your computer. That should tell you the processor type.

Also take a look to dmesg output. You should find everything you need there.

I tried to write a more extended reply this morning, but my messages never made it through. Note that the system architecture is not directly related to the commands you can execute on the device. You have to look into the operating system

thank you it seem like when i access the router through ssh I am limited to as what I can do even if i access router through root:root some commands just don't work and I assume its because it different when it runs mips or mipsel or arm etc...its not like its running just linux... anyways thank you....also how do I download the binary from the router through ssh??

Use scp

$ scp root@router-ip:/path-to-a-executable-file .

Which command does not work?. Did you checked if the executable you want to use is available in the router?. For instance, uname should be in /bin it does not matter which processor you are using. If the program is not there (it is usually a link to busybox) then you cannot run it.

hey picoflamingo do you know of any good tutorials or guides on routers and malware? like having ssh access to the router and cross compiling a back door and dropping it on the router??

Hi John.

I think you had already read my tutorial, and it is not enough.

Take a look to the material from Free Electrons , they have great information on embedded Linux... that is what you are really dealing with.

Ah yes I have read your tutorial and that is what kinda inspired me to work on the things I have been working on.....Ah I just wish I had a little more knowledge on what I have been working on.....anyways thanks again for you help

also just to clear this up any router with ssh access can be backdoor?

correct?? for the backdoor to work it just has to be cross compiled to its correct os and give executable permissions to run is this correct??

As stated above, a router is just a computer. If it runs any vulnerable services that can be exploited then it can be compromised.

Having ssh access as a normal user does not make a big difference. It just will allow you to also run local exploits.

If you have ssh root access to the machine, then you can do whatever you want... as in any other machine.

Alternatively. Having access to the router control panel will allow an attacher to start a service and enable ssh root access. So it is as important to secure your router control panel as to secure your ssh connection

When you're logged in with SSH, try 'whoami'. If it the answer is 'root' then you're good to go. If it's not you might want to try hardware hacking it, by connecting to it trough UART and perhaps change some settings in the booter (Probably U-Boot). Or get root access directly.

Be aware that when you mess this up, or even when you don't mess this up, you might kill the device.

lol I don't have physical access to the device, but I do have permission to do this.... also I found out that cat /proc/cpuinfo works of catv /proc/cpuinfo.....but first you need to cd proc before you do all this.....by the way if anyone know where I can find a tutorial describing how to build a mips cross compiler that would be awesome....I know thats a little off topic......

Share Your Thoughts

  • Hot
  • Active