Tutor Injek pemula
1. Delphi 7
2.Komponen delphi Indy
3.Komponen delphi AlphaSkin (untuk mempercantik tampilan)
Sebelum belajar membuat inject sendiri pastikan komponen-komponen ini terinstall di Delphi 7
Komponen utama TCPindy
idMapperdPort
Komponen mempercanti tampilan : sSkinManager dan sSkinProvider
AlphaSkin
Source code yang di pelajari :
------------------------------------------------------------------------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPServer, IdMappedPortTCP,
StdCtrls,ComCtrls, Winsock, jpeg, ExtCtrls, sSkinProvider, sSkinManager, acPNG,
sMemo, sCheckBox, sButton, IdIPWatch, ShellAPI, sStatusBar, XPMan,
acImage;
type
TForm1 = class(TForm)
btn1: TButton;
edt2: TEdit;
IdMappedPortTCP1: TIdMappedPortTCP;
proxy: TEdit;
port: TEdit;
sSkinManager1: TsSkinManager;
autoroute: TsCheckBox;
IdIPWatch1: TIdIPWatch;
bar: TsStatusBar;
tmr1: TTimer;
sSkinProvider1: TsSkinProvider;
XPManifest1: TXPManifest;
procedure btn1Click(Sender: TObject);
procedure IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
procedure IdMappedPortTCP1OutboundData(AThread: TIdMappedPortThread);
procedure tmr1Timer(Sender: TObject);
private
mulai:Boolean;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{$R 'RequestAdmin.RES'}
procedure TForm1.btn1Click(Sender: TObject);
var
rt: string;
del: string;
begin
rt := '/C route add 10.1.89.130 mask 255.255.255.255 '+IdIPWatch1.LocalIP;
del := '/C route delete 0.0.0.0';
if Mulai then
begin
IdMappedPortTCP1.Active := False;
IdMappedPortTCP1.Bindings.Clear;
Sleep(100);
btn1.Caption := 'Start';
Mulai := False;
end
else
begin
btn1.Caption := 'Stop';
IdMappedPortTCP1.Bindings.Add.IP := '127.0.0.1';
IdMappedPortTCP1.Bindings.Add.Port := StrToInt(edt2.Text);
IdMappedPortTCP1.MappedHost := proxy.text;
IdMappedPortTCP1.MappedPort := StrToInt(port.Text);
IdMappedPortTCP1.Active := True;
Mulai := True;
if autoroute.Checked = True then
begin
ShellExecute(0, nil, 'cmd.exe', PChar(rt), nil, SW_HIDE);
ShellExecute(0, nil, 'cmd.exe', PChar(del), nil, SW_HIDE);
end;
end;
end;
procedure TForm1.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
var
payload:string;
begin
payload:='HEAD http://bug.opsel.com/ HTTP/1.1' + #10#13 + 'Connection: Keep-alive' + #10#13 + 'Host : bug.opsel.com/' +#10#13#10#13#10#13;
if Pos('HTTP',AThread.NetData)<>0 then
AThread.NetData := AThread.NetData+payload+AThread.NetData;
end;
procedure TForm1.IdMappedPortTCP1OutboundData(
AThread: TIdMappedPortThread);
begin
if Pos (' 302 Found', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(AThread.NetData,' 302 Found',' 200 OK',[rfReplaceAll]);
end;
end;
procedure TForm1.tmr1Timer(Sender: TObject);
begin
bar.Panels[0].Text:=IdIPWatch1.LocalIP;
bar.Panels[1].Text:=IdIPWatch1.LocalName;
bar.Panels[2].Text:=TimeToStr(Now);
end;
end.
1. Delphi 7
2.Komponen delphi Indy
3.Komponen delphi AlphaSkin (untuk mempercantik tampilan)
Sebelum belajar membuat inject sendiri pastikan komponen-komponen ini terinstall di Delphi 7
Komponen utama TCPindy
idMapperdPort
Komponen mempercanti tampilan : sSkinManager dan sSkinProvider
AlphaSkin
Source code yang di pelajari :
------------------------------------------------------------------------------------------------------------
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPServer, IdMappedPortTCP,
StdCtrls,ComCtrls, Winsock, jpeg, ExtCtrls, sSkinProvider, sSkinManager, acPNG,
sMemo, sCheckBox, sButton, IdIPWatch, ShellAPI, sStatusBar, XPMan,
acImage;
type
TForm1 = class(TForm)
btn1: TButton;
edt2: TEdit;
IdMappedPortTCP1: TIdMappedPortTCP;
proxy: TEdit;
port: TEdit;
sSkinManager1: TsSkinManager;
autoroute: TsCheckBox;
IdIPWatch1: TIdIPWatch;
bar: TsStatusBar;
tmr1: TTimer;
sSkinProvider1: TsSkinProvider;
XPManifest1: TXPManifest;
procedure btn1Click(Sender: TObject);
procedure IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
procedure IdMappedPortTCP1OutboundData(AThread: TIdMappedPortThread);
procedure tmr1Timer(Sender: TObject);
private
mulai:Boolean;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
{$R 'RequestAdmin.RES'}
procedure TForm1.btn1Click(Sender: TObject);
var
rt: string;
del: string;
begin
rt := '/C route add 10.1.89.130 mask 255.255.255.255 '+IdIPWatch1.LocalIP;
del := '/C route delete 0.0.0.0';
if Mulai then
begin
IdMappedPortTCP1.Active := False;
IdMappedPortTCP1.Bindings.Clear;
Sleep(100);
btn1.Caption := 'Start';
Mulai := False;
end
else
begin
btn1.Caption := 'Stop';
IdMappedPortTCP1.Bindings.Add.IP := '127.0.0.1';
IdMappedPortTCP1.Bindings.Add.Port := StrToInt(edt2.Text);
IdMappedPortTCP1.MappedHost := proxy.text;
IdMappedPortTCP1.MappedPort := StrToInt(port.Text);
IdMappedPortTCP1.Active := True;
Mulai := True;
if autoroute.Checked = True then
begin
ShellExecute(0, nil, 'cmd.exe', PChar(rt), nil, SW_HIDE);
ShellExecute(0, nil, 'cmd.exe', PChar(del), nil, SW_HIDE);
end;
end;
end;
procedure TForm1.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
var
payload:string;
begin
payload:='HEAD http://bug.opsel.com/ HTTP/1.1' + #10#13 + 'Connection: Keep-alive' + #10#13 + 'Host : bug.opsel.com/' +#10#13#10#13#10#13;
if Pos('HTTP',AThread.NetData)<>0 then
AThread.NetData := AThread.NetData+payload+AThread.NetData;
end;
procedure TForm1.IdMappedPortTCP1OutboundData(
AThread: TIdMappedPortThread);
begin
if Pos (' 302 Found', AThread.NetData) <>0 then begin
AThread.NetData := StringReplace(AThread.NetData,' 302 Found',' 200 OK',[rfReplaceAll]);
end;
end;
procedure TForm1.tmr1Timer(Sender: TObject);
begin
bar.Panels[0].Text:=IdIPWatch1.LocalIP;
bar.Panels[1].Text:=IdIPWatch1.LocalName;
bar.Panels[2].Text:=TimeToStr(Now);
end;
end.