Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias pcheck {
- if (!$1) { echo 4 -agte * /pcheck: Error, Please specify a Host or IP Address! | return }
- if (!$2) || ($2 !isnum) { echo 4 -agte * /pcheck: Error, Invalid Port number! | return }
- 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))
- if ($sock(chk_*,0)) { sockclose chk_* }
- if ($iptype($1) == ipv4) { sockopen -n4 chk_plain $1 $2 }
- elseif ($iptype($1) == ipv6) { sockopen -n6 chk_plain $1 $2 }
- else { sockopen -n chk_plain $1 $2 }
- sockmark chk_plain $1
- }
- alias -l bold { return $+($chr(2),$1-,$chr(2)) }
- ON *:SOCKOPEN:chk_plain: {
- if ($sockerr > 0) {
- if ($iptype($sock($sockname).ip) == ipv4) { sockopen -ne4 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 0 }
- elseif ($iptype($sock($sockname).ip) == ipv6) { sockopen -ne6 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 0 }
- return
- }
- if ($iptype($sock($sockname).ip) == ipv4) { sockopen -ne4 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 1 }
- elseif ($iptype($sock($sockname).ip) == ipv6) { sockopen -ne6 chk_tls $sock($sockname).ip $sock($sockname).port | sockmark chk_tls $sock($sockname).mark 1 }
- sockclose $sockname
- }
- ON *:SOCKOPEN:chk_tls: {
- 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 }
- if ($gettok($sock($sockname).mark,2,32)) { var %o = $addtok(%o,PLAIN,32) }
- echo -agtec info2 * /pcheck: IP/Host: $bold($gettok($sock($sockname).mark,1,32)) - Port $sock($sockname).port Status: $bold($iif(%o,%o TLS,Closed))
- sockclose $sockname
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement