
我的數據機有一個 telnet 端口,當我登入該端口時,我會在設備中獲得 root shell。命令非常有限,但設備中有空白空間。我可以在該設備上安裝 nmap 之類的東西嗎?沒有套件管理器,我猜這個系統正在 init 1 運作。
# cat /proc/partitions
major minor #blocks name
31 0 128 mtdblock0
31 1 64 mtdblock1
31 2 64 mtdblock2
31 3 1152 mtdblock3
31 4 6784 mtdblock4
31 5 8192 mtdblock5
# uname -a
Linux Air5453 2.6.30 #1 Wed Dec 3 18:43:00 EET 2014 mips GNU/Linux
# free
total used free shared buffers
Mem: 59456 35008 24448 0 4048
Swap: 0 0 0
Total: 59456 35008 24448
# busybox
BusyBox v1.14.1 (2014-12-03 18:47:37 EET) multi-call binary
Copyright (C) 1998-2008 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Usage: busybox [function] [arguments]...
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:
[, [[, arp, ash, basename, blkid, cat, chmod, cp, cut, date, depmod,
dhcprelay, dmesg, dumpleases, echo, egrep, eject, false, fgrep,
findfs, free, ftpd, fuser, getty, grep, halt, hostname, httpd,
ifconfig, init, inotifyd, insmod, kill, killall, klogd, ln, login,
ls, lsmod, lzmacat, makedevs, mdev, mkdir, mkdosfs, mkfs.vfat,
modprobe, mount, mv, pidof, ping, poweroff, ps, pwd, reboot, rm,
rmmod, route, sh, sleep, tar, telnetd, test, tftp, top, touch,
traceroute, true, udhcpc, udhcpd, umount, uname, unlzma, uptime,
vconfig, wget, which
我也可以在該裝置上安裝 dropbear 嗎?
# clear
-sh: clear: not found
# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /var type ramfs (rw,relatime)
ramfs on /dev type ramfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
none on /proc/bus/usb type usbfs (rw,relatime)
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro,relatime 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
ramfs /var ramfs rw,relatime 0 0
ramfs /dev ramfs rw,relatime 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
none /proc/bus/usb usbfs rw,relatime 0 0
答案1
從指令的輸出來看,所有以讀寫方式掛載的檔案系統都是臨時檔案系統,沒有非揮發性記憶體的支援。/dev/root
可能是到其中一個設備的符號鏈接mtdblockX
,其他分區可能用於引導程式和配置。雖然如果您以讀寫方式重新安裝它,可能會有一些可用空間,nmap
但幾兆位元組大已經,更不用說它的依賴性了,即使有可用空間,也不太可能適合您的設備。
您的裝置似乎支援 USB。根據您對「安裝」的定義,解決方案是安裝一個預先填充了您想要運行的二進位檔案的 USB 隨身碟,甚至使用可用的檔案ftpd
來遠端修改其內容。
困難的部分是取得將在您的裝置上運行的軟體。您需要為裝置中的 MIPS 處理器編譯的版本,因此可能需要交叉編譯或尋找已為您的裝置(或具有相容處理器、核心、libc 等的裝置)編譯的二進位檔案。