Checkport

By _Dean_ on Jan 28, 2011

• Copy and paste the code into a new remote page alt+r

type !checkport N
where N is a valid number

[22:58:29] <~Teen> !checkport 23
[22:58:30] <&Botname> checking port 23 ...
[22:58:30] <~Teen> !checkport 22
[22:58:31] <&Botname> checking port 22 ...
[22:58:32] <&Botname> Port 22: ssh 22/tcp SSH Remote Login Protocol
[22:58:33] <&Botname> Port 23: telnet 23/tcp Telnet

NOTE: this script will only return whats is on site, its just a ''resume'' of what this port is made for
there is some ''private'' ports that probably there is not on the site list

This script dont has flood protection, i made without it, to get many requests at same time

on $*:text:/^!checkport\s(\d+)$/iS:#:{
  var %x $+(checkports,$regml(1))
  if ($sock(%x)) return
  sockopen %x good-stuff.co.uk 80 
  sockmark %x $regml(1) #
  msg # checking port $regml(1) ...
}

on *:Sockopen:checkports*:{
  if ($sockerr) { msg $gettok($sock($sockname).mark,2,32) 4ERROR: a conection error happenned $sock($sockname).wsmsg | return }
  else { 
    var %x sockwrite -n $sockname
    %x GET /useful/portfull.php HTTP/1.1
    %x Host: good-stuff.co.uk
    %x $crlf
  }
}
on *:sockread:checkports*:{
  var %checks,%z $gettok($sock($sockname).mark,1,32), %t msg $gettok($sock($sockname).mark,2,32)
  sockread %checks
  var %y $regex(%checks,/\b $+ %z $+ \/(tc|ud)p\b/) 
  if (%y) {
    %t Port %z $+ : $remove(%checks,$chr(9))
    sockclose $sockname 
  }
  if (</html> isin %checks) && (!%y) {
    %t cannot find the specific port %z
    sockclose $sockname
  }
}

Comments

Sign in to comment.
LGrobert   -  Jan 30, 2011

works fine :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.