SentryBot

SentryBot

@sentrybot.excessive.space

A Discord bot that provides assistance in dealing with scam-spamming, hijacked accounts. See pinned post for details.

4 followers2 following50 posts

The first was solved by updating server and ensuring pip was secure. The second didn't affect me, since I don't serve the images back after processing, but I patched up to latest pillow regardless.

Okay, update! So, I hated the idea that I was basically asking the AI "Is this a scam?" and then only actioning if it did. What do they know? Coding was done!

SentryBot@sentrybot.excessive.space

Big night coding. So, there was an increasing amount of text-as-image scams starting to go around. I'm talking about things offering crypto or passive income. Well, that's where I've started to take advantage of an AI image OCR system.

View full thread

Next step? I now feel comfortable enough with this to enable kicking/banning/deleting. In all, it will cost me about $3-5 a month at current rate of usage. It's not (and never will be) a requirement, but if you want to help pay the costs of doing this: www.patreon.com/c/SourceBot

patreon.comGet more from SourceBot on PatreonGet more from SourceBot on Patreon. Join for free or become a member for just $1/month. I create a Discord bot (based on the Red bot framework) to…

So there we are. Now accepting images of text, to have the text turned into strings that can fingerprint the scammers! Peace (and hopefully peaceful Discord servers).

Okay, update! So, I hated the idea that I was basically asking the AI "Is this a scam?" and then only actioning if it did. What do they know? Coding was done!

SentryBot@sentrybot.excessive.space

Big night coding. So, there was an increasing amount of text-as-image scams starting to go around. I'm talking about things offering crypto or passive income. Well, that's where I've started to take advantage of an AI image OCR system.

Big night coding. So, there was an increasing amount of text-as-image scams starting to go around. I'm talking about things offering crypto or passive income. Well, that's where I've started to take advantage of an AI image OCR system.

It will still do the normal hash checking, and follow all the usual guidelines with those, but failing a positive match from that, it will now try to OCR. If a possible scam is found, it will only take nondestructive measures: notifying mods and (if enabled) timeout members.

That means that users won't get kicked, banned, or have their content deleted if they posted something as a joke. And yes, I have tested this against all the latest scam memes, and none are triggering it. Stay safe everyone, and don't let the scammers get you down!

View full thread

Bam. No more nasty file format processing for me! As always, a huge thanks to open source tooling like ImageMagick, Wand, and more for making coding safe, easy, and fun! So, yes. SentryBot is now safe from the nasty exploits through file formats, and is easily added to in future if more show up.

View full thread
View full thread

SentryBot uses ImageMagick through the awesome Wand bindings to convert all files it encounters into crisp PNG files before hashing them. What do? Firstly, identify what needs to happen: we need to stop it processing the three file formats. What will happen if we do this? Will scams get through?

Well... no. Discord doesn't preview any HEIC/HEIF/AVIF images when they are linked, and if you drag/drop such images into the clients, they are converted to JPG (I wonder if they use ImageMagick). Right, so safe to ignore such files, since users will ignore them too!

Scammers are mostly doing the same ol'-same ol'. Have seen the first of something different. Scammers using images of text to get around regular moderation tools for text. Example (cropped and edited to remove the scammer):

View full thread

Scammers are mostly doing the same ol'-same ol'. Have seen the first of something different. Scammers using images of text to get around regular moderation tools for text. Example (cropped and edited to remove the scammer):

View full thread

Now that is something I can work with! So it looks like now I'll be in the text diff hashing business, and will need a list of strings (maybe regex too?) to find these scams.

"But Damaged!" I hear you ask. "Why not use this method to catch crypto scam images too?" That is a thorny one. Let me explain! The two images here are of the OCR of two different images. One is a scam image, the other is a meme of the scam format. We want to get the scam, but not the meme.

Scammers are mostly doing the same ol'-same ol'. Have seen the first of something different. Scammers using images of text to get around regular moderation tools for text. Example (cropped and edited to remove the scammer):

View full thread

Scammers are mostly doing the same ol'-same ol'. Have seen the first of something different. Scammers using images of text to get around regular moderation tools for text. Example (cropped and edited to remove the scammer):

At first, I figured "Why not just add them to the image hashes and deal with it like that?" but I don't think that's really going far enough, or doing the job right. I've long been interested in leveraging OCR to assist in recognizing scams. This would make a good first use-case.

OCR, though, is intense. Running that on my bot server is horrid, slow, and crashes often due to OOM. What to do? @cloudflare.social has a neat set of tools for doing OCR with cut-down AI models. For fractions of cents per image, I can make them do the hard work. Yay!

Ooooh. Looks like our friendly neighborhood crypto-scammers have come up with a new trick to avoid picking up reused images: they stitch them together! Oh no! What am I to do? How will I defeat the— Oh. I guess I could just use @opencv.bsky.social and split them apart. Yeah, that'd work.

View full thread

Regarding the "Personal Information" snippet in the title (and on the banner of the bot): it is (of course) an xkcd comic xkcd.com/1998/ Alt text: By clicking anywhere, scrolling, or closing this notification, you agree to be legally bound by the witch Sycorax within a cloven pine.

Wew! Blew away a bunch of scambots today. Some musings on them 🧵: - They seem to all trigger at around the same time, maybe they're a single big botnet with a single command and control node commanding them? - Only two images in the messages today. - They latch onto a server invite

- They don't seem to attack servers that use their own link that forwards to a discord invite (so they're clearly scraping social posts, and only using actual Discord invite URLs) - Seems to be a slow trickle of them joining servers over a day, before they all spam in a wave at the same time

- They appear to be getting more persistent - They don't seem to be using hijacked accounts (maybe that was another attacker I just haven't seen lately?) A couple of wins for the day (:

View full thread
View full thread
View full thread

How does SentryBot know these images are accurate: - Perceptual hashes—it gets a score of how different the currently checked image is compared to a list of bad ones - Dimensions—once verified it looks similar to a known image, the aspect ratio is tested just in case it's a false positive

What do the spammers see: - Their messages dealt with in a fast manner - A direct message from the bot telling them what is happening and who to contact to resolve it - A forwarded copy of one of their messages

View full thread

What does SentryBot do: It will check every message against a list of known bad images. That list gets updates the moment new scam images are found. By default it will just notify, but if you give it extra management permissions, it will take action to secure your server.

What actions can SentryBot take: - Deleting message—if you give it manage_messages - Timeout users—if you give it manage_members - Kick users—if you give it kick_members - Ban users—if you give it ban_members In each case, it lets moderators know what it has done and leaves audit log entries.

You are up to date.