mIRC Home    About    Download    Register    News    Help

Print Thread
Proxy list - Kline from blacklist.txt #268172 06/12/20 11:46 PM
Joined: Dec 2020
Posts: 8
Bes Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Dec 2020
Posts: 8
Hello all.

I need help, i have this code and its perfekt and this take all proxy how you make in blacklist.txt

when i make a Proxy IP on blacklist.txt 170.158.65.235 and when a user connecting with this proxy and script take IP from blacklist.txt and make automatic KLINE.

What i want from your help.

when I make a IP in blacklist.txt for example just 170.158.* take not and make nothing, i dont know who is problem!


Sorry for my English.

Thanks for your help!

Code
on 1:snotice:*Client connecting*:{
  .whois $9
  set %p9nick $9
}
on 1:DNS:/set %radd $raddress
raw 378:*:{ 
  set %getbl $read(C:\blacklist.txt,w,$+(*,%mbl,*)) ; you must have the file in drive C:\ for this to work properly 
  set %getblhost $read(C:\blacklist.txt,w,$+(*,%radd,*)) ; you must have the file in drive C:\ for this to work properly 
  set %mbl $7
  dns $7 
  if (%mbl isin %getbl) /kline %p9nick 1h 47Possible 47Proxy40/47VPN 
  if (%radd isin %getblhost) /kline %p9nick 1h 47Possible 47Proxy40/47VPN
}
}

Re: Proxy list - Kline from blacklist.txt [Re: Bes] #268193 08/12/20 08:55 PM
Joined: Jan 2012
Posts: 82
Epic Online
Babel fish
Online
Babel fish
Joined: Jan 2012
Posts: 82
If I understand your question correctly, then you want you to be able to specify the subnet mask in your blacklist, like: "170.158.*" and use that to intercept suitable IP addresses that connecting to your network?

Before helping, I need to know what the echo response will be if you install a piece of code like this:

Code
on *:SNOTICE:*Client connecting*:{
  /echo -s $1-
}

This is because this value is different on different IRCd servers.

Re: Proxy list - Kline from blacklist.txt [Re: Epic] #268194 08/12/20 09:08 PM
Joined: Dec 2020
Posts: 8
Bes Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Dec 2020
Posts: 8
Dear Epic,

Quote
*** Notice -- Client connecting on port 6667: Albi (Mibbit@ip-108-42-0-108.web.vodafone.de) [clients]


Yes, when a make a IP for example *.web.vodafone.de and when one user with this mask connected and automatic script give Kline..

Code
[21:02:19] *** Notice -- Client connecting on port 6667: Albi (Mibbit@217.138.194.75) [clients] 
[21:02:21] *** K:Line added for *@217.138.194.75 on Mon Dec  7 20:02:17 2020 GMT (from Alb!Alb@ip-37-201-6-44.hsi13.unitymediagroup.de to expire at Mon Dec  7 21:02:17 2020 GMT: 47Possible 47Proxy40/47VPN)
[21:02:21] *** Notice -- Client exiting: Albi (Mibbit@217.138.194.75) [User is banned (47Possible 47Proxy40/47VPN)]



I have make this IP 217.138.194.75 in blacklist and when I connect with this Proxy Script(Bot) give KLINE automatic.

Last edited by Bes; 08/12/20 09:21 PM.
Re: Proxy list - Kline from blacklist.txt [Re: Bes] #268195 09/12/20 02:11 PM
Joined: Jan 2012
Posts: 82
Epic Online
Babel fish
Online
Babel fish
Joined: Jan 2012
Posts: 82
So, I want to present to your attention a script that I created for you. It may not do everything all that you hoped it would, but in my opinion, this script does a good job of most of the things you would like to see. cool
This script will set a ban (ZLINE) on all incoming connections for those users whose host matches the host mask on the blacklist. Provided that the bot in which you install this code will have the privileges of IRCop Snomask (+cC)

The screenshot shows how I tried to simulate a user connecting from different host addresses, and that the script returns to me in echo-response when it found the user's host that matched the mask on the blacklist shown in the screenshot to the right. Each line in the screenshot shows the user's nickname, his host, line number and mask that were found in the black list:

      [Linked Image from i.ibb.co]

Now to a description of how it works. In the alias "cbl_data" you can configure all the necessary data to your liking. I think everything is clear here. But, just in case, I will give a help so that there are no questions:

