hide spam in active topics

A place to submit all custom code, scripts, and programs.
Forum rules
Do NOT post malicious code or programs. Please review all code posted in this forum before downloading or running any of the code or programs here.

hide spam in active topics

Post by pretentious on Mon Jul 27, 2015 9:57 pm
([msg=89123]see hide spam in active topics[/msg])

Yo kuochang
https://www.youtube.com/watch?v=OGp9P6QvMjY
This script shadow bans bots that use what seems to me like a pretty generic title.
If you have 'CC' in your title, it will be removed from the active topics. this can be made more specific if required, as well as using regex
Code: Select all
// ==UserScript==
// @name        remove_spam
// @namespace   https://hackthissite.org
// @include     https://www.hackthissite.org/forums/search.php?search_id=active_topics*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js
// @version     1
// @grant       none
// ==/UserScript==


function displayActiveTopics(){
       $(".row").each(function(i, obj) {
              // traverse through the xml tree
              var icon = $(".icon:first",$(obj));
              var dt = $("dt", $(icon));
              var title = $(".topictitle", $(dt)).text();// title is found
              if(title.indexOf("CC") != -1){
                    $(obj).html("");
              }
       });
}
displayActiveTopics();

It still leaves the blue break line but i'm not that worried.
We could also script it to automatically report that post but that probably isn't something that should be automated while i'm comparing title to 'CC' :)
Goatboy wrote:Oh, that's simple. All you need to do is dedicate many years of your life to studying security.

IF you feel like exchanging ASCII arrays, let me know ;)
Can you say brainwashing It's a non stop disco
User avatar
pretentious
Addict
Addict
 
Posts: 1203
Joined: Wed Mar 03, 2010 12:48 am
Blog: View Blog (0)


Re: hide spam in active topics

Post by tremor77 on Mon Jul 27, 2015 10:39 pm
([msg=89125]see Re: hide spam in active topics[/msg])

not a bad idea, but wouldn't it be better and more effective to do it during the form submit when the bot makes the actual post? this looks like it hooks user actions for displaying active topics.. at this point the post is already made. I'd write something to evaluate new posts subjects and body content for certain keyphrases and outbound links, then give it a spam score.. if the score is greater than a threshold the topic would go into instant moderation queue for mods to approve or delete.
User avatar
tremor77
Addict
Addict
 
Posts: 1098
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)


Re: hide spam in active topics

Post by pretentious on Tue Jul 28, 2015 7:08 am
([msg=89128]see Re: hide spam in active topics[/msg])

tremor77 wrote:wouldn't it be better and more effective to do it during the form submit when the bot makes the actual post? this looks like it hooks user actions for displaying active topics.. at this point the post is already made.

Exactly, but without having access to the 'model', the next best thing is to alter the 'view' to suit myself
tremor77 wrote:I'd write something to evaluate new posts subjects and body content for certain keyphrases and outbound links, then give it a spam score.. if the score is greater than a threshold the topic would go into instant moderation queue for mods to approve or delete.

probably better yet, use capcha's for posting(unless they're easy to break, haven't really kept up with it). With this particular website, I would probably suggest it would be difficult to program a spam scoring system, I've just gone for the lowest common denominator. Picking low hanging fruit is my middle name :P
Goatboy wrote:Oh, that's simple. All you need to do is dedicate many years of your life to studying security.

IF you feel like exchanging ASCII arrays, let me know ;)
Can you say brainwashing It's a non stop disco
User avatar
pretentious
Addict
Addict
 
Posts: 1203
Joined: Wed Mar 03, 2010 12:48 am
Blog: View Blog (0)


Re: hide spam in active topics

Post by tremor77 on Tue Jul 28, 2015 8:47 pm
([msg=89137]see Re: hide spam in active topics[/msg])

captcha's on posts are a tad annoying but, ya know.. so is 500 spam threads.. i'd vote for a simple math captcha next to the submit button.. would be enough to atleast slow em down
User avatar
tremor77
Addict
Addict
 
Posts: 1098
Joined: Wed Mar 31, 2010 12:00 pm
Location: New York
Blog: View Blog (0)


Re: hide spam in active topics

Post by anarchy420x on Wed Jul 29, 2015 1:22 am
([msg=89140]see Re: hide spam in active topics[/msg])

I'd rather deal with spam threads than capatcha. It seems to me that the thread posts were hand inputted. I've not seen more than 3 of the same posts spammed.
A broken clock is right twice a day, however, I am neither up that early nor up that late...
anarchy420x
Poster
Poster
 
Posts: 299
Joined: Thu Oct 16, 2008 12:43 am
Blog: View Blog (0)


Re: hide spam in active topics

Post by -Ninjex- on Wed Jul 29, 2015 2:55 am
([msg=89141]see Re: hide spam in active topics[/msg])

