您现在的位置: 湖南软件学院CRP网站群 >> 学院动态 >> 网络技术 >> 新闻正文
来源:未知 点击: 添加时间:2007-12-10 8:04:31
在W2K中提升权限的几个攻击实例之成败心得



<==========================Client==============================>
// client.cpp : Defines the entry point for the console application.
//

#include
#include
#include
#include


int main(int argc, char* argv[])
{
char inbuf[80];
char outbuf[80];
DWORD bytesRead;
BOOL ret;
LPSTR lpszPipeName = "\\\\.\\pipe\\simple";
LPSTR lpszString = "World";

strcpy( outbuf, lpszString );

ret = CallNamedPipeA(lpszPipeName,
outbuf, sizeof(outbuf),
inbuf, sizeof(inbuf),
&bytesRead, NMPWAIT_WAIT_FOREVER);

if (!ret) {
printf("client: CallNamedPipe failed for %d\n", GetLastError());
exit(1);
}

printf("client: received: %s\n", inbuf);


return 0;
}


<==============================================================>

FOON编写了一个攻击工具Shatter,大家可以参考他的文章来使用这个工具,而且他的网站上还有Shatter的源程序。这个程序专门攻击象SimpleService这样会创建Window的服务进程,它首先把Window中Edit Control的尺寸(Size)扩大,然后把可执行的黑客码沾贴到Edit中,这样就把黑客码拷贝到这个Window进程的内存中了----很Cool吧!接下来我们就要寻找黑客码在内存中的地址,FOON是用Windbg去寻找这个地址的,详情请参考他的文章。最后Shatter向Window进程发送一个定时执行Message----“WM_TIMER”,迫使Window进程执行刚才拷贝进去的黑客码。这个黑客码是根据jill的黑客码改编而成,它产生一个远程的cmd shell联结回到Client机器上,所以我们可以用鼎鼎有名的netcat程序与它联络。我现在来演示一下使用Shatter攻击SimpleService的过程,看看普通用户“moda”是如何通过Shatter提升权限的:先以普通用户“moda”登录,看看本地Administrators组当前的成员:

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-1999 Microsoft Corp.

D:\MyJob\tool\netcat>net localgroup administrators
Alias name administrators
Comment Administrators have complete and unrestricted access to the
Members

-----------------------------------------------------------------------------
Administrator
The command completed successfully.

本地Administrators组只有Administrator一个成员。我们试一下能不能把“moda”加入到本地Administrators组。

D:\MyJob\tool\netcat>net localgroup administrators /add moda
System error 5 has occurred.

Access is denied.

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页


新闻录入:ics_htj 责任编辑:信息化中心

湖南软件职业学院信息化中心 Ver.2007© 美工:刘国鹂 程序:杨小刚
学院地址:长沙市天心区新开铺路1186号  电话:0731-6938121(传真) 6938122