Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Feb : Help with "portscanner"
| Subject: | Help with "portscanner" |
| Posted by: | "AciD" (acid.r..@gmail.com) |
| Date: | Fri, 18 Feb 2005 12:11:31 |
Hello all.
Ive been working on a "portscanner", to check if ports are open on a remote
coputer, but it doesnt work as i want it to. My problem is that it scans
very slowly. Is there any way to tweak/improve the code i made ?
Any sugestions are welcomed :-)
heres the connect procedure:
procedure TForm1.ClientSocket1Connect(Sender: TObject;
Socket: TCustomWinSocket);
begin
listbox1.Items.add('[*]Port ' + inttostr(portx) + ' open[*]');
portX := portX + 1;
with clientsocket1 do begin
Active :=false;
Address :=edit1.Text;
Host :=edit1.Text;
Port := portX;
label2.Caption :='Scanner port: ' + inttostr(clientsocket1.Port);
Active :=true;
end;
end;
and the onerror procedure:
procedure TForm1.ClientSocket1Error(Sender: TObject; Socket:
TCustomWinSocket;
ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
errorcode :=0;
listbox1.Items.add('Port ' + inttostr(portX) + ' closed);
portX := portX + 1;
with clientsocket1 do begin
Active :=false;
Address :=edit1.Text;
Host :=edit1.Text;
Port := portX;
label2.Caption :='Scanning port: ' + inttostr(clientsocket1.Port);
Active :=true;
end;
end;
Regards
Anders