| View previous topic :: View next topic |
| Author |
Message |
sapo Voice
Joined: 15 Jun 2012 Posts: 5
|
Posted: Fri Jun 15, 2012 9:45 am Post subject: TCL get IP from webchat, converts from HEX to the real ip |
|
|
Hello,
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.
The TCL doesn't do nothing can you help, please?
| Code: |
# 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"
|
|
|
| Back to top |
|
 |
sapo Voice
Joined: 15 Jun 2012 Posts: 5
|
Posted: Sat Jun 16, 2012 9:38 pm Post subject: help |
|
|
| can anyone help please? |
|
| Back to top |
|
 |
sapo Voice
Joined: 15 Jun 2012 Posts: 5
|
Posted: Tue Jul 10, 2012 7:16 am Post subject: |
|
|
| anyone please? |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Jul 10, 2012 9:04 am Post subject: |
|
|
Could you provide an example of how an hex IP looks like? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Jul 10, 2012 3:25 pm Post subject: |
|
|
| Code: | bind pub - !hex hexIdent
bind join - * hexIdentJoin
setudef flag hex
setudef flag hexjoin
proc hexIdentJoin {nick uhost hand chan} {
if {![channel get $chan hexjoin]} { return }
hexIdent $nick $uhost $hand $chan $nick 1
}
proc hexIdent {nick uhost hand chan text {join 0}} {
if {![channel get $chan hex]} { return }
set wnick [lindex [split [getchanhost [lindex [split $text] 0] $chan] @] 0]
if {[string length $wnick]} { set text $wnick } { set wnick $text }
set a $text
if {[string length $a] == 8} {
while {[string length $a]} {
set piece [string range $a 0 1]
set a [string range $a 2 end]
if {[regexp {^[a-fA-F0-9]+$} $piece]} {
lappend ip [scan $piece %x]
} else {
set flag 1 ; break
}
}
if {![info exists flag]} {
set ip [join $ip "."]
putserv "privmsg $chan :\002$wnick\002 > Ident:\002$text\002; IP:\002$ip\002"
} else {
if {$join < 1} {
putserv "privmsg $chan :\002$wnick\002 > \"$text\" is not hex based."
}
}
} else {
if {$join < 1} {
putserv "privmsg $chan :\002$wnick\002 isn't the amount of characters (8) required to convert to hex ip."
}
}
} |
There are 2 ways this is usually done:
1) -----
nick!A6FD2E9F@somewebchat.net
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
2) ----
nick!webchat@9785F988.22D4FF26.21659F86.IP
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. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
sapo Voice
Joined: 15 Jun 2012 Posts: 5
|
Posted: Tue Jul 10, 2012 3:58 pm Post subject: |
|
|
| thanks it really works I just edit the line putserv "privmsg #my_chan .." to only send the data to that specific channel, thanks |
|
| Back to top |
|
 |
kingkong Voice
Joined: 08 Apr 2012 Posts: 10
|
Posted: Sat Jan 12, 2013 2:37 am Post subject: |
|
|
hey, it doesn't work at me coz our cloaked ips different hexed.
as an example cloaked ip here: @350CE3.C1A208.7F4D68.0036C0
can someone help with it please? |
|
| Back to top |
|
 |
SmasHinG Voice
Joined: 29 Aug 2011 Posts: 29
|
Posted: Sat Jan 12, 2013 5:15 am Post subject: |
|
|
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 _________________ SmasHinG® |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Sun Jan 13, 2013 2:33 am Post subject: |
|
|
| kingkong wrote: | hey, it doesn't work at me coz our cloaked ips different hexed.
as an example cloaked ip here: @350CE3.C1A208.7F4D68.0036C0
can someone help with it please? |
you probably want to change
| Code: |
set wnick [lindex [split [getchanhost [lindex [split $text] 0] $chan] @] 0]
|
with....
| Code: |
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. |
|
| Back to top |
|
 |
SmasHinG Voice
Joined: 29 Aug 2011 Posts: 29
|
Posted: Sun Jan 13, 2013 6:17 am Post subject: |
|
|
Can you give me script for this who i want ? _________________ SmasHinG® |
|
| Back to top |
|
 |
bunnybump Voice

Joined: 17 Aug 2012 Posts: 9
|
Posted: Sun Jan 13, 2013 1:13 pm Post subject: |
|
|
| Quote: | | <birex> ZendOR isn't the amount of characters ( 8 ) required to convert to hex ip. |
what if i want to use less than 8 character to convert it to hex ip? is it possible for that? can somebody help me how to do it pls. thanks  _________________ In the Beginning... Was the Command Line |
|
| Back to top |
|
 |
kingkong Voice
Joined: 08 Apr 2012 Posts: 10
|
Posted: Sun Jan 13, 2013 9:59 pm Post subject: |
|
|
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:
| Quote: |
<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.
|
|
|
| Back to top |
|
 |
|