%cbl_logo = CheckHostBL               | ;This value specifies the script logo for the message, so that it is clear from which script this line is.
%cbl_path = D:\blacklist.txt             | ;This is the path to your blacklist. It can be changed to a place convenient for you.
%cbl_btype = ZLINE                     | ;Here you specify the type of server ban that you want the script to execute if the host matches the mask. Possible options: <ZLINE/KLINE/GLINE>
%cbl_btime = 1h                      | ;Here, specify the time for which you want to ban the offender. Format: <1y/2w/3d/4h/5m/6s>
%cbl_reason = Possible "VPN/Tor/Proxy" | ;Here you can indicate the reason for the ban, as well as indicate an email so that in case of an error you can be contacted to unblock.

At the very bottom, in the alias "cbl_return", you can enable the type of messages through which you want to receive notifications when the script reacts to the intruder when connecting to the server. Just remove the ";" from the lines that should work. As a parameter "AdminNick" you must indicate the nickname of the administrator, to whom to send this message or your nickname. You can comment out these lines with a ";" because if this channel or nickname does not exist on the network you will get an error "No such nick/channel". You can also add your own commands as you see fit.

About filling in the black list. The check is performed according to the list, sequentially adding each part of the user's host, which is separated by periods. Therefore, it is recommended to set the "*" sign in the mask before the point or after. The most complex host masks, such as "*.hsi13.*" or "*.cn", recommended to write at the very top so that they come first. Otherwise it may not always work. Try to keep your blacklist more compact by using the subnet masks you want to banned, and watch for duplicates so that there are no identical addresses in the list.

Installing:

Uncover the spoiler. This code must be inserted into the scripts editor. To do this, press the key combination "ALT+R", select "File/New" and install as a new script and then save it entitled name "CheckHostBL.mrc":

Code
#####################################################################
#   Name: CheckHostBL v1.0
#   Description: Checking the Host/IP of the connecting user in the black list.
#   Author: Epic
#   Email: epicnet@mail.ru
#   Site: http://epicnet.ru
#####################################################################

on *:SNOTICE:*Client connecting*:{
  %cbl_mask = $remove($wildtok($1-,*@*,1,32),$chr(40),$chr(41))
  %cbl_nick = $gettok(%cbl_mask,1,33)
  %cbl_host = $gettok(%cbl_mask,2,64)
  cbl_data | cbl_check %cbl_host %cbl_nick %cbl_mask
}
alias -l cbl_data {
  %cbl_logo = CheckHostBL
  %cbl_path = D:\blacklist.txt
  %cbl_btype = ZLINE
  %cbl_btime = 1h
  %cbl_reason = Possible "VPN/Tor/Proxy"
}
alias -l cbl_check {
  cbl_data | var %cbl_w $numtok($1,46) | var %cbl_q 1 | while (%cbl_q <= $numtok($1,46)) {
    var %cbl_mh1 $gettok($1,$+(1-,%cbl_q),46) | var %cbl_mh2 $gettok($1,$+(%cbl_w,-,$numtok($1,46)),46) | var %cbl_mh3 $gettok($1,%cbl_q,46)
    if ($read(%cbl_path,w,$+(*,%cbl_mh1,*))) || ($read(%cbl_path,w,$+(*,%cbl_mh2,*))) || ($read(%cbl_path,w,$+(*,%cbl_mh3,*))) {
      var %cbl_r $readn | var %cbl_lh $read(%cbl_path,%cbl_r)
      if (%cbl_lh iswm %cbl_mh1) || (%cbl_lh iswm %cbl_mh2) || (%cbl_lh iswm %cbl_mh3) || (%cbl_lh == %cbl_mh1) || (%cbl_lh == $+(%cbl_mh1,*)) || (%cbl_lh == $+(%cbl_mh1,.,*)) || (%cbl_lh == $+(*,%cbl_mh2)) || (%cbl_lh == $+(*,.,%cbl_mh2)) || (%cbl_lh == $+(*,%cbl_mh3,*)) || (%cbl_lh == $+(*,.,%cbl_mh3,.,*)) {
        var %cbl_return = $+(%cbl_logo,:) $+(,$2,) -> $+(30,$1) -> $+($chr(40),line,$chr(32),%cbl_r,$chr(41)) 07 $v1
        cbl_ban $1 $2 %cbl_r | cbl_return %cbl_return | .break
      }
    }
    inc %cbl_q | dec %cbl_w
  }
}
alias -l cbl_ban {
  if (%cbl_btype == GLINE) .GLINE $+(*@,$1) %cbl_btime $+([,%cbl_logo,$chr(32),$3,]) $2 -> %cbl_reason
  if (%cbl_btype == KLINE) .KLINE $+(*@,$1) %cbl_btime $+([,%cbl_logo,$chr(32),$3,]) $2 -> %cbl_reason
  if (%cbl_btype == ZLINE) .ZLINE $1 %cbl_btime $+([,%cbl_logo,$chr(32),$3,]) $2 -> %cbl_reason
}
alias -l cbl_return {
  /echo -s $1-
  ;/msg #Services $1-
  ;/msg AdminNick $1-
  ;/notice AdminNick $1-
}


