alias ps { if ($dialog(portscanner) == $null) { dialog -m portscanner portscanner } | else halt }
alias pstimeout { if ($dialog(portscanner)) { did -o portscanner 6 1 $chr(160) $+ Server restricts portscan! | did -e portscanner 1 | .timer49 off | halt } }
dialog portscanner {
title " Server Port Scanner"
size -1 -1 461 240
button "Scan Now", 1, 242 120 209 24, ok default
edit "", 2, 48 10 403 20, disable
text "Server:", 3, 10 13 40 20
list 4, 51 35 135 160
text "Ports:", 5, 17 38 30 20
edit "Created By Aaron18-", 6, 241 33 210 40
text "Status:", 7, 204 37 38 20
edit "", 8, 51 185 55 20, disable
text "Current:", 9, 8 189 40 20
button "Clear", 11, 130 196 35 18, ok default
text "Created by Aaron18-", 12, 310 218 150 20, disable
box "", 13, 49 27 140 202
edit "", 14, 51 206 55 20, disable
text "Fastest:", 15, 8 209 44 20
}
on *:dialog:portscanner:init:*:{
if ($server != $null) { did -f portscanner 1 }
did -m portscanner 6
if ($server == $null) { did -b portscanner 1 | did -b portscanner 4 | did -r portscanner 2 | did -r portscanner 8 | did -o portscanner 6 1 $chr(160) $+ Not connected to server | did -b portscanner 1 | halt }
did -o portscanner 2 1 $chr(160) $+ $server | did -o portscanner 8 1 $port
}
on *:dialog:portscanner:dclick:*:if ($did == 4) { server $server $+ : $+ $did(4,$did(4).sel) }
on *:dialog:portscanner:sclick:*:{
if ($did == 1) { did -b portscanner 1 | did -o portscanner 6 1 $chr(160) $+ Scanning... | .timer49 -o 1 3 pstimeout | did -r portscanner 4 | .enable #statsl | stats l | halt }
if ($did == 11) { did -r portscanner 4 | halt }
}
#statsl on
raw 211:*:{
.timer49 off | if ($dialog(portscanner)) && ($left(4,$right(5,$2)) isnum) {
%ps.tmp = $5 + $7 | set %ps.yn yes | inc %ps.ports 1 | if ($chr(46) isin $left(4,$right(5,$2))) { %ps.ports = %ps.ports - 1 | halt }
did -a portscanner 4 $left(4,$right(5,$2)) - $chr(40) $+ %ps.tmp KB $+ $chr(41)
if %ps.psc == $null { %ps.best = $left(4,$right(5,$2)) | %ps.bp = $5 + $7 | set %ps.psc active }
if (%ps.yn == $null) { if ($dialog(portscanner)) { did -o portscanner 6 1 $chr(160) $+ Server restricts port scan! } | unset %ps.yn | goto end }
if ($dialog(portscanner)) {
if (%ps.ports == $null) { did -o portscanner 6 1 $chr(160) $+ No port list } | if (%ps.ports = 1) { did -o portscanner 6 1 $chr(160) $+ Found %ps.ports Port }
if (%ps.ports > 1) { did -o portscanner 6 1 $chr(160) $+ Found %ps.ports Ports } | goto end
}
:end | did -e portscanner 1 | did -o portscanner 14 1 %ps.best | .disable #statsl | unset %ps.* | halt
}
}
#statsl end
on 1:connect:{
if ($dialog(portscanner)) {
did -e portscanner 1 | did -e portscanner 4 | did -o portscanner 2 1 $chr(160) $+ $server | did -o portscanner 8 1 $port
did -r portscanner 6 | did -o portscanner 6 1 $chr(160) $+ Connected
}
}
on 1:disconnect:{
if ($dialog(portscanner)) {
did -o portscanner 6 1 $chr(160) $+ Not connected to server | did -b portscanner 1 | did -b portscanner 4 | did -r portscanner 2 | did -r portscanner 8 | did -r portscanner 14