.weblog engine
FAQ :: Search ::  Memberlist ::  Register :: Profile ::  Usergroups ::  Log in
Log in to check your private messages ::  Download Pivot :: Support Pivot | Info
Registering only takes a minute and enables the use of private messages (PM's)
http:BL

 
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> Extension Releases
View previous topic :: View next topic  
Author Message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Sat Aug 25, 2007 12:51 pm    Post subject: http:BL Reply with quote

Extension Name: http:BL
Extension Author: Hans Fredrik Nordhaug (hansfn in the forum).

Extension Description:
    The http:BL snippet can protect your site from search engines, suspicious, harvesters, comment spammers, or a combination thereof using the http:BL service from the Honeypot project - see http://www.projecthoneypot.org/httpbl_api.php All blocked domains (IPs) are added to the spam log.


    Installation and usage:
    - Put this file in your Pivot "extensions/snippets" folder.
    - Get an http:BL API key on http://www.projecthoneypot.org/
    - Place "[[httpBL:apikey:block]]" in the first line of all the templates, just in front of the DOCTYPE statement. "block" can be any of "search_engine", "suspicious", "harvester", "comment_spammer" or a combination using "|". To block all harvesters and comment_spammers, which is the default, use
    Code:
    [[httpBL:apikey:harvester|comment_spammer]]

    You can also set at which threat level a domain should be blocked.
    Code:
    [[httpBL:apikey:suspicious:5]]

    blocks all (suspicious) domains with threat level 5 and higher, the default is 10.


    Limitation/issues:
    - The default threat level of 10 is quite randomly selected: "Website administrators are encouraged to experiment with different threat scores and set them at what you determine is an appropriate level for your own site."
    - The last seen/age value is not taken into account (yet): "This value is useful in helping you assess how 'stale' the information provided by http:BL is and therefore the extent to which you should rely on it."
    .

Rough changelog:
25.08.2007: Initial release

Note: Please post all questions and discussions about this extension in this thread. Keeping the discussion confined to one thread will help others if they have any questions.



snippet_httpBL.zip
 Description:

Download
 Filename:  snippet_httpBL.zip
 Filesize:  2.08 KB
 Downloaded:  915 Time(s)


_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Sun Aug 26, 2007 4:16 am    Post subject: Re: http:BL Reply with quote

I'll use this post as a TODO list:

1. Add whitelisting. (This easy to do - just waiting for somebody actually requesting/needing it.)
2. Caching. Hm, I think it's wasted since the local DNS server is already doing caching, but if the DNS server is much "slower" than the webserver ...

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Sun Aug 26, 2007 4:18 am    Post subject: Re: http:BL Reply with quote

By the way - using http:BL actually works great. From my spam log - I love it:
Quote:
August 26, 2007, 7:49 am - 192.72.124.11 IP listed in http:BL as comment spammer with threat level 34, last seen 1 days ago
Listed in http:BL
August 26, 2007, 7:50 am - 218.234.66.132 IP listed in http:BL as comment spammer with threat level 27, last seen 2 days ago
Listed in http:BL
August 26, 2007, 7:50 am - 193.191.168.158 IP listed in http:BL as comment spammer with threat level 49, last seen 2 days ago
Listed in http:BL

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
macraig
Pivot Groupie
Pivot Groupie


Joined: 12 Jan 2007
Posts: 74
Location: USA

PostPosted: Thu Sep 06, 2007 7:39 am    Post subject: Re: http:BL Reply with quote

What code should the snippet add to the top of generated pages? I'm seeing nothing but a blank line added to the top of each displayed page. Does it only add HTML if a "bad" IP is detected, or does it add something regardless? Did I do something wrong, and that blank line is the result?
_________________
Mark
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Thu Sep 06, 2007 8:03 am    Post subject: Re: http:BL Reply with quote

Look at the source code of the PHP file (on the FTP server) - the snippet doesn't produce any HTML output, not even a blank line. (Put the tag on the same line as DOCTYPE, in front of it.) If a bad IP is detected it is blocked and some minimal explanatory HTML is displayed (in stead of the normal page).
_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
macraig
Pivot Groupie
Pivot Groupie


Joined: 12 Jan 2007
Posts: 74
Location: USA

PostPosted: Thu Sep 06, 2007 2:18 pm    Post subject: Re: http:BL Reply with quote

Hansfn, I inserted the snippet call on a separate line above <DOCTYPE>. I haven't changed that yet. I just checked my spam log since adding this snippet (and pooh, replacing my old code) last night, and I've got some entries in there I've never seen before:

Code:
September 6, 2007, 5:05 am  -  203.223.152.82   
Comment blocked   
September 6, 2007, 5:05 am  -  203.223.152.82   
Comment blocked   
.
.
September 6, 2007, 8:48 am  -  62.215.3.45   
Comment blocked   
September 6, 2007, 8:48 am  -  202.170.51.11   
Comment blocked   
September 6, 2007, 8:57 am  -  202.163.200.153
http://ferrari-merchandise.koonsmazda.cn/northwest-honda-used-auto-parts.htm   Sorry :(
Comment blocked


I tracked down "Comment blocked" in module_spamkiller.php, which is coded as a default catch-all choice in this switch structure:

Code:
   switch($p_sType)  {
      case "trackback":
         $desc = "Trackback blocked";
         $text = $p_sSpam;
         break;
      case "htrackback":
         $desc = "Trackback blocked (Hardened)";
         $text = $p_sSpam;
         $p_sUrl = $p_sAdditional;
         break;
      case "hashcash":
         $desc = "Hashcash violation";
         $text = $p_comment;
         break;
      case "spamquiz":
         $desc = "Wrong Quiz Answer";
         $text = $p_comment;
         break;
      case "sskc":
         $desc = "Server Key check";
         $text = $p_comment;
         break;
      case "bpcomment":
         $desc = "Blocked Phrases comment";
         $text = $p_sSpam;
         break;
      case "bpreferer":
         $desc = "Blocked Phrases referer";
         $text = $p_sSpam;
         break;      
      case "closedcomments":
         $desc = "Comment on closed entry";
         $text = $p_comment;
         break;
      default:
         $desc = "Comment blocked";
         $text = $p_comment;
         break;


So I then looked in httpBL.php, and saw this call to the logspammer() function in module_spamkiller.php, which uses that switch statement:

Code:
logspammer($text,"httpBL","Listed in http:BL");


So, the httpBL snippet appears to be working, but I don't have needed modifications to module_spamkiller.php that would allow it to properly record full details of how and why.

I think I know what needs to be added, but shouldn't an updated module_spamkiller.php have been included in the httpBL snippet's Zip file?

_________________
Mark
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Thu Sep 06, 2007 3:36 pm    Post subject: Re: http:BL Reply with quote

You haven't upgrade to 1.40.4 yet which is strongly recommended security upgrade and also provides better logging (that http:BL relies on).

PS! You are correct that what you see is http:BL in action.

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
macraig
Pivot Groupie
Pivot Groupie


Joined: 12 Jan 2007
Posts: 74
Location: USA

PostPosted: Thu Sep 06, 2007 3:58 pm    Post subject: Re: http:BL Reply with quote

Yeah, I knew about the update, but it's tedious work to compare every file for custom changes and reproduce them in the right places in the new files. Everyone else may have fancy tools to automate some of that, but I have to do it the hard way... so I've been putting it off until I thought I could afford the time to do it.

It's good at least to know it's working. I'd LOVE to see the looks on the spammers' faces when they get that Forbidden page!

_________________
Mark
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Fri Sep 07, 2007 6:09 am    Post subject: Re: http:BL Reply with quote

Quote:
[...]it's tedious work to compare every file for custom changes and reproduce them in the right places in the new files.

Just a short reply - this issue probably deserves it's own thread.
1) Updating is inevitable. No matter how good a product you use there will be important (urgent) security updates and (probably) new features that you want.
2) As a consequences of 1) you should strive for doing as few modifications as possible. (Do you really need to change default behavior X?) Adding official patches is of course OK since they will be part of whatever version you upgrade to.
3) If you really, really need to (many) do source code modification, learn to use a diff tool to create a patch (difference), that you can automatically reapply using a patch tool. (If you have shell access to a *nix server, the command are diff and patch. On Windows you can get the same commands at http://sourceforge.net/projects/gnuwin32/)

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
]x[
Sub Minion of Pivot Groupie-Ness
Sub Minion of Pivot Groupie-Ness


Joined: 08 Sep 2003
Posts: 22

PostPosted: Thu Aug 20, 2009 1:20 pm    Post subject: Re: http:BL Reply with quote

Will this extension be ported to PivotX any time soon ? Or does it work with some small modifications ?
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5289
Location: Molde, Norway

PostPosted: Thu Sep 17, 2009 5:23 pm    Post subject: Re: http:BL Reply with quote

It's ported to PivotX now - read the http:BL thread in the PivotX forum.

Actually, porting this extension was some work ...

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> Extension Releases All times are GMT - 4 Hours
Page 1 of 1
|
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Your generosity is appreciated!
Gambling News was the last to make a donation
:: go here for sponsorship information ::
Special thanks to our platinum sponsors: Gambling News  
DreamHost

powered by phpBB | RSS Feed