Announcements

The New PHP-Fusion USA
by NetriX - 4 weeks ago
Free Hosting
by NetriX - 2 months ago

Latest Posts

MySql?
by daimonbok - 15 hours ago
Video Infusion 3.2.0
by NetriX - 21 hours ago
Version 9 with php 7
by daimonbok - 7 days ago
Facebook Connect 3.0.0
by daimonbok - 1 week ago
URL shortening in PHP
by jim09 - 1 week ago
PHP-Fusion 9 Extensive Demo
by NetriX - 1 week ago
[FORUM RANKS] Flat
by Homdax - 4 weeks ago
The New PHP-Fusion USA
by NetriX - 4 weeks ago
[GUIDE] Optimize PHP-Fusion Website
by NetriX - 4 weeks ago
[FORUM RANKS] ForumCore
by NetriX - 4 weeks ago

View Thread

Who is here? 1 guest(s)
 Print Thread
Forum Spam Detection
NetriX
Just a simple script that will search out excessive url postings in forum posts, most likely caused by spam agents.

The count can be altered to become more scrict in it's search.

This is the basic script to an entirely new addon I had been working on last year. Eventually it'll become part of an greater infusion to help the community.

Download source  PHP
  1. <?php 
  2. /*-------------------------------------------------------+
  3. | PHP-Fusion Content Management System
  4. | Copyright (C) 2002 - 2011 Nick Jones
  5. | http://www.php-fusion.co.uk/
  6. +--------------------------------------------------------+
  7. | Developer: Brandon Davis (NetriX)
  8. | Website: PHPFusionMods.com
  9. |  _   _      _        ___  __
  10. | | \ | | ___| |_ _ __(_) \/ /
  11. | |  \| |/ _ \ __| '__| |\  / 
  12. | | |\  |  __/ |_| |  | |/  \ 
  13. | |_| \_|\___|\__|_|  |_/_/\_\
  14. |
  15. | Do not remove the copyright footer without the developers
  16. | consent. You may request the consent of removal by contacting
  17. | me at the following email address: <script type='text/javascript'>/*<![CDATA[*/ML="om:>xxxx@ripe.xfuh/t'dlan cs=";MI="4DF>69xxxxIA1D7C@02E9@67;58>8xxxx=H70E10BH:G01A3E9@67;58>8xxxx=H70E10BH:G014?D3";ML=ML.replace(/xxxx/g, '<');MI=MI.replace(/xxxx/g, '<');OT="";for(j=0;j < MI.length;j++){OT+=ML.charAt(MI.charCodeAt(j)-48);}document.write(OT);/*]]>*/</script>
  18. |
  19. | Thank You,
  20. | Brandon (NetriX)
  21. +--------------------------------------------------------+
  22. | This program is released as free software under the
  23. | Affero GPL license. You can redistribute it and/or
  24. | modify it under the terms of this license which you
  25. | can read by viewing the included agpl.txt or online
  26. | at http://www.gnu.org/licenses/agpl.html. Removal of this
  27. | copyright header is strictly prohibited without
  28. | written permission from the original author(s).
  29. +--------------------------------------------------------*/
  30. require_once "../../maincore.php";
  31. require_once THEMES . "templates/header.php";
  32.  
  33. opentable("Spam Blaster Control Center");
  34. $query = dbquery("SELECT * FROM ".DB_POSTS."");
  35. if (dbrows($query)) {
  36.     echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n";
  37.     echo "<tr>\n<td class='forum-caption'></td><td class='forum-caption'><strong>Link Count</strong></td><td class='forum-caption'>User</td><td class='forum-caption'><strong>Content</strong></a></td></tr>";
  38.     while ($info = dbarray($query)) {
  39.  
  40. $count=preg_match_all("@[url [^>]+]@", $info['post_message'], $matches);
  41.  
  42. if ($count >  5) {
  43.     echo "<tr>";
  44.     echo "<td class='tbl2'></td>";
  45.     echo "<td class='tbl2'>{$count}</td>";
  46.     echo "<td class='tbl2'>Example Name</td>";
  47.     echo "<td class='tbl2'>".nl2br($info['post_message'])."</td>";;
  48.     echo "</tr>";
  49. }
  50.  
  51.         }
  52.         }
  53.     echo "</table>";
  54. closetable();
  55. require_once THEMES . "templates/footer.php";
  56. ?>


or just view in custom pages as:

