I would like that: when a user from a webchat join a channe where the bot is, his real IP would be written by the bot on a private channel that I have.
The IP from a webchat is formatted as HEX.
# This script allows to find out true IP of an user
# connected thru webchat services.
#
# Enable IP discovery on trigger (!findip)
set findip_do 1
# Enable IP discovery on join
set findjoinedip_do 1
# Channels to show info on
set findip_channel(#palmela-bots) 1
#
# End of prefs
#
set findip_header "\[ FindIP \]"
bind pub m|m !findip findip
bind join -|- * findjoinedip
proc findip {nick uhost hand channel arg} {
global findip_header findip_do findip_channel
set channel [string tolower $channel]
if {$findip_do != 1} {
return;
}
# hint taken from http://www.peterre.com/characters.html
set arg [lindex [split $arg] 0]
set hexip ""
set host [getchanhost $arg $channel]
if {$host != ""} {
if {[regexp -- {-?([0-9a-f]{8})@(.*\.ircnet\.(info|com)|webchat\.(xs4all\.nl|irc\.cz))} $host all hexip]} {
set realip [long2ip [format %d "0x$hexip"]]
putserv "PRIVMSG $channel :$findip_header Real IP of $arg is $realip"
}
}
}
proc findjoinedip {nick uhost hand channel} {
global findip_header findjoinedip_do join_message findip_channel
set channel [string tolower $channel]
if {$findjoinedip_do != 1 || [info exists findip_channel($channel)] && $findip_channel($channel) == "0"} {
return
}
set arg [lindex [split $nick] 0]
set hexip ""
if {$uhost != ""} {
if {[regexp -- {-?([0-9a-f]{8})@(.*\.ircnet\.(info|com)|webchat\.xs4all\.nl|webchat\.irc\.cz)} $uhost all hexip]} {
set realip [long2ip [format %d "0x$hexip"]]
putserv "PRIVMSG $channel :$findip_header $arg is connected thru a webchat service, his real IP is $realip"
}
}
}
# proc taken from http://www.eggfaq.com/docs/faq.html
proc long2ip {long} {
return [format "%d.%d.%d.%d" \
[expr ($long >> 24) & 0xff] \
[expr ($long >> 16) & 0xff] \
[expr ($long >> 8) & 0xff] \
[expr $long & 0xff]]
}
putlog "Loaded FindIP 0.5"
This is the code I use to do that. It works when the nickname's "ident" is hex encoded. Where that a6 stuff is above. This is similar to the way the script you originally posted handles it, except I know mine above works. If this is what you meant.. Enjoys..
Make sure you:
to enable !hex for your users >> .chanset #yourchan +hex
to enable hex checks on join >>.chanset #yourchan +hexjoin
If instead, it looks like this. It would take a different script to reverse this type of hostmask. Neither the script I posted nor the one you originally posted will work with this type.
Can you make this script to check for proxy checking ip/host and if is proxy bot tell to channel example: Warning This IP 54.67.88.35 is infected !
Thank You
set wnick [lindex [split [getchanhost $text $chan] @] 1]
That should work.
SmasHinG wrote:Can you make this script to check for proxy checking ip/host and if is proxy bot tell to channel example: Warning This IP 54.67.88.35 is infected !
Thank You
lol, umm, there are plenty of other script's out there that do that. This script is completely different from what you want/need, it's made for webchat IRC client's that use encrypted identd connections.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
hi, thanks for reply, for all. I tried it but couldn't make it work. always gives this output. how to run this? i give here some examples:
<kingkong>: !hex @350CE3.C1A208.7F4D68.0036C0
<bot>: @350CE3.C1A208.7F4D68.0036C0 isn't the amount of characters ( 8 ) required to convert to hex ip.
<kingkong> !hex 350CE3.C1A208.7F4D68.0036C0
<bot>: 350CE3.C1A208.7F4D68.0036C0 isn't the amount of characters ( 8 ) required to convert to hex ip.