| View previous topic :: View next topic |
| Author |
Message |
tablarock Voice
Joined: 09 Dec 2010 Posts: 9
|
Posted: Thu Jan 20, 2011 2:49 pm Post subject: ip filter format help port scan |
|
|
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 |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Jan 20, 2011 7:04 pm Post subject: |
|
|
| 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 not tested, good luck _________________ TCL the misunderstood |
|
| Back to top |
|
 |
tablarock Voice
Joined: 09 Dec 2010 Posts: 9
|
Posted: Thu Jan 20, 2011 9:30 pm Post subject: |
|
|
thanks friend, I had not quite worked.
ip scan would also color
Invalid IP Address: 123.123.123.123 |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Fri Jan 21, 2011 11:18 am Post subject: |
|
|
will try and look at it later tonite _________________ TCL the misunderstood |
|
| Back to top |
|
 |
tablarock Voice
Joined: 09 Dec 2010 Posts: 9
|
Posted: Fri Jan 21, 2011 12:45 pm Post subject: |
|
|
| if it would be so kind, thank you very much |
|
| Back to top |
|
 |
|