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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sat Jun 05, 2021 7:55 am
i have this code but is not show in channel report #test the info when a user join in other channel, is show me in partyline the info whois
how to fix this ?
Code: Select all
[14:48:15] <Bot> [13:48:16] scanip:proxy_check --> PROBLEM DATA:
[14:48:15] <Bot> "status" "success" "country" "Greece" "countryCode" "GR" "city" "Thessaloniki" "isp" "Cyta Hellas" "as" "AS3329 VODAFONE-PANAFON HELLENIC TELECOMMUNICATIONS COMPANY SA" "reverse" "46-179-19.adsl.cyta.gr" "mobile" false "proxy" false "query" "46.103.179.19"
Code: Select all
set zline(operchannel) "#test";
proc json2dict {JSONtext} {
string range [string trim [string trimleft [string map {\t {} \n {} \r {} , { } : { } \[ \{ \] \}} $JSONtext] {\uFEFF}]] 1 end-1
}
proc scanip:proxy_check {ip nick} {
::http::config -useragent "lynx"
set ipq [http::geturl http://ip-api.com/json/$ip?fields=status,message,country,countryCode,city,isp,as,reverse,mobile,proxy,query]
set data [json2dict [http::data $ipq]]
if {[check_ip $ip]} { return }
::http::cleanup $ipq
if {[dict get $data status] eq "success" } {
set message "scanip:proxy_check --> PROBLEM DATA: \n$data"
putlog $message
putserv "PRIVMSG ${::zline(operchannel)} :$message"
return
}
set Getquery [dict get $data query]
set Getcountry [dict get $data country]
set GetcountryCode [dict get $data countryCode]
set Getcity [dict get $data city]
set Getisp [dict get $data isp]
set Getas [dict get $data as]
set Getreverse [dict get $data reverse]
set Getmobile [dict get $data mobile]
set Getproxy [dict get $data proxy]
if {[lsearch -nocase $::ccodes $GetcountryCode]!=-1} {
set message "\002\0034Z-Line \0033BadCountry \0034>>\002\ \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
puthelp "PRIVMSG ${::zline(operchannel)} :$message"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +${::zline(timeban)} ${::zline(msgban)} \00314$Getcountry \0036- \0034$GetcountryCode\002" }
} elseif {[check_asn $Getas]} {
set message "\002\0034Z-Line \0033VPN \0034>>\002\ \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
puthelp "PRIVMSG ${::zline(operchannel)} :$message"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +${::zline(timeban)} ${::zline(msgban)} \00314$Getcountry \0036- \0034$GetcountryCode\002 " }
} elseif {$Getproxy == "true"} {
set message "\002\0034Z-Line \0033Proxy \0034>>\002\ \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
puthelp "PRIVMSG ${::zline(operchannel)} :$message"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +${::zline(timeban)} ${::zline(msgban)} \00314$Getcountry \0036- \0034$GetcountryCode\002" }
} else {
set message "\002\0033>>\002\ \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
puthelp "PRIVMSG ${::zline(operchannel)} :$message"
}
}
proc scanip:raw_userip {from key arg} {
set userip [concat [lindex [split $arg @] end]]
set nick [lindex [split $arg "="] 0]
scanip:proxy_check $userip $nick
}
proc scanip:join_proxy_check {nick host hand chan} {
putserv "USERIP $nick"
bind raw - 340 scanip:raw_userip
}
[/code]
Last edited by
Gulio on Sun Jun 06, 2021 6:18 am, edited 4 times in total.
CrazyCat
Revered One
Posts: 1244 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Sat Jun 05, 2021 6:18 pm
Code: Select all
if {[dict get $data status] eq "success" } {
So, if status is success, it's an error ? replace "eq" with "ne", might be better.
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sat Jun 05, 2021 8:50 pm
is show me this in PL when i change "eq" with "ne" when i give restart to the Bot
and this when a bot join channel
Code: Select all
[03:48:09] * ChanServ sets mode: +qo Bot Bot
[03:48:09] <~Bot> scanip:proxy_check --> PROBLEM DATA:
Partyline
Code: Select all
[03:48:10] <Bot> [02:48:09] scanip:proxy_check --> PROBLEM DATA:
[03:48:10] <Bot> "status" "fail" "message" "reserved range" "query" "255.255.255.255"
And this when a user join in channel
Code: Select all
[02:49:34] Tcl error [scanip:raw_userip]: key "46.103.179.19" not known in dictionary
if i change the line
Code: Select all
set message "scanip:proxy_check --> PROBLEM DATA: \n$data"
to:
is show me this in channel and partyline same info
Code: Select all
[04:55:34] <~Bot> status success country Greece countryCode GR city Thessaloniki isp {Cyta Hellas} as {AS3329 VODAFONE-PANAFON HELLENIC TELECOMMUNICATIONS COMPANY SA} reverse 46-179-19.adsl.cyta.gr mobile false proxy false query 46.103.179.19
CrazyCat
Revered One
Posts: 1244 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Sun Jun 06, 2021 3:37 am
Have a look on:
Why is there $ip in this line ?
Just with a visual check, you see that there is a trouble with this line, comparing to others which work
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sun Jun 06, 2021 5:12 am
same error gives and when i remove $ip from
Code: Select all
set Getas [dict get $data $ip as]
is not send the info to the channel the
Code: Select all
set message "scanip:proxy_check --> PROBLEM DATA: \n$data"
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sun Jun 06, 2021 6:01 am
I make a new one more simple but now is not sent no report in channel report, all add del list ip asn works and on/off but report is not send to channel #test
Code: Select all
set RepChan "#Test"
set ccodes { AF AX DZ AS AD AO AI AQ AG AR AM AW AZ BS BH BD BB BY BZ BJ BM BT BO BA BW BV BR VG IO BN BF BI KH CM CV KY CF TD CL CN MO CX CC CO KM CG CD CK CR CI CU CY DJ DM DO EC EG SV GQ ER EE ET FK FO FJ GF PF TF GA GM GE GH GI GL GD GP GU GT GG GN GW GY HT HM VA HN HU IS IN ID IR IQ IE IM IL JM JP JE JO KZ KE KI KP KR KW KG LA LV LB LS LR LY LI LT MG MW MY MV ML MH MQ MR MU YT MX FM MD MC MN MS MA MZ MM NA NR NP AN NC NZ NI NE NG NU NF MP OM PK PW PS PA PG PY PE PH PN PL PT PR QA RE RO RU RW BL SH KN LC MF PM VC WS SM ST SA SN SC SL SG SB SO ZA GS SS LK SD SR SJ SZ SY TW TJ TZ TH TL TG TK TO TT TN TM TC TV UG UA AE UM UY UZ VU VE VN VI WF EH YE ZM ZW }
package require http
bind pub -|- .pro zline:switch
bind join - * scanip:join_proxy_check
proc zline:switch {nick uhost hand chan text} {
if {![onchan $nick ${::RepChan}]} { return }
if {$text eq "on"} {
setuser $::owner XTRA zline on
putserv "PRIVMSG ${::RepChan} \0036$nick \0035: \00310Mbrotja Eshte \0033ON."
} elseif {$text eq "off"} {
setuser $::owner XTRA zline off
putserv "PRIVMSG ${::RepChan} \0036$nick \0035: \00310Mbrotja Eshte \0034OFF."
} else {
putserv "PRIVMSG ${::RepChan} \0036$nick \0035: \0035Komande E gabuar, \0036Komanda E Sakte Eshte: \0033on\0035/\0034off."
}
}
proc json2dict {JSONtext} {
string range [string trim [string trimleft [string map {\t {} \n {} \r {} , { } : { } \[ \{ \] \}} $JSONtext] {\uFEFF}]] 1 end-1
}
proc scanip:proxy_check {ip nick} {
::http::config -useragent "lynx"
set ipq [http::geturl http://ip-api.com/json/$ip?fields=status,message,country,countryCode,city,isp,as,reverse,mobile,proxy,query]
set data [json2dict [http::data $ipq]]
if {[check_ip $ip]} { return }
::http::cleanup $ipq
if {[dict get $data status] eq "success" } {
return $data
}
set Getquery [dict get $data query]
set Getcountry [dict get $data country]
set GetcountryCode [dict get $data countryCode]
set Getcity [dict get $data city]
set Getisp [dict get $data isp]
set Getas [dict get $data as]
set Getreverse [dict get $data reverse]
set Getmobile [dict get $data mobile]
set Getproxy [dict get $data proxy]
if {[lsearch -nocase $::ccodes $GetcountryCode]!=-1} {
puthelp "PRIVMSG $::RepChan:\002\0034Z-Line \0033BadCountry \0034>>\002\ \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00340Proxy\00347/\00340VPN \00347from \00314$Getcountry \0036- \0034$GetcountryCode\002" }
} elseif {[check_asn $Getas]} {
puthelp "PRIVMSG $::RepChan:\002\0034Z-Line \0033VPN \0034>>\002\ \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00340Proxy\00347/\00340VPN \00347from \00314$Getcountry \0036- \0034$GetcountryCode\002 " }
} elseif {$Getproxy == "true"} {
puthelp "PRIVMSG $::RepChan:\002\0034Z-Line \0033Proxy \0034>>\002\ \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00340Proxy\00347/\00340VPN \00347from \00314$Getcountry \0036- \0034$GetcountryCode\002" }
} else {
puthelp "PRIVMSG $::RepChan:\002\00303Connect\00304>>\002 \00314[regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
}
}
proc scanip:raw_userip {from keyword arg} {
set userip [concat [lindex [split $arg @] end]]
set nick [lindex [split $arg "="] 0]
scanip:proxy_check $userip $nick
}
proc scanip:join_proxy_check {nick host hand chan} {
putserv "USERIP $nick"
bind raw - 340 scanip:raw_userip
}
Last edited by
Gulio on Sun Jun 06, 2021 10:09 am, edited 1 time in total.
caesar
Mint Rubber
Posts: 3776 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Jun 06, 2021 9:11 am
Code: Select all
if {[dict get $data status] eq "success" } {
return $data
}
this line doesn't make much sense to me. might want to look at it.
Once the game is over, the king and the pawn go back in the same box.
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sun Jun 06, 2021 9:56 am
Everything i do is the same result,no report in chan #test when user is join on other channels.
But i get 1 error on paste.tcl
Code: Select all
Line 88: ERROR: Wrong number of arguments (2) to "scanip:join_proxy_check"
here
Code: Select all
scanip:join_proxy_check $userip $nick
from this code:
Code: Select all
proc scanip:raw_userip {from keyword arg} {
set userip [concat [lindex [split $arg @] end]]
set nick [lindex [split $arg "="] 0]
scanip:join_proxy_check $userip $nick
}
proc scanip:join_proxy_check {nick host hand chan} {
putserv "USERIP $nick"
bind raw - 340 scanip:raw_userip
}
when i restart bot is give this in PL
Code: Select all
Tcl error [scanip:raw_userip]: wrong # args: should be "scanip:join_proxy_check nick host hand chan"
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sun Jun 06, 2021 11:17 am
Now i fixed all errors but still is not give report in chan #test when user join channels
Code: Select all
set exempt(file) "./exempt.txt";
set exempt(asnfile) "./asnexempt.txt";
set RepChan "#Test"
set ccodes { AF AX DZ AS AD AO AI AQ AG AR AM AW AZ BS BH BD BB BY BZ BJ BM BT BO BA BW BV BR VG IO BN BF BI KH CM CV KY CF TD CL CN MO CX CC CO KM CG CD CK CR CI CU CY DJ DM DO EC EG SV GQ ER EE ET FK FO FJ GF PF TF GA GM GE GH GI GL GD GP GU GT GG GN GW GY HT HM VA HN HU IS IN ID IR IQ IE IM IL JM JP JE JO KZ KE KI KP KR KW KG LA LV LB LS LR LY LI LT MG MW MY MV ML MH MQ MR MU YT MX FM MD MC MN MS MA MZ MM NA NR NP AN NC NZ NI NE NG NU NF MP OM PK PW PS PA PG PY PE PH PN PL PT PR QA RE RO RU RW BL SH KN LC MF PM VC WS SM ST SA SN SC SL SG SB SO ZA GS SS LK SD SR SJ SZ SY TW TJ TZ TH TL TG TK TO TT TN TM TC TV UG UA AE UM UY UZ VU VE VN VI WF EH YE ZM ZW }
package require http
bind pub -|- .pro zline:switch
bind join - * scanip:join_proxy_check
bind pub -|- .ipadd "exempt:cmd add"
bind pub -|- .ipdel "exempt:cmd del"
bind pub -|- .iplist "exempt:cmd list"
bind pub -|- .asnadd "exempt:cmd addasn"
bind pub -|- .asndel "exempt:cmd delasn"
bind pub -|- .asnlist "exempt:cmd listasn"
bind pub -|- .iphelp "exempt:cmd help"
proc zline:switch {nick uhost hand chan text} {
if {![onchan $nick ${::RepChan}]} { return }
if {$text eq "on"} {
setuser $::owner XTRA zline on
putserv "PRIVMSG ${::RepChan} \0036$nick \0035: \00310Mbrotja Eshte \0033ON."
} elseif {$text eq "off"} {
setuser $::owner XTRA zline off
putserv "PRIVMSG ${::RepChan} \0036$nick \0035: \00310Mbrotja Eshte \0034OFF."
} else {
putserv "PRIVMSG ${::RepChan} \0036$nick \0035: \0035Komande E gabuar, \0036Komanda E Sakte Eshte: \0033on\0035/\0034off."
}
}
proc json2dict {JSONtext} {
string range [string trim [string trimleft [string map {\t {} \n {} \r {} , { } : { } \[ \{ \] \}} $JSONtext] {\uFEFF}]] 1 end-1
}
proc scanip:proxy_check {ip nick} {
::http::config -useragent "lynx"
set ipq [http::geturl http://ip-api.com/json/$ip?fields=status,message,country,countryCode,city,isp,as,reverse,mobile,proxy,query]
set data [json2dict [http::data $ipq]]
if {[check_ip $ip]} { return }
::http::cleanup $ipq
if {[dict get $data status] eq "success" } {
return $data
}
set Getquery [dict get $data query]
set Getcountry [dict get $data country]
set GetcountryCode [dict get $data countryCode]
set Getcity [dict get $data city]
set Getisp [dict get $data isp]
set Getas [dict get $data as]
set Getreverse [dict get $data reverse]
set Getmobile [dict get $data mobile]
set Getproxy [dict get $data proxy]
if {[lsearch -nocase $::ccodes $GetcountryCode]!=-1} {
putserv "PRIVMSG $::RepChan:\002\0034Z-Line \0033BadCountry \0034>>\002\00314 [regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00340Proxy\00347/\00340VPN \00347from \00314$Getcountry \0036- \0034$GetcountryCode\002" }
} elseif {[check_asn $Getas]} {
putserv "PRIVMSG $::RepChan:\002\0034Z-Line \0033VPN \0034>>\002\00314 [regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00340Proxy\00347/\00340VPN \00347from \00314$Getcountry \0036- \0034$GetcountryCode\002 " }
} elseif {$Getproxy == "true"} {
putserv "PRIVMSG $::RepChan:\002\0034Z-Line \0033Proxy \0034>>\002\00314 [regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00340Proxy\00347/\00340VPN \00347from \00314$Getcountry \0036- \0034$GetcountryCode\002" }
} else {
putserv "PRIVMSG $::RepChan:\002\00303Connect\00304>>\002\00314 [regsub -all {([^:]+:)} $nick ""]\00305- \003014IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
}
}
proc scanip:raw_userip {from key arg} {
set userip [concat [lindex [split $arg @] end]]
set nick [lindex [split $arg "="] 0]
scanip:proxy_check $userip $nick
}
proc scanip:join_proxy_check {nick host hand chan} {
putserv "USERIP $nick"
bind raw - 340 scanip:raw_userip
}
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sun Jun 06, 2021 12:46 pm
After join user i did in PL .set errorInfo
Code: Select all
[19:43:46] <me> .set errorInfo
[19:43:46] <Bot> [18:43:47] #me# set errorInfo
[19:43:46] <Bot> Currently: can not find channel named "sock56206313f860"
[19:43:46] <Bot> Currently: while executing
[19:43:46] <Bot> Currently: "eof $sock"
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Sun Jun 06, 2021 9:27 pm
i fixed now is work the script need a regex for ip to get ip to check and give report in chan
Code: Select all
if {[regexp -- {.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?\((.*?)\)} - ip]} {
here
Code: Select all
proc scanip:proxy_check {ip nick} {
::http::config -useragent "lynx"
set ipq [http::geturl http://ip-api.com/json/$ip?fields=status,message,country,countryCode,city,isp,as,reverse,mobile,proxy,query]
set data [json2dict [http::data $ipq]]
if {[regexp -- {.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?\((.*?)\)} - ip]} {
if {[check_ip $ip]} { return }
::http::cleanup $ipq
Code: Select all
[04:22:13] * Joins: nasa (nasa@test-CE2C124C.adsl.cyta.gr)
Bot report user on join in chan report #test
Code: Select all
[04:22:13] <~Bot> Connect >> nasa- IP: 46.103.179.19 - SHTETI: Greece - KODI: GR - QYTETI: Thessaloniki - ISP: Cyta Hellas - ASN: AS3329 VODAFONE-PANAFON HELLENIC TELECOMMUNICATIONS COMPANY SA - HOST: 46-179-19.adsl.cyta.gr - WIRELESS: false - PROXY: false
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Mon Jun 07, 2021 1:40 pm
how need to be to check the Ip in GECOS (RealName) when a user join with hostmask *.mibbit.com *.kiwi.com
and give same report channel and action /os snline $gecos +2h:Reason
Code: Select all
19:01:38] * Joins: figaro (2e67b313@Test-AED0FB6F.mibbit.com)
With Whois raw 311
Code: Select all
mib_xrrqa6 is 2e67b313@Test-B3B25F2D.mibbit.com * 46-179-19.adsl.cyta.gr
irc.Test.com 311 Bot figaro 2e67b313 Test-B3B25F2D.mibbit.com * :46-179-19.adsl.cyta.gr
to show report and action os snline like this
Code: Select all
putserv "PRIVMSG ${::RepChan(report_chan)} :JOINS:WEBIRC: [format %c 9755] [regsub -all {([^:]+:)} $nick ""] - IP: $Getquery - GECOS: $gecos \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036: $Getcity - ISP: $Getisp - ASN: $Getas - REVERSE: $Getreverse - WIRELESS: $Getmobile - PROXY: $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "OS SNLINE $gecos +1h \002\00314Ndalohen Shtete si $Getcountry - $GetcountryCode" }
the ip-api.com make dns when is domain reverse ip
Gulio
Halfop
Posts: 74 Joined: Sun Nov 01, 2020 11:53 am
Post
by Gulio » Mon Jun 07, 2021 4:05 pm
I Did this but is send report from msg report of client irc not from webirc who the user join with , if someone can help thx in advance
Code: Select all
[22:20:42] * Joins: mib_ciulq5 (2e67b313@Test-AED0FB6F.mibbit.com)
Report from wrong source msg report
Code: Select all
[22:20:45] <~Bot> JOINS:CLIENTIRC ☛ mib_ciulq5 - IP: 46.103.179.19 - SHTETI: Greece - KODI: GR - QYTETI: Thessaloniki - ISP: Cyta Hellas - ASN: AS3329 VODAFONE-PANAFON HELLENIC TELECOMMUNICATIONS COMPANY SA - HOST: 46-179-19.adsl.cyta.gr - WIRELESS: false - PROXY: false
Code: Select all
proc json2dict {JSONtext} {
string range [string trim [string trimleft [string map {\t {} \n {} \r {} , { } : { } \[ \{ \] \}} $JSONtext] {\uFEFF}]] 1 end-1
}
proc scanip:proxy_check {ip nick} {
::http::config -useragent "lynx"
set ipq [http::geturl http://ip-api.com/json/$ip?fields=status,message,country,countryCode,city,isp,as,reverse,mobile,proxy,query]
set data [json2dict [http::data $ipq]]
if {[regexp -- {.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?\((.*?)\)} - ip]} {
if {[check_ip $ip]} { return }
::http::cleanup $ipq
if {[dict get $data status] eq "success" } {
return
}
}
set Getquery [dict get $data query]
set Getcountry [dict get $data country]
set GetcountryCode [dict get $data countryCode]
set Getcity [dict get $data city]
set Getisp [dict get $data isp]
set Getas [dict get $data as]
set Getreverse [dict get $data reverse]
set Getmobile [dict get $data mobile]
set Getproxy [dict get $data proxy]
set host [dict get $data query]
set whois [dict get $data query]
switch -glob -- $host {
{*.mibbit.com} - {*.kiwiirc.com} {
if {[lsearch -nocase $::ccodes $GetcountryCode]!=-1} {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00304SN-Line \002\00303BadCountry \002\00304[format %c 9755]\002 \002\00314[regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035-\00314 GECOS\00306:\00304 $whois \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "OS SNLINE $whois +1h \002\00314Ndalohen Shtete si \00304$Getcountry \00314- \00304$GetcountryCode\002" }
} elseif {[check_asn $Getas]} {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00304SN-Line \002\00303VPN \002\00304[format %c 9755]\002 \002\00314[regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035-\00314 GECOS\00306:\00304 $whois \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "OS SNLINE $whois +1h \002\00340VPN \00314nga \00304$Getcountry \00314- \00304$GetcountryCode\002 " }
} elseif {$Getproxy == "true"} {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00304SN-Line \002\00303Proxy \002\00304[format %c 9755]\002 \002\00314 [regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035-\00314 GECOS\00306:\00304 $whois \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "OS SNLINE $whois +1h \002\00304Proxy \00314nga \00304$Getcountry \00314- \00304$GetcountryCode\002" }
} else {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00303JOINS\00305:\002\00314WEBIRC\00305:\002\00304 [format %c 9755]\002 \002\00314[regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035-\00314 GECOS\00306:\00304 $whois \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
}
}
{default} {
if {[lsearch -nocase $::ccodes $GetcountryCode]!=-1} {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00304Z-Line \002\00303BadCountry \002\00304[format %c 9755]\002 \002\00314[regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00314Ndalohen Shtete si \00304$Getcountry \00314- \00304$GetcountryCode\002" }
} elseif {[check_asn $Getas]} {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00304Z-Line \002\00303VPN \002\00304[format %c 9755]\002 \002\00314[regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00340VPN \00314nga \00304$Getcountry \00314- \00304$GetcountryCode\002 " }
} elseif {$Getproxy == "true"} {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00304Z-Line \002\00303Proxy \002\00304[format %c 9755]\002 \002\00314 [regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
if { [getuser $::owner XTRA zline] eq "on" } { putnow "ZLINE *@$ip +1h \002\00304Proxy \00314nga \00304$Getcountry \00314- \00304$GetcountryCode\002" }
} else {
putserv "PRIVMSG ${::RepChan(report_chan)} :\002\00303JOINS\00305:\00303CLIENTIRC \002\00304[format %c 9755]\002 \002\00314[regsub -all {([^:]+:)} $nick ""] \00305-\00314 IP\00306:\00304 $Getquery \0035- \00314SHTETI\00306:\00304 $Getcountry \00305- \00314KODI\0036:\00304 $GetcountryCode \00305- \00314QYTETI\0036:\00304 $Getcity \00305- \00314ISP\0036:\00304 $Getisp \00305- \00314ASN\00306:\00304 $Getas \00305- \00314HOST\0036:\00304 $Getreverse \00305- \00314WIRELESS\0036:\00304 $Getmobile \00305- \00314PROXY\0036:\00304 $Getproxy"
}
}
}
}
proc scanip:join_proxy_check {nick host hand chan} {
if {[isbotnick $nick]} {return}
switch -glob -- $host {
{*.mibbit.com} - {*.kiwiirc.com} {
putserv "WHOIS $nick"
bind raw - 311 scanip:raw_whois
}
{default} {
putserv "USERIP $nick"
bind raw - 340 scanip:raw_userip
}
}
}
proc scanip:raw_whois {from keyword arg} {
set whois [lindex [split $arg :] 1]
set nick [lindex [split $arg] 1]
scanip:proxy_check $whois $nick
}
proc scanip:raw_userip {from keyword arg} {
set userip [string trim [lindex [split $arg @] 1]]
set nick [lindex [split $arg "="] 0]
scanip:proxy_check $userip $nick
}