Posted in Developer Zone, Second Life, tips

Using the Omnifilter to screen out spambots

If, like me, you are being assaulted by spambots sending Russian propaganda and links, that come in via both the Nearby Chat window and also as IMs, then you will doubtless be wanting some respite from it!

These spams are generally in Russian (the Cyrllic alphabet) and often are news propaganda about the war in Ukraine.

Well, help is at hand with Firestorm’s Omnifilter, which is a semi-recent addition that not many people know about.

The quick info

To dive straight in and get this working, open the Omnifilter (it’s under the Comm menu) and set up a Rule like this:

Omnifilter

Specifically, you are specifying regex mode, case sensitive, with the following regex:
.*(?:(?:^|[^\xD0-\xD3]+)(?:[\xD0-\xD3][\x80-\xBF]){3,}){2}.*

Make sure to set it up exactly like mine, and also set the Rule to “On”

That’s it. You don’t need to read any further

Tweaking it

This is a fairly aggressive filter that fires on encountering two 3+ letter words of the Cyrillic alphabet being present in a message. Feel free to tweak it as required, if legit messages get blocked.

  • {3,} controls how many consecutive Cyrillic letters a word must have, in this case 3+
  • {2} controls how many words must occur, in this case 2

Under the hood

There are a few little quirks I discovered whilst developing this, which I will share in case you are interested. It’s just background information and you do not need to know this to set up the filter.

Firstly it’s unclear how one gets on their radar, but when you do then the spam is fairly relentless and the mechanism is fairly sophisticated using burner accounts and temp-rezz objects. So trying to locate the sim where the object is rezzed is fruitless as it will be gone by the time you get there. And blocking the account sending the IMs is playing whack-a-mole.

Next, I noticed in the source code of Firestorm that the Omnifilter is using std::string throughout, presumably with UTF-8 encoding, so a regex like [\x{0400}-\x{04FF}] which tries to examine entire Unicode characters won’t work. In fact it can cause a Crash to Desktop!

Instead we examine the characters as byte pairs to determine if the letter is Cyrillic.

And, also it is very important that case sensitivity is turned on, otherwise the string is put through LLStringUtil::toLower() which can cause issues by corrupting the data.

 

 

Posted in Exploring, General, Opinion, Privacy & identity, Second Life

Pet peeves

One of my pet peeves in Second Life is TPing into a sim and being absolutely assaulted with greeters, LMs, pop-up messages, notecards, group invites and the like.

I had to chuckle at one sim today though, which did all these and the notecard and pop-up said that they did not allow spamming, group invites or griefing.

The irony of this was not lost on me. But seemed to be lost on them. 🙂