Results 1 to 9 of 9

Thread: Port Scanner

  1. #1
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    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!.

  2. #2
    Join Date
    Apr 2006
    Location
    I live in NH
    Posts
    611
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Cool script man and very simple too!

    I knew about OpenConnection, but I never knew you could specify the port number.

  3. #3
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    I found a bug: you don't free the connection causing an out of memory error.
    I made a new script, check it out!.

  4. #4
    Join Date
    Apr 2006
    Location
    I live in NH
    Posts
    611
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    *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.

  5. #5
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    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.

  6. #6
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    You see your K := k + 1? Just add FreeConnection(somestuffhere) there.
    I made a new script, check it out!.

  7. #7
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    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.

  8. #8
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    This is a pretty cool idea

    I never thought about making a port scanner before. Good job

  9. #9
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, crazy. Port scanner made in scar. Gj.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Scar Port Scanner
    By fromint in forum First Scripts
    Replies: 3
    Last Post: 01-04-2009, 03:29 AM
  2. How to Port Forward
    By kingarabian in forum Computer Help and Tutorials
    Replies: 16
    Last Post: 11-26-2008, 02:03 AM
  3. port forwarding.....
    By sk8terbitu in forum News and General
    Replies: 2
    Last Post: 06-30-2008, 09:31 PM
  4. [PHP] Port Scanner.
    By Frederick in forum General
    Replies: 0
    Last Post: 04-21-2008, 04:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •