Advertisement
Guest User

Port Scanner

a guest
Aug 28th, 2016
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.47 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #
  3. # C0d3d : 1337r00t
  4. #
  5. #####################
  6. use IO::Socket;
  7.  
  8. print "\n
  9.     ___________________________
  10.    !\_________________________/!\
  11.    !!                         !! \
  12.    !!      Port Scanner       !!  \
  13.    !!                         !!  !
  14.    !!    Coder : 1337r00t     !!  !
  15.    !!                         !!  !
  16.    !!  Instagram : 1337r00t   !!  !
  17.    !!                         !!  !
  18.    !!    Twitter: 1337r00t    !!  !
  19.    !!                         !!  !
  20.    !!   We Love Saudi Arabia  !!  /
  21.    !!_________________________!! /
  22.    !/_________________________\!/
  23.       __\_________________/__/!_
  24.      !_______________________!/
  25.    ________________________
  26.   /oooo  oooo  oooo  oooo /!
  27.  /ooooooooooooooooooooooo/ /
  28. /ooooooooooooooooooooooo/ /
  29. /C=_____________________/_/
  30.                    
  31.                     Note : (CRTL + C) = Exit \n";
  32. print "\n\n";
  33. print "\n\n";
  34. $| = 1;
  35. print qq(
  36.             Enter Target Or IP :
  37.             > );
  38. $target=<STDIN>;
  39. chomp($target);
  40. print qq(
  41.             Enter Start Port :
  42.             > );
  43. $start=<STDIN>;
  44. chomp($start);
  45. print qq(
  46.             Enter End Port :
  47.             > );
  48. $end=<STDIN>;
  49. chomp($end);
  50. foreach ($port = $start ; $port <= $end ; $port++)
  51. {
  52.     print "\r   Scanning port $port";
  53.     $socket = IO::Socket::INET->new(PeerAddr => $target , PeerPort => $port , Proto => 'tcp' , Timeout => 1);
  54.     if( $socket )
  55.     {
  56.         print "\r   { Port : $port is opened }\n" ;
  57.     }
  58.     else
  59.     {
  60.     }
  61. }
  62. print "\n\nFinished $target\n";
  63. exit (0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement