|
远程线程注入版获取SYSTEM权限(1)
前段时间写<<eXPloit系列(6)--x86/Windows平台上的缓冲区溢出>>,其间涉及远程 线程注入,想到本篇,返回来补充一点内容。sysproc_now.c并不具备良好的可移植 性,为了区分2000/XP/2003,被迫用GetVersionEx()做精确的OS版本判断。相较之下 远程线程注入更易移植些。 如果试图向winlogon.exe进行远程线程注入,编程时需要指定恰当的WindowStation, 否则可能无法与派生的子进程正常交互。 在MSDN中查看GetProcessWindowStation、GetUserObjectInformation等相关函数。 参看Inside 2K([7])第五章的"Interactive Services"小节。 使用终端服务测试CreateRemoteThread_1.c时,可能得到如下错误信息: "CreateRemoteThread() failed: 存储空间不足,无法处理此命令" 在主控台上测试则一切正常。开始以为是WindowStation的问题,转而动态获取其名 称,错误信息依旧。后来才想起MSDN中有如下信息: Terminal Services isolates each terminal session by design. Therefore, CreateRemoteThread fails if the target process is in a different session than the calling process. 暂不清楚是否有办法解决,如果没有办法解决,那sysproc_now.c还有存在的必要。 -------------------------------------------------------------------------- /* * Copyright (C) 2002, 2012 * The NSFOCUS INFORMATION TECHNOLOGY CO.,LTD. * ----------------------------------------------------------------------- * Author : NSFocus Security Team <security@nsfocus.com> * :  http://www.nsfocus.com * Maintain : scz <scz@nsfocus.com> * Version : 2.02 * Compile : For x86/EWindows XP SP1 & VC 7
|