Nice piece of code, found some open ports (at my own computer).
You could use a for loop to loop around all ports from start to end, that's maybe a bit easier to do.
Other then that works fine, found some open ports at my own computer![]()
Nice piece of code, found some open ports (at my own computer).
You could use a for loop to loop around all ports from start to end, that's maybe a bit easier to do.
Other then that works fine, found some open ports at my own computer![]()
I made a new script, check it out!.
Cool script man and very simple too!
I knew about OpenConnection, but I never knew you could specify the port number.![]()
I found a bug: you don't free the connection causing an out of memory error.
I made a new script, check it out!.
*sigh* no one seems to care about memory. Most scripts that involve bitmaps, dtms, forms, connections, or the like, don't free it from memory. They either just don't know or just don't care.
If only Kait freed his form in that tiny form tutorial in the F1 Help in SCAR, many would follow that example. Perhaps it should be mentioned to Freddy.
nice work fromint
Listen to Ron guys, freeing memory is important
although, its not so important in forms because you only run them once, but if you have a procedure that loads a bitmap, but doesnt free, that bitmap will get loaded many times, eventually scar would run out of memory
also be careful because if you port scan a server which isnt your own, it could be considered hostile, so dont do it to http://www.google.com, do it to localhost
Join the Official SRL IRC channel. Learn how to Here.
You see your K := k + 1? Just add FreeConnection(somestuffhere) there.
I made a new script, check it out!.
Nice
A try-except will work fine to free the connection (I also changed your repeat-until to a for loop):
SCAR Code:program Port_Scanner; //by fromint
var x,i,start,finish,k: integer;
target: string;
procedure setup;
begin;
//Setup----->
start:= 1; //Starting port.
finish:= 2000; //End port.
target:= 'www.msi-forums.com'; //Target to scan for open ports.
//Setup----->
k:= 0;
end;
begin
setup;
cleardebug;
writeln('Open Ports');
writeln('------------');
for i := start to finish do
begin
x:= openconnection(target, i, 100);
if (x>-1) then
begin;
writeln(inttostr(i));
k:= k + 1;
try
FreeConnection(x);
except end;
end;
end;
if (k=0) then
begin;
writeln('No open ports were found.');
writeln('');
end;
end.
//by fromint
Interested in C# and Electrical Engineering? This might interest you.
This is a pretty cool idea
I never thought about making a port scanner before. Good job![]()
lol, crazy. Port scanner made in scar. Gj.
There are currently 1 users browsing this thread. (0 members and 1 guests)