// post · 204

Spam by $_POST part 2.

Spam sucks. I talked briefly about spam by $_POST here: http://blog.dalegroup.net/archive/blog/newsid/142

Stuart (http://smkz.is-a-geek.net/) has been receiving vast quantities of spam on his wordpress site. This is because the system is standard across all wordpress installs making it easier for bots to target these sites.

The bots have customised settings that randomly send $_POST information directly to the wordpress (or other) site, in this case to the file wp-comments.php.

I tried to help Stuart with his problem by writing an htaccess rule that blocked direct access attempts to this file (and a few others).

RewriteCond %{HTTP_REFERER} !^http://smkz.is-a-geek.net/(.*)$ [NC]
RewriteCond %{REQUEST_URI} .*wp-comments-post.php$ [OR]
RewriteCond %{REQUEST_URI} .*wp-comments.php$ [OR]
RewriteCond %{REQUEST_URI} .*wp-comments-popup.php$ [OR]
RewriteCond %{REQUEST_URI} .*wp-comments-reply.php$
RewriteRule .* - [F,L]

Although it didn't take long for the bots to work around this.

I have now modified his wordpress install to have a hidden input field. What this does is sends a value to wp-comments.php when the user submits a comment. It is then checked to make sure it is correct, otherwise the comment isn't posted.

So it looks something like this:

wp-comments.php (and popup one if used)




wp-comments-post.php
//Start Dale's spam block here
if ($_POST['the-dale-spam-block'] != 'same random number here') {
die('spam block');
};
//Finish Dale's spam block here

If people really wanted to spam his site they could just take this random number and modify the bot settings. Although I don't think they will (too much effort for one website).

Although I've developed a new system that is currently working on this site which is much better. I do plan to port this to wordpress, but it currently doesn't make use of sessions (except in the admin panel) and therefore doesn't support what I am doing on this site.

Think of this system as one like those random image number generators but without the user needing to enter anything extra in.

I randomly generate a string that is entered into a hidden post field. This string is also stored in a session. When the user posts this string is sent to the post file. The file then reads the sent string (from the user) and the string out of the session. If both are the same the comment can be posted.

This is good for two reasons.
1) The number changes every reload and thus a bot cannot be customised around this
2) The use of cookies is needed, almost every user has cookies turned on but bots don't and thus cannot store the session id.

Cool. So I'll look into wordpress support later but use the system I've done above to block stuff for the time being.

To be continued...
// post · 188

A laptop.....a....mac laptop?!?!

A laptop.....a....mac laptop?!?!

Right well I’ve been a bit absent from the old web site lately.

I had Physics last week on Wednesday which was surprising not too bad, considering I only started doing work in physics after we’d finished our school classes ;) But yeah I was fairly happy with it. I’ve been pretty happy with all my exams, there hasn’t really been anything that I wasn’t expecting and everything seems easier than the trials. Nice. My last exam is on Friday (last day of the HSC), which happens to be ITF (crappy computer course) so I’m not planning on studying until latterrrr.

Tomorrow ucosty is having a lan party so I am looking forward to that. A good way to start the holidays, even if I’ve got an exam left! :p

In two weeks time I will be 18, which is pretty scary. But birthdays are good because you get free stuff

So I’ve decided I think I’ll be getting a laptop. But it isn’t all that easy to find something that is exactly what you want. I’ve got about $AU2000 to spend. You can get a pretty beefy laptop if you spend about $2500 but that is a bit too much for me.

