"Mis"-Identify blocks

These are old archives. They are kept for historic purposes only.
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

"Mis"-Identify blocks

Post by aquanight » Tue Aug 17, 2004 12:11 am

I don't know how often you've seen this, but once in a while you come across the user typing in the nice little /msg NickServ/ChanServ IDENTIFY inside a channel/query window (ok, that's a stupid idea from the start: for example, when enabled mIRC will log just about everything echoed to a channel/query window, including the -> *NickServ* IDENTIFY blablabla), or /nickserv|/chanserv IDENTIFY if that be the case. But sometimes you just daze out and forget the / and now your IDENTIFY password was messaged to forty-odd persons in the same channel.

I agree (and even tell people :) ) that you should always type nickserv/chanserv passwords in a non-targetted window (like Status/Server windows) but some clients don't have this choice, or some people just forget, so I thought it might be nice to utilize spamfilter to help remind these people and protect them from accidentally exposing their password.

Code: Select all

// This will block accidental omission of /, or accidental use of CTRL+ENTER (in mIRC, this makes the text send as normal text - ie don't execute / commands), for the /nickserv, /chanserv, and /identify aliases.
spamfilter {
    regex "^/{0,2}((NickServ)|(ChanServ) )?IDENTIFY .+$";
    target { private; channel; };
    action block;
    reason "Don't forget to put a / in front of IDENTIFY commands, or push ENTER, not CTRL+ENTER!";
};
// This will block accidentally using . instead of / - they're right next to each other on the US standard keyboards :P .
spamfilter {
    regex "^\.+(NickServ)|(ChanServ) IDENTIFY .+$";
    target { prviate; channel; };
    action block;
    reason "Use /, not .!";
};
// Same as the first, but for /msg NicKServ or /msg ChanServ (with and without @services qualifier - replace this with your services server bottom-level name if needed).
spamfilter {
    regex "^/{0,2}msg ((NickServ)|(ChanServ))(@services..+)? IDENTIFY .+$";
    target { private; channel; };
    action block;
    reason "Don't forget to put a / in front of IDENTIFY commands, or push ENTER, not CTRL+ENTER!";
};
// Same as the second, but for /msg NickServ, etc as with the third.
spamfilter {
     regex "^\.+msg ((NickServ)|(ChanServ))(@services..+)? IDENTIFY .+$";
    target { prviate; channel; };
    action block;
    reason "Use /, not .!";
};
Naturally not required on serviceless nets and you may have to change the targets/alias names to suit (for example, you might have Q and X instead of NickServ and ChanServ :P ).

*edit* on the same token we could use this for accidental "mis"-/oper as well (I saw this once!)... this should work:

Code: Select all

spamfilter {
    regex "^((\.)?)|(/{0,2})oper [^ ]+ [^ ]+$";
    target { private; channel; };
    reason "Maybe you should type your /oper stuff in a status window?";
    action block;
};
*/edit*
Last edited by aquanight on Thu Aug 19, 2004 1:06 am, edited 1 time in total.

w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t » Tue Aug 17, 2004 12:47 am

Heh, jolly good stuff. I always make sure I'm in the status window when I'm identifying and opering ;)
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]

katsklaw
Official supporter
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Post by katsklaw » Tue Aug 17, 2004 1:54 am

I use aliases scripted into my client (for those that are paranoid, you can most likely have your IRC client ask for a password.)

God bless Function keys!

AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf » Tue Aug 17, 2004 1:02 pm

As an addition to the previous post, some servers allow you to send your NickServ password as a server password (it depends on the server configuration), which is totally safe.

