EpicNet.Ru - Форум IRC Чата

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Manual add of IP to the blacklist for auto ban


Manual add of IP to the blacklist for auto ban

Сообщений 1 страница 10 из 10

1

Hey Epic, hope you are doing well.

As discussed yesterday, i am attaching the code here:

Код:
================================= code 1 ====================================
alias bos {
    /ban # $nick 2 | /kick # $nick you are banned!
    //write scripts\Abuse.txt $replace($address($nick,5),!,$chr(32),@,$chr(32))
}

================================= code 2 ====================================
on *:JOIN:#:{
  var %ident $remove($gettok($address($nick,5),1,64),$nick $+ !)
  var %host $gettok($address($nick,5),2,64)
  var %c 1, %l $lines(scripts\Abuse.txt)
  while (%c <= %l) {
    var %line $read(scripts\Abuse.txt,%c)
    if ($findtok(%line,$nick,0,32) || $findtok(%line,%ident,0,32) || $findtok(%line,%host,0,32)) {
      mode # +b $+($nick,!*@*)
      kick # $nick [Banned] Oh i know u!
    }
    inc %c 1
  }
}

1. /bos $nick = this will trigger a manual ban on a nick
2. i want the banned nick to be written automatically in abuse.ini or abuse.txt or abuse.hsh file
3. the code 2 will automatically retireve the banned ip from abuse.ini or abuse.txt or abuse.hsh file whenever that nick/ip joins the channel
4. the code 2 will automatically ban the nick/ip on arrival

what i wish to do:

code 1

Alias: if a manual ban is placed in any channel using /bos $nick, the ip address of that particular host should be saved in a file eg. ipaddress.txt or ipaddress.ini or ipaddress.hsh (maroon recommended me to use hash file instead of txt or ini file)

code 2

Remote: this code should automatically scan the joining host in any channel and match it with the ip addresses stored in ipaddress.txt or ini or hsh file. if found to be in the list then this code should automatically kick/ban the host.

Reason for this code : Ban list of any given channel is limited. each time an abuser joins in and gets banned then the ip address of that particular host gets unbanned after a while or day. that same abuser can then rejoin the channel and abuse again until another ban is placed on them. the sole purpose of this code is to automatically add the ip address of any abuser into the list of blocked users and ban them right on sight when they attempt to rejoin. I could have used a normal blacklist for this purpose but it takes a lot of time to add the ip address into the list just to keep the abusers out of the channel.

couple of additions i would love to see : maybe a dialogue box from where i can add or delete an ip address manually if needed which should run in tandem with the ipaddress.txt or ini or hsh file. A host specific custom kick msg would do wonders as the mods would be able to recognize the host as per their behavior. eg. given below :-

abuser 1 : /kick # $1 you are an abuser
abuser 2 : /kick # $1 you have been spamming in this channel since long
abuser 3 : /kick # $1 you are a pedophile and are not welcomed in.

Problems : the network to which i belong always cloak an ip address for privacy. so, essentially, the ipaddress.txt or ini or hsh file would only contain a cloaked host and not actual ip address in numbers.

do let me know if you have questions regarding this. i would be glad to respond :D

Thanks mah man!

Stay awesome!

Sleepyhead

2

1264,362 написал(а):

1. /bos $nick = this will trigger a manual ban on a nick
2. i want the banned nick to be written automatically in abuse.ini or abuse.txt or abuse.hsh file
3. the code 2 will automatically retireve the banned ip from abuse.ini or abuse.txt or abuse.hsh file whenever that nick/ip joins the channel
4. the code 2 will automatically ban the nick/ip on arrival

Я кое что создал для вас.

Попробуйте использовать этот код скрипта:

Код:
#####################################################################
#  Название: Bad User v1.0
#  Автор: Epic (http://epicnet.ru, irc.epicnet.ru:6667 #Code)
#  Описание: По команде выполняет Кик+Бан и записывает Ник+Хост нарушителя в базу данных для дальнейшей проверки.
#  Команда: /bu <nick> [reason]
#####################################################################

alias bu_set {
  %bu_path = scripts\BadUser\baduser.txt
  %bu_reason = You are banned!
}
---------------------------------------------------------------------
on *:JOIN:#:{
  bu_set | var %bu_jhost $gettok($address($nick,5),2,64)
  if ($read(%bu_path, -w, $+($nick,;,*))) || ($read(%bu_path, -w, $+(*,;,%bu_jhost,;,*))) {
    var %bu_bdreason $gettok($read(%bu_path,$readn),3,59)
    .ban $chan $nick 2 | .kick $chan $nick %bu_bdreason
  }
}
alias bu {
  if (!$1) { .echo -a Insufficient parameters. | halt }
  bu_set | var %bu_host $gettok($address($1,5),2,64)
  if ($2) var %bu_reason1 $2- | else var %bu_reason1 %bu_reason
  .ban $chan $1 2 | .kick $chan $1 %bu_reason1
  .write -i %bu_path $+($1,$chr(59),%bu_host,$chr(59),%bu_reason1)
}
Подпись автора

[html]<style>img {vertical-align:middle;}.hnet{color:#FFFFFF;}.hstar{color:#DE0000;}.htext{font-family:Verdana;font-size:13px;color:#6E1E00;}.heading{font-family:Verdana;font-size:13px;font-weight:bold;background-color:#4897E7;}.stitle{font-family:Verdana;font-size:12px;}.dot{color:#808000;}.desc{color:#ADADAD;}a .curl{font-family:Verdana;font-size:13px;color:#3A92CD;}</style><table><tr><td width="20px" height="20px"><img src="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://forum.epicnet.ru/viewtopic.php?id=234"><span class="heading"> <span class="hstar">★</span> <span class="hnet">EpicNet.Ru</span> <span class="hstar">★</span> </span><span class="htext"> - IRC Чат © 2008</span></a></td></tr><tr><td></td><td><div class="stitle"><span class="dot">•</span> <span class="desc">Вход через вебгейт:</span> <a href="http://irc.epicnet.ru"><span class="curl">http://irc.epicnet.ru</span></a><br><span class="dot">•</span> <span class="desc">Сервер:</span> irc.epicnet.ru <span class="desc">Порты:</span> 6667, 6668 (ssl)<br><div></td></tr></table>[/html]

3

Epic, This works awesome man! you are awesome! this is exactly what i was looking for and it works like a charm. thank you so much for this bro!

4

Привет, у меня появились новые идеи для этого скрипта.

Запрос на дополнительные функции:

1. Диалоговое окно, которое может вручную добавлять, удалять и вводить причину для любого данного пользователя.
2. Код должен уметь сканировать ники на наличие уже забаненных ников в списке badnick.txt
3. Целесообразно ли воссоздать это в хэш?
4. Можно ли также включить этот скрипт только для ника или хоста/IP? например, если я просто хочу забанить ник, а не весь айпи? или просто ip а не ник?
например: моника(ник);11.22.33.44;нарушитель установлен!

Здесь моника — это обычный никнейм, который будет забанен либо из-за ника, либо из-за ip/host, сохраненного в файле baduser.txt. поэтому, если пользователь выходит в сеть, используя монику в качестве своего ника, и не является нарушителем, он будет забанен только за использование этого ника.

у нас включена защита от никнейма, которая превратит ваш ник в гостевой, если вы не идентифицируете его в течение 10 секунд. эти злоумышленники используют этот трюк, чтобы взять зарегистрированный никнейм другого человека и превратить его в гостевой ник за 10 секунд. в течение этих 10 секунд, если этот ник будет забанен, он сохранит этот ник и ip в списке badusers.txt

Хотелось бы увидеть это дополнение. Спасибо.

5

Hey Epic,

Я также забыл сказать вам кое-что вчера.. если возможно, не могли бы вы добавить в него еще одну функцию? позволь мне объяснить..

код для операций. любой со статусом op сможет добавить его, используя /bu или вручную добавив ip/host/nick/reason в диалоговом окне. но скажем, если неоператор захочет нам помочь? скажем, оператор, который не является активным оператором, а просто сидит с регулярами без статуса оператора. может ли он добавить оскорбительный хост/ip/ник командой, подобной /bu? скажем, /obu (неоперативная команда)?

дайте мне знать, возможно ли это вообще в существующем коде. не хочу перегружать вас несколькими задачами :D

Thanks
Sleepyhead

6

1269,362 написал(а):

может ли он добавить оскорбительный хост/ip/ник командой, подобной /bu? скажем, /obu (неоперативная команда)?

Все команды через косую черту "/" можно выполнить только внутри своей клиентской программы в строке для ввода текста. Например вы можете отправить сообщение для бота через команду "/msg BotNick Hello!", тогда бот получит такое сообщение: "Hello!".

Если вы хотите, чтобы другие администраторы могли осуществлять управление ботом через похожие команды, то для этого нужно создать возможность приёма набранных команд на канале или в привате, для внешнего управления функциями скрипта - например, чтобы оператор канала мог написать такую команду: "!bu <nick> [reason]". При этом можно также прописать в отдельную переменную все ники опереторов, которым будет разрешено управление функцией бота, даже когда у них отсутствует возле ника префикс оператора канала "@".

Я думаю, что я это тоже добавлю в обновление к скрипту. Но если вы хотите что-то другое, то опишите свои предложения далее в новом комментарии.

Подпись автора

[html]<style>img {vertical-align:middle;}.hnet{color:#FFFFFF;}.hstar{color:#DE0000;}.htext{font-family:Verdana;font-size:13px;color:#6E1E00;}.heading{font-family:Verdana;font-size:13px;font-weight:bold;background-color:#4897E7;}.stitle{font-family:Verdana;font-size:12px;}.dot{color:#808000;}.desc{color:#ADADAD;}a .curl{font-family:Verdana;font-size:13px;color:#3A92CD;}</style><table><tr><td width="20px" height="20px"><img src="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://forum.epicnet.ru/viewtopic.php?id=234"><span class="heading"> <span class="hstar">★</span> <span class="hnet">EpicNet.Ru</span> <span class="hstar">★</span> </span><span class="htext"> - IRC Чат © 2008</span></a></td></tr><tr><td></td><td><div class="stitle"><span class="dot">•</span> <span class="desc">Вход через вебгейт:</span> <a href="http://irc.epicnet.ru"><span class="curl">http://irc.epicnet.ru</span></a><br><span class="dot">•</span> <span class="desc">Сервер:</span> irc.epicnet.ru <span class="desc">Порты:</span> 6667, 6668 (ssl)<br><div></td></tr></table>[/html]

7

hello,

Sorry, i think i did not explain myself clear. I dont want any other operator to add or delete nick/ip in my database. I want myself to do that while having op status or without op while sitting down with regular nicks.

Lets say, i am in 2 channels at the same time. 1st channel is where i have op status and 2nd channel where i dont have op status. now, the abuser abuses in both the channel sometimes in either of the channels sometimes in both the channels. lets say, i am op in #epic and a regular chatter in #moscow. if the abuser abuses in #epic, i will be able to take care of them by banning them using /bu nick but if the abuser abuses in #moscow then there is nothing i can do as i am not an op there. but as a regular chatter i still want to log the abusing ip and store it in my database.

Do let me know if you need more clarification on this.

Thanks

8

1271,362 написал(а):

Lets say, i am in 2 channels at the same time. 1st channel is where i have op status and 2nd channel where i dont have op status. now, the abuser abuses in both the channel sometimes in either of the channels sometimes in both the channels. lets say, i am op in #epic and a regular chatter in #moscow. if the abuser abuses in #epic, i will be able to take care of them by banning them using /bu nick but if the abuser abuses in #moscow then there is nothing i can do as i am not an op there. but as a regular chatter i still want to log the abusing ip and store it in my database.

Если я правильно понимаю, то вы хотите использовать этот скрипт внутри своего mIRC клиента, вместо того, чтобы использовать его внутри бота, который работает как отдельно включенный mIRC клиент.
В таком случае у вас не получится выполнить "Кик+Бан" на том канале, где у вас нет соответствующих прав для этого. Вы обязательно должны иметь любой из префиксов "%,@,&,~" оператора канала возле ника. Исключением может быть только, если у вас будут права IRCop на сервере и привилегии "Override", позволяющие выполнять подобные действия без наличия префикса оператора канала.

В любом случае сама запись в базу данных должна происходить без препятствий, в не зависимости от вашего статуса на канале.

[indent=0.8,0.5]
Для этого вы можете изменить положение этих строк:

Код:
.ban $chan $1 2 | .kick $chan $1 %bu_reason1
.write -i %bu_path $+($1,$chr(59),%bu_host,$chr(59),%bu_reason1)

Разместив их в обратном порядке:

Код:
.write -i %bu_path $+($1,$chr(59),%bu_host,$chr(59),%bu_reason1)
.ban $chan $1 2 | .kick $chan $1 %bu_reason1

Чтобы сначала производилась запись в базу данных, а затем были выполнены команды для "Кик+Бан" на канале.


[indent=0.8,0.5]
Вы также можете добавить условие для проверки наличия статуса оператора канала:

Код:
if ($me isop $chan) { .ban $chan $1 2 | .kick $chan $1 %bu_reason1 }

Чтобы эти команды могли быть выполнены только, если у вас установлен возле ника префикс "@" оператора канала.

Подпись автора

[html]<style>img {vertical-align:middle;}.hnet{color:#FFFFFF;}.hstar{color:#DE0000;}.htext{font-family:Verdana;font-size:13px;color:#6E1E00;}.heading{font-family:Verdana;font-size:13px;font-weight:bold;background-color:#4897E7;}.stitle{font-family:Verdana;font-size:12px;}.dot{color:#808000;}.desc{color:#ADADAD;}a .curl{font-family:Verdana;font-size:13px;color:#3A92CD;}</style><table><tr><td width="20px" height="20px"><img src="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://forum.epicnet.ru/viewtopic.php?id=234"><span class="heading"> <span class="hstar">★</span> <span class="hnet">EpicNet.Ru</span> <span class="hstar">★</span> </span><span class="htext"> - IRC Чат © 2008</span></a></td></tr><tr><td></td><td><div class="stitle"><span class="dot">•</span> <span class="desc">Вход через вебгейт:</span> <a href="http://irc.epicnet.ru"><span class="curl">http://irc.epicnet.ru</span></a><br><span class="dot">•</span> <span class="desc">Сервер:</span> irc.epicnet.ru <span class="desc">Порты:</span> 6667, 6668 (ssl)<br><div></td></tr></table>[/html]

9

hello,

now this worked perfectly. i could have done that too but then i was just scared that i dont mess up with your code and logic. :D but very well done!

Thanks & Regards,
Sleepyhead

10

Hello Epic,

Dialog for badusercode as below :-

http://forumupload.ru/uploads/000d/c9/8c/362/t537688.png http://forumupload.ru/uploads/000d/c9/8c/362/t315632.png
http://forumupload.ru/uploads/000d/c9/8c/362/t108088.png http://forumupload.ru/uploads/000d/c9/8c/362/t642962.png

Dialog code as below :-

Код:

alias Abuser dialog -mo Abuser Abuser
dialog -l Abuser {
  title "Abuser Blacklist"
  size -1 -1 175 128
  option dbu
  icon G:\Y\IRC\Reg Mirc\ClownIRC_Reg\background\mirc.ico, 0
  box "Badusers", 1, -1 0 176 57, group
  tab "Add", 2, 1 59 139 13
  button "Add", 8, 141 72 33 12, tab 2
  button "OK", 9, 141 86 33 12, tab 2 ok
  button "Cancel", 20, 141 100 33 12, tab 2 cancel
  button "Cancel", 21, 141 100 33 12, tab 2 cancel
  tab "Modify", 3
  button "Modify", 10, 141 72 33 12, tab 3
  button "OK", 11, 141 86 33 12, tab 3 ok
  button "Cancel", 22, 141 100 33 12, tab 3 cancel
  tab "Delete", 4
  button "Delete", 12, 141 72 33 12, tab 4
  button "OK", 13, 141 86 33 12, tab 4 ok
  button "Cancel", 23, 141 100 33 12, tab 4 cancel
  tab "Search", 5
  button "OK", 6, 141 86 33 12, tab 5 ok
  button "Cancel", 14, 141 100 33 12, tab 5 cancel
  button "Search", 18, 141 72 33 12, tab 5
  edit "", 7, 0 72 140 41
  scroll "", 15, 166 4 8 52
  scroll "", 16, 131 73 7 39
  button "OK", 17, 14 115 37 12, ok
  button "Close", 19, 84 115 37 12, cancel
}


You can do any modification as you wish. after all, You are the expert here!

Thanks & Regards,

Sleepyhead


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Manual add of IP to the blacklist for auto ban