egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ip filter format help port scan

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
tablarock
Voice


Joined: 09 Dec 2010
Posts: 9

PostPosted: Thu Jan 20, 2011 2:49 pm    Post subject: ip filter format help port scan Reply with quote

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:
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"
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Jan 20, 2011 7:04 pm    Post subject: Reply with quote

Code:
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:
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
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
tablarock
Voice


Joined: 09 Dec 2010
Posts: 9

PostPosted: Thu Jan 20, 2011 9:30 pm    Post subject: Reply with quote

thanks friend, I had not quite worked.
ip scan would also color
Invalid IP Address: 123.123.123.123
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Jan 21, 2011 11:18 am    Post subject: Reply with quote

Smile will try and look at it later tonite
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
tablarock
Voice


Joined: 09 Dec 2010
Posts: 9

PostPosted: Fri Jan 21, 2011 12:45 pm    Post subject: Reply with quote

if it would be so kind, thank you very much
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber