Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better anti-spam measures #117

Closed
vcarl opened this issue Nov 2, 2021 · 6 comments
Closed

Better anti-spam measures #117

vcarl opened this issue Nov 2, 2021 · 6 comments

Comments

@vcarl
Copy link
Member

vcarl commented Nov 2, 2021

  • Extract URLs from messages so they can be analyzed

We currently have a "banlist" of URLs, but we only do naive string .contains() on the entire message to look for them. We've had waves of bots that post variations on visually-similar URLs that imitate Discord, Steam, etc hosts, which bypass these checks because of how simple they are. If we extract URLs from sent messages, we could do more complex processing to see if they're nefarious, like a levenshtein distance check.

@vcarl
Copy link
Member Author

vcarl commented Nov 2, 2021

A helpful regex:

const links = msg.content.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);

Cheers to @BTMPL for sourcing that

@Padmanabh82
Copy link

Ok @vcarl sir I will try to do it. But post here your list and also after detecting it what will we do ban/delete message/inform to mods ??

@vcarl
Copy link
Member Author

vcarl commented Nov 4, 2021

This would be an extension to our autoban feature, improving it so that it can catch a wider range of scam URLs

@Padmanabh82
Copy link

Padmanabh82 commented Nov 19, 2021

A helpful regex:

const links = msg.content.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);

Cheers to @BTMPL for sourcing that

@vcarl sir as per me it will work on only https links not http

@Padmanabh82
Copy link

sir in autoban feature how can one contact a mod after getting banned ?? if he has a dm opened sit he can send you message (i have tried it on other server. after living server i cannot dm a person)

@vcarl vcarl changed the title Extract URLs from messages so they can be analyzed Better anti-spam measures Dec 29, 2021
@vcarl
Copy link
Member Author

vcarl commented Jan 19, 2022

I'd still love to get some better handling for links. Right now we only check for any link at all, with some domains whitelisted. With the "spam score" we have now, we could do fancier handling of different types of spam, like insta-kicking for messages that misspell discord.com and include our spam keywords

@vcarl vcarl closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants