C. Banning - TalkIRC Blog

C. Banning

129 | 12.01.2024 | IRCGuide

The basic idea is to set the most specific pattern or “ban mask” which keeps the person out without affecting innocent people. As the channel maintenance section of the IRC Tutorial explains, the ban mask consists of 3 parts, combined in the form of nickname!username@hostname. If the ban is too specific, the person can evade the ban just by changing 1 or more of those 3 parts of his information. If the ban is too general, you may end up accidentally banning everybody from an organization, internet service provider (ISP), or country. If you’re not careful you can even end up banning yourself!

To make the right ban mask, you use the * or ? characters which are called “wild cards” to replace the parts of the nick!user@host information that change. The ? can be used to substitute for any single character. It implies that a character must exist to replace it. The * can mean nothing, a single character, or many characters.

Let’s assume an abusive user’s /whois shows “goofy1 is blah@m027-124.nv.iinet.net.au”. Here are a few possible ban masks, starting from very specific (affecting only this person) and gradually becoming very general (affecting more people):

  • /mode #mychat +b goofy1!blah@m027-124.nv.iinet.net.au bans anyone using the nick g00fy1, username of blah, and hostname of m027-124.nv.iinet.net.au. He can change any of those 3 and evade the ban, such as just by /nick goofy2
  • /mode #mychat +b *!blah@m027-124.nv.iinet.net.au (equivalent to mIRC’s /ban nick 2) will stop that by banning any nick with that user@host. If he is using a personal client like mIRC, however, he can just change his username after a quick disconnect and reconnect to the IRC server…
  • /mode #mychat +b *!*@m027-124.nv.iinet.net.au (equivalent to mIRC’s /ban nick 3) would ban all nicks and usernames from that hostname. This is enough to keep most people out if they cannot change their hostname easily, such as a DSL/cable connection. With that hostname however, you might guess that it’s not exactly personalized, and he may be able to get a new hostname if he’s willing to make a new connection to his ISP such as by dialing up again, or by getting 20 of his buddies from the same domain to harrass you, such as m027-001.nv.iinet.net.au, m027-002.nv.iinet.net.au, etc. If that’s the case…
  • /mode #mychat +b *!*@*.nv.iinet.net.au (equivalent to mIRC’s /ban nick 4) would ban any nick and any username from any machine from the ISP domain name nv.iinet.net.au. To beat that, he would have to use a separate account from another ISP. If that happens, you can just ban that account as well. Chances are you have more ban slots than he has accounts or patience.
  • Another point to note, is if a user has an IP address instead of a hostname, such as blah@123.45.678.90 – IP numbers run in the opposite direction in terms of generality, that is, @123.45. is a more general ban than @123.45.678. - the former bans an entire “netblock” which is equivalent to banning an entire country, or at least large portions of one!