anarchy420x wrote:I'd rather deal with spam threads than capatcha. It seems to me that the thread posts were hand inputted. I've not seen more than 3 of the same posts spammed.


I think the idea was to have a threshold that determines the possibility of spam. If that threshold exceeds a specific limit, then a captcha should be needed to post, otherwise you can post as normal.
For example, a title with CC in the name adds a point, then if the post has an e-mail in it, another point is added (usually spammers attach their e-mail as contact), if the post has other information that spammers usually use, it could add more points. Once x points is reached, you get a captcha prompt.

Also, I'm not sure I quite agree with the fact that these threads are hand input either.

A spam thread on HTS
viewtopic.php?f=37&t=12583

Duplicated on other forums:
http://www.blizzhackers.cc/viewtopic.ph ... 87&start=0
http://forum.bodybuilding.com/showthrea ... =168267753
http://fajarsec.informe.com/dealer-of-c ... t6663.html

The list goes on:
https://www.google.com/?gws_rd=ssl#q=%2 ... aler+Of+CC

Oh, and fuck only blocking spam in active topics, it should be enabled in all thread listings.



anarchy420x wrote:I'd rather deal with spam threads than capatcha. It seems to me that the thread posts were hand inputted. I've not seen more than 3 of the same posts spammed.


And on another note, you don't 'deal' with them, the moderators do, and at an ever increasingly slower pace.

In the words of Albert,
"Intellectuals solve problems, geniuses prevent them."
image
For those that know
K: 0x2CD8D4F9
User avatar
-Ninjex-
Moderator
Moderator
 
Posts: 1691
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)


Re: hide spam in active topics

Post by anarchy420x on Wed Jul 29, 2015 10:38 pm
([msg=89149]see Re: hide spam in active topics[/msg])

Ninjex, you're right, it could be a bot, but copy&past would do the trick quick enough.

I may not deal with the removal of spam posts and the banning of user; I do encounter spam threads as a user of the forums. I don't know why you felt the need to diminish my opinion.

I think your idea of point based capatcha is great, and you should work with HTS staff to implement it.
A broken clock is right twice a day, however, I am neither up that early nor up that late...
anarchy420x
Poster
Poster
 
Posts: 299
Joined: Thu Oct 16, 2008 12:43 am
Blog: View Blog (0)


Re: hide spam in active topics

Post by -Ninjex- on Thu Jul 30, 2015 5:45 pm
([msg=89157]see Re: hide spam in active topics[/msg])

anarchy420x wrote:Ninjex, you're right, it could be a bot, but copy&past would do the trick quick enough.

At the rate of spam posts we get here, and then doing a comparison and seeing the same posts duplicated on at least 15 other forums, I highly doubt this is a copy paste spammer. It just really doesn't seem effective, but if someone has that much time on their hands, and that's what they are spending their time doing; I kind of actually feel sorry for them.

anarchy420x wrote:I may not deal with the removal of spam posts and the banning of user; I do encounter spam threads as a user of the forums. I don't know why you felt the need to diminish my opinion.


Sorry, I did not intend to diminish your opinions. I simply was looking at the most logical explanation, and to me it points towards a bot. Also, yes you encounter spam posts as a user, and that's why pretentious developed this script, so that you will not encounter them, nor do you have to wait for developers to develop such a system. I also tend to take things in very literally (in regards to "dealing with spam") sorry if that came off in the wrong way.
image
For those that know
K: 0x2CD8D4F9
User avatar
-Ninjex-
Moderator
Moderator
 
Posts: 1691
Joined: Sun Sep 02, 2012 8:02 pm
Blog: View Blog (0)


Re: hide spam in active topics

Post by anarchy420x on Thu Jul 30, 2015 10:45 pm
([msg=89161]see Re: hide spam in active topics[/msg])

Thanks for the clarification; I wasn't sure if I pissed you off at some point.
A broken clock is right twice a day, however, I am neither up that early nor up that late...
anarchy420x
Poster
Poster
 
Posts: 299
Joined: Thu Oct 16, 2008 12:43 am
Blog: View Blog (0)


Re: hide spam in active topics

Post by tgoe on Sat Aug 01, 2015 2:21 am
([msg=89185]see Re: hide spam in active topics[/msg])

While I was a mod I had a bot that would sms me on duplicate titles/msg bodies. I caught a bit of spam that way but this forum's low volume is easy to manage manually. The spam that sticks around for days is inexcusable.
User avatar
tgoe
Contributor
Contributor
 
Posts: 716
Joined: Sun Sep 28, 2008 2:33 pm
Location: q3dm7
Blog: View Blog (0)


Next

Return to Custom Code

Who is online

Users browsing this forum: No registered users and 0 guests