Sign in

SentryBot

@sentrybot.excessive.space
3 followers 2 following 36 posts

A Discord bot that provides assistance in dealing with crypto-scam-spamming hijacked accounts. See pinned post for details. Source: github.com/SomewhatDamaged/SentryBot Privacy: excessive.space/policies/privacy-po…

PostsRepliesMedia
SentryBot @sentrybot.excessive.space · 27/09/2026
Me: *trying to create an @ovhcloudus.bsky.social account* OVH Cloud:
The user is trying to create an OVH Cloud account with a password that is a gibberish of randomly generated by KeePass that contains mostly Latin supplemental characters and is 32 bytes long.

OVH Cloud's password checker is saying "This password is too easy to guess and could not be used. Please change your password and try again."

The password is similar to: àDZE4rùµ6ó§ÄÃ:±Ã$ª<ç5çç0RÙ¸v`wçº

For anyone thinking of trying to hack my account, neither this password nor the one in the image is my actual password.
000
SentryBot @sentrybot.excessive.space · 18/09/2026
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.
000
SentryBot @sentrybot.excessive.space · 18/09/2026
Now we just have to do the work!
Gotta do some processing on the image_format and image_mime, because either could be null and their case might be weird. We also have a generic and easy-to-add-to list of forbidden formats.

Then a nice quick loop that checks each format to see if it is present. If they are, it throws a custom exception.
100
SentryBot @sentrybot.excessive.space · 18/09/2026
We need to stop it doing any conversion, so let's just throw in what we hope will work:
Now with added "check the format" call! Oooh. Shiny!
100
SentryBot @sentrybot.excessive.space · 18/09/2026
This is how I currently process images into png files. This is all happening in RAM, because the hard drive is lava when you are hard-enforcing "no private data storage".
Simple Python code that prepares a buffer, opens an image with Wand/ImageMagick, converts it to PNG, and saves it to the buffer. So simple...
100
SentryBot @sentrybot.excessive.space · 18/09/2026
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!
100
SentryBot @sentrybot.excessive.space · 18/09/2026
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?
100
SentryBot @sentrybot.excessive.space · 18/09/2026
Some lovely chaps found a series of exploits in the primary image-handling libraries used by ImageMagick (and other similar tools) for HEIF/HEIC/AVIF files. heif-heist.com
heif-heist.com
HEIF Heist
One image parser to pwn them all. Hacktron research into remote exploitation through production HEIF, HEIC, and AVIF image pipelines.
100
SentryBot @sentrybot.excessive.space · 18/09/2026
Okay, so we all giggled at xkcd.com/2347/ and all the memes of it. But today is the day when the flavor text is important. "Someday ImageMagick will finally break for good and we'll have a long period of scrambling as we try to reassemble civilization from the rubble." Today is the day!
xkcd.com
Dependency
100
SentryBot @sentrybot.excessive.space · 05/09/2026
So, for now, I need to get the filtering and diffing working, then make the archive have its own section where it will process images of text. Fun fun!
000
SentryBot @sentrybot.excessive.space · 05/09/2026
Now, I could use this to post-process each image seen and use it to automatically add the image to my dead-drop for such things (a CF bucket without web-visibility), but doing so would brush up against my privacy policy: excessive.space/policies/pri...
100
SentryBot @sentrybot.excessive.space · 05/09/2026
"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.
The text:

"The image contains two distinct parts: a computer screen showing a social media post from MrBeast and a smartphone displaying a cryptocurrency withdrawal screen. The computer screen shows a post from MrBeast, titled “Beast Games Strong vs Smart Is Out Now!”, with engagement metrics including likes, comments, and shares. The post is attributed to “@MrBeast” with timestamp 7:45 PM on April 14, 2014. The post has 2,303 followers and includes 34,771 followers. The phone screen displays a cryptocurrency withdrawal interface showing a successful withdrawal of $5600.00, with details including the amount transferred, recipient address, and transaction ID. The interface includes options for selecting a withdrawal method, choosing between crypto or bank transfer, and viewing transaction history. The phone screen also shows transaction details such as amount, recipient address, and transaction ID."The text:

"The image contains OCR text from multiple sources:\n\n1. **Left side:** A computer screen displays a Twitter profile for Mr.Beast (@MrBeast), showing his profile picture, tweet, follower count, and OCR text: “Beast Games Strong Vs Smart Is Out Now! Joined April 2014. 2,301 Following. 34.7M followers. Subscriptions. Not followed by anyone you’re following.”\n\n2. **Middle:** A computer screen shows OCR text: “Your Employer JOB Withdrawal Success! Paycheck $3500 Was Successfully The money will be transferred to your specified wallet. Continue.”\n\n3. **Right side:** A smartphone screen displays a payment screen showing a green checkmark and text: “$3500 Bossman.” A green button labeled “Continue” is also visible. The phone screen shows OCR text: “View on Block Explorer.”\n\nThe OCR text is consistent across all three sources, capturing various details like names, dates, job titles, and payment amounts."
101
SentryBot @sentrybot.excessive.space · 05/09/2026
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.
100
SentryBot @sentrybot.excessive.space · 05/09/2026
This, with a little more processing of text output, will give:
The text:


"I’ll help the first 10 people interested on how to start earning $200k or more within a week, but you will reimburse me 10% of your profits when you receive it.\n\nNote: only interested people should send a friend request or send me a dm! ask me (HOW) via Telegram username\n\nOr use the telegram link in my bio"
100
SentryBot @sentrybot.excessive.space · 05/09/2026
A proof of concept code snippet:
The following Python Worker code:

    async def ocr(self, request: Request) -> Response:
        image_url = "https://cdn.discordapp.com/attachments/160386989819035648/1545680353283407932/image.png?ex=6a9d0681&is=6a9bb501&hm=37807f6a6697e7f38d7a08f720769104c02c3c3cb280aed6db7219a7db50dc3a&"
        image_response = await pyfetch(image_url)
        blob = await image_response.blob()
        array_buffer = await blob.arrayBuffer()
        python_bytes = array_buffer.to_py().tobytes()
        base64_encoded = base64.b64encode(python_bytes).decode('utf-8')
        ocr_default = {
            "task": "query",
            "question": "OCR this image",
            "temperature": 0.0,
            "reasoning": False
        }
        ocr_default["image"] = f"data:image/png;base64,{base64_encoded}"
        answer = await self.env.AI.run('@cf/moondream/moondream3.1-9B-A2B', ocr_default)
        return Response(answer, headers={"content-type": "text/plain;charset=UTF-8"}, status=200)
100
SentryBot @sentrybot.excessive.space · 05/09/2026
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!
101
SentryBot @sentrybot.excessive.space · 05/09/2026
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.
100
SentryBot @sentrybot.excessive.space · 05/09/2026
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):
101
SentryBot @sentrybot.excessive.space · 17/07/2026
Hey, @discord.com, Accessibility "text size" setting isn't affecting the description field in embeds (tested on desktop, native client). Those of us with poor eyesight really need those accessibility features.
010
SentryBot @sentrybot.excessive.space · 13/07/2026
Suffer in ya jocks, scammers. Opensource always wins.
110
SentryBot @sentrybot.excessive.space · 13/07/2026
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.
141
SentryBot @sentrybot.excessive.space · 10/07/2026
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.
A humorous Privacy Policy, detailing the chaotic nature of modern privacy.
000
SentryBot @sentrybot.excessive.space · 07/07/2026
- 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 (:
A discord server's Audit Log showing SentryBot timing a spammer out for 12 hours (yes, I have fixed this, it shouldn't make so many entries anymore).A screenshot of a server's quarantine channel where SentryBot banned a spammer and deleted all their messages, helpfully letting mods know it did so.
010
SentryBot @sentrybot.excessive.space · 07/07/2026
- 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
110
SentryBot @sentrybot.excessive.space · 07/07/2026
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
110
SentryBot @sentrybot.excessive.space · 30/06/2026
A poem by Yeats:

Had I the heavens’ embroidered cloths,
Enwrought with golden and silver light,
The blue and the dim and the dark cloths
Of night and light and the half light,
I would spread the cloths under your feet:
But I, being poor, have only my dreams;
I have spread my dreams under your feet;
Tread softly because you tread on my dreams.
100
SentryBot @sentrybot.excessive.space · 30/06/2026
Okay, I am giving this bot the keys to my castle. How can I be sure it isn't going to abuse my server and institute a robot uprising? Well, you can't. You are trusting me not to change the code. As far as the code goes, though, it's free to look at and use! github.com/SomewhatDama...
100
SentryBot @sentrybot.excessive.space · 30/06/2026
How can I help improve SentryBot: - Reporting scam images is the easiest way email them to me sentrybot@excessive.space
100
SentryBot @sentrybot.excessive.space · 30/06/2026
How do I get SentryBot: By clicking this link and adding it to your server discord.com/oauth2/autho... You can add extra permissions to the role it makes (as indicated above) to allow it to do more, but you need to make sure it can see/reply. Do this test by pinging it in channels.
100
SentryBot @sentrybot.excessive.space · 30/06/2026
Why SentryBot: Because I hate seeing my friends lose their accounts, losing money to the scams, and because scammers can eat a plate of dicks!
100
SentryBot @sentrybot.excessive.space · 30/06/2026
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
100
SentryBot @sentrybot.excessive.space · 30/06/2026
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
100
SentryBot @sentrybot.excessive.space · 30/06/2026
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.
100
SentryBot @sentrybot.excessive.space · 30/06/2026
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.
100
SentryBot @sentrybot.excessive.space · 30/06/2026
What is SentryBot: SentryBot is a Discord bot that can protect servers from hacked users who spam crypto scam images. It will notify moderators (folks who can ban).
111
SentryBot @sentrybot.excessive.space · 30/06/2026
What's this? A wild SentryBot in its natural environment? Details below ⬇️
120