我即将在运行busybox的DVR设备上获得root权限。我找到了用户登录名/密码之一,并且能够通过 telnet 登录,但仅此而已。我有一个连接的驱动器,它会自动安装,我可以将它插入我的 PC 以添加/减去文件。我复制了 bash 和 busybox 二进制文件(包括其他一些),并给了它们u+s,希望 setuid root 会给我一些 root 权限。不幸的是,这不起作用。运行bash( -rwsr-xr-x),id仍然只显示为用户。出于某种原因,它似乎不尊重 bash 或 busybox(或其他一些)的 setuid 位给我 root 权限。
所以,我有了一个想法,这让我想到了我的问题:也许我可以编译一个小的 C 程序,例如:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
setuid( 0 );
system( "/tmp/rootscript.sh" );
return 0;
}
这也许可以让我以 root 身份运行脚本。不幸的是,在尝试gcc-mips在各种系统上编译各种版本的几天后,我一直无法这样做。这让我问,如果有人已经构建了这些工具,是否会介意为我编译上面的代码。我意识到这是一个奇怪的要求,但我想是这样的。
一些可能有用的信息:
bash-3.00$ cat cpuinfo
system type : Viper
processor : 0
cpu model : MIPS 74Kc V4.12 FPU V0.0
BogoMIPS : 324.40
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0000, 0x0000, 0x0000]
ASEs implemented : mips16 dsp
shadow register sets : 2
core : 0
VCED exceptions : not available
VCEI exceptions : not available
和
file /tmp/bash
/tmp/bash: setuid ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), for GNU/Linux 2.6.12, not stripped
任何人的任何想法或建议?希望这足以作为“逆向工程”帖子!