NodeBB anti spam
-
@psychobunny said:
an upvote/downvote plugin could ideally flag someone as a spammer after they reached X amounts of downvotes and then hide their posts. but if that wasn't in the core already then I'd need your plugin for that plugin to work.
Instead of depending on the number of down votes to hide a post, how about adding a Flag_This_Post feature that can be used to alert the admin that a post is spam and/or requires moderation. The up/down vote feature may then be reserved solely for judging the usefulness of a post to a topic or a topic itself. Does that make sense?
-
A very simple solution to prevent a lot of automated signups without requiring a Captcha or Question/Answer form:
- Honeypots. Simply have some input elements with the name attribute being something like username, password and the like and an id attribute either equal to or containing the same phrase. These inputs should not be visible to the user and contain no data, so whenever something is entered into these forms, you'll know it's a bot.
Ideally these elements or their container should also include the actual labels shown to the user, to fool the bots looking at the label rather than the input in an attempt to bypass the prevention described in 2. - Have the actual input elements be unique to each session. Simply make the name and id attributes of the actual input forms be unique to each session. Shouldn't be too difficult, yet still blocks a lot of scripts that do not take this into consideration. This should not apply to the honeypot inputs described in 1., for obvious reasons.
- Randomize the order of the input elements. Some bots look at the order of the input elements rather than their name and id attributes. Simply randomizing it should prevent this.
- Honeypots. Simply have some input elements with the name attribute being something like username, password and the like and an id attribute either equal to or containing the same phrase. These inputs should not be visible to the user and contain no data, so whenever something is entered into these forms, you'll know it's a bot.
-
@bentael said:
@Xiph all this is good, but doesn't prevent a targeted-script
Well, the theory of using those three methods of prevention combined is that only A. a regular, normal human (sorry, mutants and/or half-cyborg jellyfish-themed superheroes) or B. a bot rendering the entire page can register.
Having to actually render the page does massively increase the cost of creating spam accounts though and as @julian said, if you really really want to spam you can always just have a human register, or do it yourself. None of this removes the need for a kind-of Akismet-ish thing as another layer of protection, it just massively reduces the amount of automated registrations.EDIT It seems like XenForo does in fact allow you to check all posts with Akismet.
-
@fantapop I just released a sort of working version,
https://www.npmjs.org/package/nodebb-plugin-spam-be-gone
this one only work with the Honeypot Project, i would appreciate some testing help. i didn't get a chance to actually test real IPs, only tested with127.0.0.1
which is close to useless. Tomorrow, I'll try to hardcode fake spammy IPs for better coverage.@julian, I got the Honeypot plugin to work, nice job on that nodejs module, but that only works for User registration, I was aiming for post creations as well,
I need a hook on
Post.create
and/orTopic.post or Topic.reply
to get a check with Akismet, but Akismet requires at least these 3user_ip: req.ip , user_agent: req.get('User-Agent'), blog: req.host,
I could also use
postData.user.username
andpostData.content
let me know what you think is the best approach and I can add the hooks and submit a PR.
-
So, I don't know if you want to plumb through the
req
object, or maybe implement the filter on a higher level, maybe at thePOST /api/{route}
handler -
Seems legit.
Topic.post
andTopic.reply
are both standalone functions, but to follow DRY,Topic.post
callsTopic.reply
Topic.reply
callsPosts.create
So I believe putting a hook in at the
Posts.create
level (here, as the first waterfall function) would be easiest.I suggest
filter:posts.check
orfilter:posts.validate
as a name.filter:posts.save
is already there, but the post creation process has already begun, so it is used mostly for munging data after it is destined to enter the database. -
ok i'll investigate and post back
-
okay.png
-