| View previous topic :: View next topic |
| Author |
Message |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sat Jun 05, 2021 7:55 am Post subject: whois info |
|
|
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: |
[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: |
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 |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sat Jun 05, 2021 6:18 pm Post subject: |
|
|
| Code: | | if {[dict get $data status] eq "success" } { |
So, if status is success, it's an error ? replace "eq" with "ne", might be better. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sat Jun 05, 2021 8:50 pm Post subject: Hello |
|
|
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: |
[03:48:09] * ChanServ sets mode: +qo Bot Bot
[03:48:09] <~Bot> scanip:proxy_check --> PROBLEM DATA:
|
Partyline
| Code: |
[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: |
[02:49:34] Tcl error [scanip:raw_userip]: key "46.103.179.19" not known in dictionary
|
if i change the line
| Code: |
set message "scanip:proxy_check --> PROBLEM DATA: \n$data"
|
to:
| Code: |
set message [dict get $data]
|
is show me this in channel and partyline same info
| Code: |
[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
|
|
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sun Jun 06, 2021 3:37 am Post subject: |
|
|
Have a look on:
| Code: | | set Getas [dict get $data $ip as] |
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 _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sun Jun 06, 2021 5:12 am Post subject: Hello |
|
|
same error gives and when i remove $ip from
| Code: |
set Getas [dict get $data $ip as]
|
is not send the info to the channel the
| Code: |
set message "scanip:proxy_check --> PROBLEM DATA: \n$data"
|
|
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sun Jun 06, 2021 6:01 am Post subject: hi |
|
|
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: |
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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Jun 06, 2021 9:11 am Post subject: |
|
|
| Code: |
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. |
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sun Jun 06, 2021 9:56 am Post subject: Hello |
|
|
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: |
Line 88: ERROR: Wrong number of arguments (2) to "scanip:join_proxy_check"
|
here
| Code: |
scanip:join_proxy_check $userip $nick
|
from this code:
| Code: |
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: |
Tcl error [scanip:raw_userip]: wrong # args: should be "scanip:join_proxy_check nick host hand chan"
|
|
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sun Jun 06, 2021 11:17 am Post subject: Hello |
|
|
Now i fixed all errors but still is not give report in chan #test when user join channels
| Code: |
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
}
|
|
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sun Jun 06, 2021 12:46 pm Post subject: hi |
|
|
After join user i did in PL .set errorInfo
| Code: |
[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"
|
|
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Sun Jun 06, 2021 9:27 pm Post subject: Hello |
|
|
i fixed now is work the script need a regex for ip to get ip to check and give report in chan
| Code: |
if {[regexp -- {.*?(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).*?\((.*?)\)} - ip]} {
|
here
| Code: |
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: |
[04:22:13] * Joins: nasa (nasa@test-CE2C124C.adsl.cyta.gr)
|
Bot report user on join in chan report #test
| Code: |
[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
|
|
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Mon Jun 07, 2021 1:40 pm Post subject: Hello |
|
|
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: |
19:01:38] * Joins: figaro (2e67b313@Test-AED0FB6F.mibbit.com)
|
With Whois raw 311
| Code: |
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: |
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 |
|
| Back to top |
|
 |
Gulio Halfop
Joined: 01 Nov 2020 Posts: 73
|
Posted: Mon Jun 07, 2021 4:05 pm Post subject: Hello |
|
|
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: |
[22:20:42] * Joins: mib_ciulq5 (2e67b313@Test-AED0FB6F.mibbit.com)
|
Report from wrong source msg report
| Code: |
[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: |
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
}
|
|
|
| Back to top |
|
 |
|
|
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
|
|