DNS IP - Port

By Neo on May 04, 2004

This is DNS IP - Port Snippet! This Snippet Will Check All Address's That You Will Set! And Only The Ports Between 0 And 255 Will Work ( 1.....254 ) - [Syntax]: /ipscan IP FINALPORT - [Example]: /ipscan 127.0.0.1 80 - Check It Out!

;DNS IP - Port
;By Neo
;Copyright 2004
;This Snippet Will Check All Address's That You Will Set! 
;Only The Ports Between 0 And 255 Will Work ( 1.....254 ) 
;Syntax: /ipscan IP FINALPORT 
;Example: /ipscan 127.0.0.1 80
;To Check Ip Use: $ipcheck(iphere), Returns 1 If It's Valid And 0 If The Ip It's Invalid

alias ipcheck {
  if ($numtok($1,46) == 4) {
    var %ip.nu = 1
    while ($gettok($1,%x,46)) {
      if ($ifmatch !isnum 0-255) { return 0 | break }
      else inc %ip.nu
    }
    return 1
  }
}

alias ipscan {
  if ($1 != $null) {
    if ($ipcheck($1) == 1) {
      var %p.check = 1
      while (%p.check <= $iif($2 != $null,$2,254)) {
        sockopen p.scan $+ %p.check $+($deltok($1,4,46),.,%p.check) 1
        inc %p.check
      }
    }
  }
}
alias r.scan { .dns $sock($sockname).ip }
on *:sockopen:p.scan*:{
  set %r.scan $+ $sockname $sock($sockname).ip > $right($sock($sockname).wsmsg,$calc($len($sock($sockname).wmsg) - 8))
  $iif(refused isin $right($sock($sockname).wsmsg,$calc($len($sock($sockname).wmsg) - 8)),r.scan)
  if ($sock($sockname).status == active) {
    echo -a $sock($sockname).ip
    .dns $sock($sockname).ip
    sockclose $sockname
  }
}
on *:sockclose:p.scan*:{
  echo -a $sock($sockname).ip
  .dns $sock($sockname).ip
}
on *:dns:{
  var %n = $dns(0)
  echo -a $chr(91) $+ 4DNS Data $+ $chr(93) 4DNS12: $dns(%n) $iif($dns(%n).nick != $null,nick: $dns(%n).nick,) addr: $dns(%n).addr ip: $dns(%n).ip
  halt
}
else {
  echo 4 Found %n addresses
  echo 4 4DNS12:  $dns(%n) nick: $dns(%n).nick addr: $dns(%n).addr 4IP12:  $dns(%n).ip
}

Comments

Sign in to comment.
M[n]M   -  Jan 07, 2008

but ... i have no idea hwo to use it i am sorry dude... some kinda numbers are juts coming up...?

 Respond  
Neo   -  May 04, 2004

All Comments Are Welcome! - If You Want To Compliment Me Something Than Private Msg Me! This Window Is For Compliments About The Script, How You Like It, Bugs, Etc.... Otherwise PrivMsg Me! Thanks, Neo

 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.