I am looking at two laptops currently. A Dell Inspiron 8600, a Centrino based PC
(http://www1.ap.dell.com/content/products/productdetails.aspx/inspn_8600_au?c=au&l=en&s=dhs&~ck=mn) or an Apple iBook 14” (http://www.apple.com.au/ibook/)

Both seem to be about the price I want. I can get a student discount of about $200 so that would be good.

I just really don’t know what I want. I would be able to get a Radeon 9600 in the PC where as the Mac would only have a Radeon 9200. But I’d get a bigger hard drive in the mac. I’d also get Bluetooth in the Mac.

Both come with a CDRW/DVD, Wireless, working battery (big plus), colour screen (not used to that), 512mb Ram. The PC would be a 1.4GHz Pentium-M and the Mac would be a 1.33GHz G4.

I wouldn’t really be using it for games so I suppose the video card doesn’t matter. I’d like a Mac for OS X. It’s built on BSD plus has all the nice mac features.

But I’ve been a PC user since DOS 5.0 and the PC laptop would be able to do games (better video card than my PC).

I was talking to one of my friend’s dads yesterday and he is a big mac fan and that I’d really like it. He is a power user so he knows stuff about them, not just point and click. I also like the look of the mac better.

Microsoft is going no where with Windows at the moment. I’d probably end up installing Windows 2000 on it. I’m not a fan of the XP bloat. Apple is releasing OS X 1.4 Tiger next year, but also OS X 1.3 is really nice. I love the look of Exposé (http://www.apple.com.au/macosx/features/expose/).

Argh. So yeah. Fast PC or sexy Mac. Software really isn’t an issue. I do web development, email, music, web browsing. Both have all the software I’d need. I’m leaning for a mac just because I like change. Plus the whole niche groupie thing that comes with being a mac owner.

Does anyone have a Mac laptop? Are they funky? There is an Apple shop in Balmain so I might head over there today.
// post · 152

Wordpress 1.2.1

This release of Wordpress is principally a bug fix and security release. This version fixes the problems talked about here (http://blog.dalegroup.net/archive/blog/newsid/149) and also a few other problems. The full run down can be found here:
http://wordpress.org/development/2004/10/wp-121/

It is highly recommended that you upgrade to this version asap.

[quote]Upgrading from 1.2 is very easy. Your existing templates and plugins should work just fine; all you need to do is overwrite the wp-* files and folders. To upgrade:

1. Download 1.2.1
2. Unzip
3. Upload the new files to your site, taking care not to overwrite anything you may have modified like index.php
[/quote]

To download the latest version see this link: http://wordpress.org/download/
// post · 149

XSS Security Holes in WordPress

Security vulnerabilities have been found in WordPress that allows users to enter code into the site through certain urls (whose content is not checked).

Examples:
http://[victim]/wp-login.php?redirect_to=[code]
http://[victim]/wp-login.php?mode=bookmarklet&text=[code]
http://[victim]/wp-login.php?mode=bookmarklet&popupurl=[code]
http://[victim]/wp-login.php?mode=bookmarklet&popuptitle=[code]
http://[victim]/admin-header.php?redirect=1&redirect_url=%22;[code]//
http://[victim]/bookmarklet.php?popuptitle=[code]
http://[victim]/bookmarklet.php?popupurl=[code]]
http://[victim]/bookmarklet.php?content=[code]
http://[victim]/bookmarklet.php?post_title=[code]
http://[victim]/categories.php?action=edit&cat_ID=[code]
http://[victim]/edit.php?s=[code]
http://[victim]/edit-comments.php?s=[code]
http://[victim]/edit-comments.php?mode=[code]

XSS (cross-site scripting) holes are common in many php scripts and Wordpress isn't the only effected blogging tool. LiveJournal and Blogger are also vulnerable.

Athlough this is a somewhat large security issue wordpress users shouldn't be too worried, all scripts have bugs.

The Wordpress team are working on a 1.2.1 release to fix these issues. So look out for it.

Related links:
http://wordpress.org/support/4/13818
http://wordpress.org/support/7/13856
http://news.netcraft.com/archives/2004/09/30/security_holes_in_wordpress_blogging_tool.html
http://secunia.com/advisories/12683/
// post · 112

Wordpress now has a bit of dale in it.

I'm one for gloating, so I thought I'd try and raise ye old ego a bit more (as you do ;)). Anyway as you may (or probably may not) know I hacked apart wordpress to leach some of its sending trackback function and found a very small bug. The bug being if you ran wordpress on a non standard port (i.e anything other than 80) then people would be unable to send a trackback to that site. Wordpress ignored the fact that someone may have enter a port number into the trackback url. Only a small bug.
So I emailed the good matt ( http://www.photomatt.net ) about the problem and included a fix for it. Less than 24 hours later wordpress is patched and the latest nightly build includes this small fix.

It's just cool that anyone can help add/fix things to open source software. So praise open source (and wordpress for being so).

w00t

/end ego boosting post ;)

no I'll never like wordpress, shutup! :S
// post · 2

Complete backend update

I've done a complete update of the backend of my website today. Every piece of text you now see on this website is coming
to you live from my database! ;) It's very cool. Something I've been wanting to do for a while. Currently I haven't rewritten an admin panel
although it is in the works as we speak. Very cool. Also got some maths done today. hehe nice.