Remember that if something went wrong, or you accidentally erased something, then you can always reinstall this script again.
If you find any errors in the code and in its work, or maybe you have new ideas or if you think that this script needs to be improved, then be sure to write to me here about it, and we are together think about what we can do.


Re: Proxy list - Kline from blacklist.txt [Re: Epic] #268196 09/12/20 03:01 PM
Joined: Dec 2020
Posts: 8
Bes Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Dec 2020
Posts: 8
Dear Epic,

I have installed and i have prove it, but no Success..

I have tested with Complete IP and when connected make nothing just i see in Status whats IP is and i have made with notice and make nothing, No Gline No Kline No Zline!

Code

*** Notice -- Client connecting on port 6667: Albi (Mibbit@217.138.194.70) [clients] at 15:50:23 on 09/12/2020 on riniachat

CheckHostBL: Mibbit@217.138.194.70 -> 217.138.194.70 -> (line 136136)  217.138.194.70
-
[15:50] -> -AdmiraL- CheckHostBL: Mibbit@217.138.194.70 -> 217.138.194.70 -> (line 136136)  217.138.194.70
-
[15:50] 217.138.194.70 No such nick/channel



When a make for example 217.138.194.* and no detected with this IP when connect, make nothing No Notify No Kline No Gline No Zline!

Its maybe to complicated what I Want..


Thanks a lot Epic..

Re: Proxy list - Kline from blacklist.txt [Re: Bes] #268197 09/12/20 03:18 PM
Joined: Jan 2012
Posts: 82
Epic Online
Babel fish
Online
Babel fish
Joined: Jan 2012
Posts: 82
I assume that this IP address is already in your list in its entirety as "217.138.194.70". Try to find it by searching your blacklist using a text editor. In the future, to avoid this, it is recommended that all masks, where you substitute the "*" sign, be set at the very top of your black list. Regarding the failure of the (ZLINE) command, it's strange, because everything works for me and bans well. Could you please write me an example line of what the command for setting the ban on your server looks like? - /helpop zline

Tell me, have you changed anything in this code yet? Perhaps this could violate the integrity of the code and subsequently lead to a violation of its work. (You can always reinstall the script again).

As a parameter "AdminNick" you must indicate the nickname of the administrator, to whom to send this message or your nickname.

You can comment out these lines with a ";" because if this channel or nickname does not exist on the network you will get an error "No such nick/channel":

Code
  ;/msg #Services $1-
  ;/msg AdminNick $1-
  ;/notice AdminNick $1-

If anyone testing my script has the same problem, let me know.


Re: Proxy list - Kline from blacklist.txt [Re: Epic] #268309 30/12/20 11:33 PM
Joined: Dec 2020
Posts: 8
Bes Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Dec 2020
Posts: 8
thanks a lot.

Code
[00:34:03] -chat.riniachat.net- *** HelpOp -- from AdmiraL (HelpOp): zline


I have proved with Kline and now worked perfect, with zline not worked i dont know who problem is aber with KLINE is perfekt.

Code
[00:16] <Alb> CheckHostBL: Mibbit@ip-109-42-3-97.web.vodafone.de -> ip-109-42-3-97.web.vodafone.de -> (line 39165)  *.web.vodafone.de
[00:21] <Alb> CheckHostBL: Mibbit@217.138.194.76 -> 217.138.194.76 -> (line 16459)  217.138.194.76
[00:23] <Alb> CheckHostBL: Mibbit@217.138.194.76 -> 217.138.194.76 -> (line 16459)  217.138.194.*



thanks because you have help me to much..;)

Recpectfully
Bes


Last edited by Bes; 30/12/20 11:34 PM.