I don't like the first regex very much. Have just tested it. Here are my results (sorry if my examples aren't the best):
[#restricted-area] <User1> What are you talking about?
[#restricted-area] <User2> Identify yourself! Are you FBI?
404 #restricted-area : Message blocked: Don't forget to put a / in front of IDENTIFY commands, or push ENTER, not CTRL+ENTER!
[#web-design] <User1> What's the title of that page?
[#web-design] <User2> Identify yourself using HTTP authentication
404 #web-design : Message blocked: Don't forget to put a / in front of IDENTIFY commands, or push ENTER, not CTRL+ENTER!
[#help] <User> What command do I pass to NickServ if I want to identify my name?
[#help] <Supporter> IDENTIFY <password>
404 #help : Message blocked: Don't forget to put a / in front of IDENTIFY commands, or push ENTER, not CTRL+ENTER!
The third regex leads to a similar problem:
[#help] <User> Still don't understand, can you tell me what exactly I should type?
[#help] <Supporter> ./chanserv identify <#channel> <password>
404 #help : Message blocked: Don't forget to put a / in front of IDENTIFY commands, or push ENTER, not CTRL+ENTER!

QuietGuy
Posts: 6
Joined: Tue Aug 17, 2004 8:21 am
Location: the Netherlands
Contact:

Post by QuietGuy » Tue Aug 17, 2004 1:22 pm

AngryWolf has a point. When I am on IRC and introduce services to a newbie (which I want to join my server offcause :roll: ) I need to explain how REGISTER and IDENTIFY works.

Sure you can point to an URL with detailed FAQ's of the services, but people hates to read and likes to ask and get a straight answer.

If a supporter can't tell how services works I think that can be very irritating. And I have never placed a password in a public channel.

aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight » Tue Aug 17, 2004 4:20 pm

Ah yes of course. But of course there are workarounds in that case. For example, I could instruct users to use /nickserv help identify.

Though I'd have to agree with removing the checks against /identify. That simply consists of removing the ? immediately after ((NickServ)|(ChanServ) ) bit.

*edit* Oh, and I don't see how it's catching ./nickserv identify blablabla...*/edit*

katsklaw
Official supporter
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Post by katsklaw » Tue Aug 17, 2004 6:22 pm

aquanight wrote:
*edit* Oh, and I don't see how it's catching ./nickserv identify blablabla...*/edit*
Perhaps it's because there is a difference between /msg nickserv and /nickserv.

For example /nickserv is an IRCd command that sends PRIVMSG :NickServ@services.server verses sending PRIVMSG :NickServ

AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf » Tue Aug 17, 2004 7:27 pm

aquanight wrote:*edit* Oh, and I don't see how it's catching ./nickserv identify blablabla...*/edit*
I wanna know that too.
katsklaw wrote:Perhaps it's because there is a difference between /msg nickserv and /nickserv.
No, there is no spam filtering in alias commands.

katsklaw
Official supporter
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Post by katsklaw » Tue Aug 17, 2004 10:54 pm

last I checked IDENTIFY was an aliased command same as NickServ .. at least it is by default ... and it seems to catch identify just fine.

aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight » Wed Aug 18, 2004 4:20 am

Yes but AngryWolf said it catches ./chanserv and if I read my regexs right, it shouldn't.

katsklaw
Official supporter
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Post by katsklaw » Wed Aug 18, 2004 12:38 pm

hmm .. I guess I'm not catching it then. Sorry for my ignorance, I really haven't played with regex or spamfilters .. so I admit I'm a bit lost. Perhaps I'll just be more of an observer. :)

AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf » Wed Aug 18, 2004 2:57 pm

I came to realize how aquanight's third regex should be corrected. Let's take a closer look at the following regex:

Code: Select all

^1 2|3 4$
That matches:
1 2
1 2 text
3 4
text 3 4
But doesn't match:
text 1 2
3 4 text
So the regex above is the same as:

Code: Select all

(^1 2|3 4$)
And, for example, ^(1 2)|(3 4)$ is equal with the regex above.

Which gives me the idea that aquanight's third regex should be written as:

Code: Select all

^/{0,2}msg (NickServ|ChanServ)(@services..+)? IDENTIFY .+$
And that works well. I should have already seen that mistake there. :)

katsklaw
Official supporter
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Post by katsklaw » Wed Aug 18, 2004 3:32 pm

Prolly a stupid question, but is there a tutorial for all this?

AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf » Wed Aug 18, 2004 3:50 pm

That's somewhat similar to an already asked question. See my answer here.

aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight » Thu Aug 19, 2004 1:05 am

AngryWolf wrote:Which gives me the idea that aquanight's third regex should be written as:

Code: Select all

^/{0,2}msg (NickServ|ChanServ)(@services..+)? IDENTIFY .+$
And that works well. I should have already seen that mistake there. :)
I'm not quite sure I follow you there... in .NET regex, that | would cause to match against the v or C, meaning the parens around NickServ and ChanServ were required. But it appears TRE applies | against an entire regex. I guess that is what caused my error :| .

For the sake of avoiding confusion like this, I suggest ((NickServ)|(ChanServ)) in the third regex.

*edit* This issue affected the fourth regex as well, but the third regex was tripped before the fourth one I guess, so it was never caught :P . (I thought spamfilter {} blocks would be read upside down, like the rest of the conf?) */edit*

Post Reply