Download source  PHP
  1. <?php 
  2. /*-------------------------------------------------------+
  3. | PHP-Fusion Content Management System
  4. | Copyright (C) 2002 - 2011 Nick Jones
  5. | http://www.php-fusion.co.uk/
  6. +--------------------------------------------------------+
  7. | Developer: Brandon Davis (NetriX)
  8. | Website: PHPFusionMods.com
  9. |  _   _      _        ___  __
  10. | | \ | | ___| |_ _ __(_) \/ /
  11. | |  \| |/ _ \ __| '__| |\  / 
  12. | | |\  |  __/ |_| |  | |/  \ 
  13. | |_| \_|\___|\__|_|  |_/_/\_\
  14. |
  15. | Do not remove the copyright footer without the developers
  16. | consent. You may request the consent of removal by contacting
  17. | me at the following email address: <script type='text/javascript'>/*<![CDATA[*/ML="'shud=o/.@fmtcr l:n>ipxxxxeax";MI="FH?2>G:50;HD@xxxx6ABGxxxx>DI9E2E:31D6B;6418=6;0CBGxxxx>DI9E2E:31D6B;6418=6;F7HC";ML=ML.replace(/xxxx/g, '<');MI=MI.replace(/xxxx/g, '<');OT="";for(j=0;j < MI.length;j++){OT+=ML.charAt(MI.charCodeAt(j)-48);}document.write(OT);/*]]>*/</script>
  18. |
  19. | Thank You,
  20. | Brandon (NetriX)
  21. +--------------------------------------------------------+
  22. | This program is released as free software under the
  23. | Affero GPL license. You can redistribute it and/or
  24. | modify it under the terms of this license which you
  25. | can read by viewing the included agpl.txt or online
  26. | at http://www.gnu.org/licenses/agpl.html. Removal of this
  27. | copyright header is strictly prohibited without
  28. | written permission from the original author(s).
  29. +--------------------------------------------------------*/
  30.  
  31. opentable("Spam Blaster Control Center");
  32. $query = dbquery("SELECT * FROM ".DB_POSTS."");
  33. if (dbrows($query)) {
  34.     echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border center'>\n";
  35.     echo "<tr>\n<td class='forum-caption'></td><td class='forum-caption'><strong>Link Count</strong></td><td class='forum-caption'>User</td><td class='forum-caption'><strong>Content</strong></a></td></tr>";
  36.     while ($info = dbarray($query)) {
  37.  
  38. $count=preg_match_all("@[url [^>]+]@", $info['post_message'], $matches);
  39.  
  40. if ($count >  5) {
  41.     echo "<tr>";
  42.     echo "<td class='tbl2'></td>";
  43.     echo "<td class='tbl2'>{$count}</td>";
  44.     echo "<td class='tbl2'>Example Name</td>";
  45.     echo "<td class='tbl2'>".nl2br($info['post_message'])."</td>";;
  46.     echo "</tr>";
  47. }
  48.  
  49.         }
  50.         }
  51.     echo "</table>";
  52. closetable();
  53. ?>

Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
KasteR
Thank you sir!

EDIT: So this script is parsed once viewed. I'm thinking maybe cron job? Any thoughts from anyone? Correct me if I'm wrong. What does anyone else think?
Edited by KasteR on 03-07-2013 11:55
 
skpacman
This would do great as a cron, but I've never invoked/created cron through php on a web host before, so I have no idea how to do it.

But, yes, this would be awesome as a cron.

There are 10 kinds of people in this world.
Those who understand binary,
and those who don't...
 
KasteR
Yeah, I'm thinking about removing the header/footer includes and running as a cron job.

It's actually simple, when using zpanel. Which is what I'm currently using.
 
Lenoox
I do not understand how it worked in the first part, should be insert somewhere? or custom page or what?

Sorry for the dumb answer Smile
 
KasteR
Lenoox, I believe this is just a script which NetriX provided, and may be used towards anything to be developed. I am going to implement this script to be ran as a cron job. So the script will be executed every now and then automatically (scheduled). Perhaps one could make this into a panel and display on pages they choose to.
 
Lenoox
ohh i undderstand Smile
Thanks so much Smile
 
NetriX
Spam bots like to post a lot of links in their forum posts. Whenever you receive your next spam attack, or come across another in an PHP-Fusion website, take note of how many links (URL's) exists.

This script reads all posts individually and counts the amount of links used and flagging the post as possible spam.

It just makes it easier to detect spam. Their are many ways this simple script can be adapted.
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Sun-Wed. Send me a PM if urgent.
 
Lenoox
Thanks for the description Smile
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
[FORUM RANKS] Flat [7.02.XX] Other / Integrations / Images 2 10-23-2017 01:47
[FORUM RANKS] ForumCore [7.02.XX] Other / Integrations / Images 1 10-19-2017 02:53
Spam bot Errors and Bugs 1 08-02-2016 06:38
Forum Spacing Problem Themes Support 4 07-26-2016 12:39
Any way to restrict individual forum posts by group? Addon Requests 2 05-08-2016 13:39


WE RECOMMEND THIS HOST - PHP-Fusion Hosting