This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

ip filter format help port scan

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
t
tablarock
Voice
Posts: 9
Joined: Thu Dec 09, 2010 3:02 pm

ip filter format help port scan

Post by tablarock »

I have a problem with this script tcl
Could someone tell me if possible, the bot detects whether text or number
example:

<user> !scan asdasdasdas
<bot> this is not an ip

also I have this problem with colors and antiflood
<user> !scan 123.123.123.123
<bot> Connecting to 123.123.123.123 requested by user
<bot> Connection to 123.123.123.123 has timed out

bot could scan the color?
<user> !scan 123.123.123.123
<bot> Connecting to 123.123.123.123
<bot> Connection to \ 123.123.123.123:2300 accepted. (Port is Open)
<bot> Connection to \ 123.123.123.123:47624 accepted. (Port is Open)

You can do something about the flood
<user> !scan 123.123.123.123
<user> !scan 123.123.123.123
<user> !scan 123.123.123.123
<bot> Ignore for 1 min

Would be very grateful if someone assists me

here the code done by:TCL_no_TK

Code: Select all

set scanports "2300 47624"

bind pub -|- !portscan pub:portscan

proc pub:portscan {nick uhost hand chan text} {
 set address [lindex [split $text] 0]
 putquick "PRIVMSG $chan :Connecting to \037$address\037 requested by \002$nick\002"
 portscan "$address" "$chan"
}

proc portscan {address chan} {
 global scanports
  foreach f $scanports {
   if {[catch {set sock [socket -async $address $f]} error]} {
    puthelp "PRIVMSG $chan :Connection to \037$address\002:\002$f\037 was \002refused\002"
   } else {
    set id [utimer 15 [list portscan_timeout $chan $sock $address $f]]
    fileevent $sock writable [list portscan_connected $chan $sock $address $f $id]
   }
  }
}

proc portscan_timeout {chan sock address port} {
 close $sock
  puthelp "PRIVMSG $chan :Connection to \037$address\002:\002$port\037 has \002timed out\002."
}

proc portscan_connected {chan sock address port id} {
 killutimer $id
 set eor [fconfigure $sock -error]
 if {$eor != ""} {
  close $sock
  puthelp "PRIVMSG $chan :Connection to \037$address\002:\002$port\037 \002failed\002."
  foreach e [split $eor "\n"] {
   puts " * $e"
  }
 } else {
  puthelp "PRIVMSG $chan :Connection to \037$address\002:\002$port\037 \002accepted\002. (Port is \002Open\002)"
  close $sock
 }
} 
putlog "by:TCL_no_TK"
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Code: Select all

proc pub:portscan {nick uhost hand chan text} {
 set address [lindex [split $text] 0]
 putquick "PRIVMSG $chan :Connecting to \037$address\037 requested by \002$nick\002"
 portscan "$address" "$chan"
} 
change to

Code: Select all

proc pub:portscan {nick uhost hand chan text} {
 set address [lindex [split $text] 0]
 set ip [stripcodes bcruag $address]
 if {![regexp {^(?:(?:[2][5][0-5]|[1]?[1-9]{1,2}|0)(?:\.|$)){4}} $ip]} {
  puthelp "PRIVMSG $chan :Invalid IP Address: $ip"
  return 0
 }
 putquick "PRIVMSG $chan :Connecting to \037$address\037 requested by \002$nick\002"
 portscan "$address" "$chan"
}
source: regexp stripcodes :arrow: not tested, good luck
t
tablarock
Voice
Posts: 9
Joined: Thu Dec 09, 2010 3:02 pm

Post by tablarock »

thanks friend, I had not quite worked.
ip scan would also color
Invalid IP Address: 123.123.123.123
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

:) will try and look at it later tonite
t
tablarock
Voice
Posts: 9
Joined: Thu Dec 09, 2010 3:02 pm

Post by tablarock »

if it would be so kind, thank you very much
Post Reply