Advertisement
westor

Port Checker for Koragg v3.1

Jan 28th, 2021 (edited)
2,456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.87 KB | None | 0 0
  1. alias pcheck {
  2.   if (!$1) { echo 4 -agte * /pcheck: Error, Please specify a Host or IP Address! | return }
  3.   if (!$2) || ($2 !isnum) { echo 4 -agte * /pcheck: Error, Invalid Port number! | return }
  4.  
  5.   echo -agtec info * /pcheck: Scanning $bold($+($1,:,$2)) IP/Host and Port now.. Please wait! - Connection: $bold(TCP) - Type: $bold($iif($iptype($1),$upper($iptype($1)),Host))
  6.  
  7.   if ($sock(chk_*,0)) { sockclose chk_* }
  8.  
  9.   if ($iptype($1) == ipv4) { sockopen -n4 chk_plain $1 $2 }
  10.   elseif ($iptype($1) == ipv6) { sockopen -n6 chk_plain $1 $2 }
  11.   else { sockopen -n chk_plain $1 $2 }
  12.  
  13.   sockmark chk_plain $1
  14. }
  15.  
  16. alias -l bold { return $+($chr(2),$1-,$chr(2)) }
  17.  
  18. ON *:SOCKOPEN:chk_plain: {
  19.   if ($sockerr > 0) {
  20.     if ($iptype($sock($sockname).ip) == ipv4) { sockopen -ne4 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 0 }
  21.     elseif ($iptype($sock($sockname).ip) == ipv6) { sockopen -ne6 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 0 }
  22.  
  23.     return
  24.   }
  25.  
  26.   if ($iptype($sock($sockname).ip) == ipv4) { sockopen -ne4 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 1 }
  27.   elseif ($iptype($sock($sockname).ip) == ipv6) { sockopen -ne6 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 1 }
  28.  
  29.   sockclose $sockname
  30. }
  31.  
  32. ON *:SOCKOPEN:chk_tls: {
  33.   if ($sockerr > 0) { echo -agtec info2 * /pcheck: IP/Host: $bold($gettok($sock($sockname).mark,1,32)) - Port $sock($sockname).port Status: $bold($iif($gettok($sock($sockname).mark,2,32),PLAIN,Closed)) | return }
  34.  
  35.   if ($gettok($sock($sockname).mark,2,32)) { var %o = $addtok(%o,PLAIN,32) }
  36.  
  37.   echo -agtec info2 * /pcheck: IP/Host: $bold($gettok($sock($sockname).mark,1,32)) - Port $sock($sockname).port Status: $bold($iif(%o,%o TLS,Closed))
  38.  
  39.   sockclose $sockname
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement