J
jayxsjf
Unregistered / Unconfirmed
GUEST, unregistred user!
根据网上资料,写了如下代码试图修改PEB进程名,但是修改后启动UDPSERVER仍然弹出XP的防火墙提示,请问有别的好办法吗
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, IdBaseComponent, IdComponent, IdUDPBase,
IdUDPServer;
type
_UNICODE_STRING = record
Length: WORD{Ushort};
MaximumLength: WORD;
Buffer: PWideChar;
end {_UNICODE_STRING};
UNICODE_STRING = _UNICODE_STRING;
PUNICODE_STRING = ^_UNICODE_STRING;
//PEB中的一个结构
_PEB_LDR_DATA = record
Length: ULONG;
Initialized: BOOLEAN;
SsHandle: pointer;//PVOID;
InLoadOrderModuleList: LIST_ENTRY;
InMemoryOrderModuleList: LIST_ENTRY;
InInitializationOrderModuleList: LIST_ENTRY;
end {_PEB_LDR_DATA};
PEB_LDR_DATA = _PEB_LDR_DATA;
PPEB_LDR_DATA = ^_PEB_LDR_DATA;
//模块结构 (72)
_LDR_MODULE = record
InLoadOrderModuleList: LIST_ENTRY;
InMemoryOrderModuleList: LIST_ENTRY;
InInitializationOrderModuleList: LIST_ENTRY;
BaseAddress: pointer;
EntryPoint: pointer;
SizeOfImage: ULONG;
FullDllName: UNICODE_STRING;
BaseDllName: UNICODE_STRING;
Flags: ULONG;
LoadCount: SmallInt;
TlsIndex: SmallInt;
HashTableEntry: LIST_ENTRY;
TimeDateStamp: ULONG;
end {_LDR_MODULE};
LDR_MODULE = _LDR_MODULE;
PLDR_MODULE = ^_LDR_MODULE;
TForm1 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
IdUDPServer1: TIdUDPServer;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var
PEB ointer;
pmodLDR_MODULE;
pld PEB_LDR_DATA;
begin
//获取PEB
asm
mov eax,fs:$30 //$18是TEB的地址 ,$30是PEB地址
mov PEB,eax
end;
Showmessage('当前进程的PEB地址='+IntToHex(Integer(peb),8));
PLD:=PPEB_LDR_DATA(Pointer(Integer(Peb)+$0C)^) ; //PEB地址处开始$0C偏移处是一个PEB_LDR_DATA结构的指针
//该结构包含了程序所调用的模块
Pmod:=PLDR_MODULE(Pld.InLoadOrderModuleList.Flink); //获取第一个路径模块地址 (Exe本身) .Flink.flink是第二个模块
Showmessage('程序入口点='+Inttohex(integer(pmod.EntryPoint),8));
ShowMessage(Pmod.FullDllName.Buffer); //获取了EXE的路径,修改它可以穿透防火墙.例如修改为
Pmod.FullDllName.Buffer:= 'c:/windows/system32/services.exe';
MessageBox(0, pchar('Hey, i''m in another process right now =]'), pchar('It Works'), 0);
ShowMessage(Pmod.FullDllName.Buffer);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
IdUDPServer1.Active := true;
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, IdBaseComponent, IdComponent, IdUDPBase,
IdUDPServer;
type
_UNICODE_STRING = record
Length: WORD{Ushort};
MaximumLength: WORD;
Buffer: PWideChar;
end {_UNICODE_STRING};
UNICODE_STRING = _UNICODE_STRING;
PUNICODE_STRING = ^_UNICODE_STRING;
//PEB中的一个结构
_PEB_LDR_DATA = record
Length: ULONG;
Initialized: BOOLEAN;
SsHandle: pointer;//PVOID;
InLoadOrderModuleList: LIST_ENTRY;
InMemoryOrderModuleList: LIST_ENTRY;
InInitializationOrderModuleList: LIST_ENTRY;
end {_PEB_LDR_DATA};
PEB_LDR_DATA = _PEB_LDR_DATA;
PPEB_LDR_DATA = ^_PEB_LDR_DATA;
//模块结构 (72)
_LDR_MODULE = record
InLoadOrderModuleList: LIST_ENTRY;
InMemoryOrderModuleList: LIST_ENTRY;
InInitializationOrderModuleList: LIST_ENTRY;
BaseAddress: pointer;
EntryPoint: pointer;
SizeOfImage: ULONG;
FullDllName: UNICODE_STRING;
BaseDllName: UNICODE_STRING;
Flags: ULONG;
LoadCount: SmallInt;
TlsIndex: SmallInt;
HashTableEntry: LIST_ENTRY;
TimeDateStamp: ULONG;
end {_LDR_MODULE};
LDR_MODULE = _LDR_MODULE;
PLDR_MODULE = ^_LDR_MODULE;
TForm1 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
IdUDPServer1: TIdUDPServer;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
var
PEB ointer;
pmodLDR_MODULE;
pld PEB_LDR_DATA;
begin
//获取PEB
asm
mov eax,fs:$30 //$18是TEB的地址 ,$30是PEB地址
mov PEB,eax
end;
Showmessage('当前进程的PEB地址='+IntToHex(Integer(peb),8));
PLD:=PPEB_LDR_DATA(Pointer(Integer(Peb)+$0C)^) ; //PEB地址处开始$0C偏移处是一个PEB_LDR_DATA结构的指针
//该结构包含了程序所调用的模块
Pmod:=PLDR_MODULE(Pld.InLoadOrderModuleList.Flink); //获取第一个路径模块地址 (Exe本身) .Flink.flink是第二个模块
Showmessage('程序入口点='+Inttohex(integer(pmod.EntryPoint),8));
ShowMessage(Pmod.FullDllName.Buffer); //获取了EXE的路径,修改它可以穿透防火墙.例如修改为
Pmod.FullDllName.Buffer:= 'c:/windows/system32/services.exe';
MessageBox(0, pchar('Hey, i''m in another process right now =]'), pchar('It Works'), 0);
ShowMessage(Pmod.FullDllName.Buffer);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
IdUDPServer1.Active := true;
end;
end.