Google Search

Google

Tuesday, January 13, 2009

Math Comment Spam Protection Plugin

This plugin for Wordpress 1.5.2, 2.0.x and 2.1 asks the visitor making the comment to answer a simple math question. This is intended to prove that the visitor is a human being and not a spam robot.

Example of such question:
Example of spam protection question

This plugin does not require JavaScript or cookies. It uses a special encryption function; the result of the question is being passed via a hidden field. The result is being compared with the value entered by the visitor – after encrypring this value as well.

Downloads

Installation

This plugin can be installed in 5 easy steps:
  • Download the plugin (see “Downloads” above).
  • Decompress the .zip archive and put the files into your plugins directory (/wp-content/plugins/) or into a sub directory of the plugins directory.
  • Enable the plugin in the WordPress Plugins admin page.
  • Go to Options / Math Comment Spam, adjust the options and save.
    Important: You need to save the options when you use this plugin the first time or if you have updated from a previous version.
  • Add code to the comments.php of your theme. In the following an example for the Wordpress standard theme (Kubrick):
    /****** Math Comment Spam Protection Plugin ******/
    if ( function_exists('math_comment_spam_protection') ) {
    $mcsp_info = math_comment_spam_protection();
    ?>



    " />


    Add this code for example right after the field for the website URL.

Frequently Asked Questions

  1. Question: I’ve installed this plugin but still get spammed, why?
    Answer: Are you sure that you get comment spam, isn’t it trackback spam? In case of trackback spam consider installing a plugin like Simple Trackback Validation Plugin.

Other Plugins for Spam Protection

I recommend to use the following 3 plugins for protecting your weblog from spam:

  • Simple Trackback Validation Plugin: Eliminates spam trackbacks by retrieving the web page located at the URL used in the trackback and checking if the page contains a link to your blog: if not, the trackback is placed into comment moderation queue.
  • Math Comment Spam Protection (this plugin)
  • Akismet: additional protection in case of attacks by human spammers or trackback spammers that use the permalink on the web page located at the trackback’s URL.

Related Plugins

I got the idea for this plugin from Steven Herod’s plugin Did You Pass Math?. However, the code of the Math Comment Spam Protection Plugin is completely differently. While Did You Pass Math? provides a one-click-installation which works for standard themes only, my plugin requires you to place the form in the comments.php on your own. But this has one big advantage: You can add the field whereever you want and JavaScript is not needed for positioning it. So you can use this plugin in every theme. Furthermore, it is not necessary that the visitor has enabled cookies in his/her browser. In addition, I have seen that when using the Did You Pass Math plugin and if you entered a wrong or no answer and press the back button in your browser, the comment is no more available! This is not the case when using the Math Comment Spam Protection Plugin.
Any ways: if you are afraid of modifying the source code of your theme, I recommend that you go for the Did You Pass Math? plugin.

Donation

You like this plugin? Any donation would be highly appreciated:


Version History and Changelog

  • 2.2 [2007-11-27]:
    Bug fix: two security issues (XSS) resolved.
  • 2.1 [2007-02-01]:
    Further improved hash calculation.
  • 2.0 [2006-07-30]:
    New feature: An options menu is available in the Wordpress admin options. Also, written-out numbers can be defined.
  • 1.2 [2006-07-21]:
    Bug fix: Rarely, a warning message “Division by zero” occurred (was caused by the hash function).
  • 1.1 [2006-07-09]:
    Improved hash calculation by considering date and blog title.
  • 1.0 [2006-07-03]:
    Initial release.
Support: I don’t have the time to support you on the implementation and usage of this plugin. Also the comments at this page have been turned off for this reason. However a donation may help to change my mind and support you anyway :)

How to Report a Bug: Before you report a bug, please make sure you have double-checked that you have followed the above installation instructions correctly.
Please send me your bug report by e-mail.
Bug reports are highly appreciated and will help for the continuous improvement of this plugin, however I can’t promise to get back to you in time regarding your reported bug.

Monday, October 1, 2007

Wireless Setup - Connecting Wireless Router

This is quick wireless setup. Before you configure the wireless router, you need to physical set it up first. Try to place the router in position that will best cover your wireless network. Usually the higher you place the antenna, the better the performance will be.


Connect your cable/DSL modem to the WAN port of your wireless router by using straight Ethernet cable. After that, use another straight cable to connect router’s LAN port to your computer’s Ethernet port. Usually there are up to 4 or 5 LAN ports for you to connect to computers with network cable.

The reason for connecting wireless router to your computer is to configure the router for the first time through web. You can remove the cable after router configuration.

Connect Wireless Router

After setting up the network, we need to decide what IP addresses need to be used for wireless router and computers. Click here for more explanation to do IP logical network setup and design.

For the setup that I’m using, I use IP address 192.168.1.1-254, netmask 255.255.255.0.

Ok.. Next would be important part on wireless setup, it's wireless router configuration.

Preparation for Wireless Network Setup

Ok. Let’s make preparation for wireless network setup. You can decide what wireless devices you need after this reading.


You also need to know what kind of wireless standard to be used in the network, either 802.11b, 802.11a or 802.11g. If you haven’t read about wireless standards, read it here.

Wireless Router or Wireless Access Point

Wireless router or wireless access point is the most important device you need when setting up wireless network.

You use wireless router when you are just going to build your first network at home. If you already have Ethernet network at home, just get a wireless access point and connect it to network. Check out wireless routersicon and access pointsicon here if you plan to get one. Take some time to compare the price, features and your requirements.

Wireless Router/AP

Now let’s turn to wireless portion on your computer or notebook.

Wireless Adapter for Computer Users

You will need to have wireless adaptericon installed on your computer in order to join wireless network. It’s just a PCI card with antenna which can be inserted to your computer motherboard.

Wireless Card

Wireless PCMCIA card for Notebook Users

If you have notebook with Centrino wireless technology, then you are ready to connect to wireless network. It’s just that simple.

If you are using other non-wireless ready notebooks, then you will need to install wireless PCMCIA card for accessing wireless network.

Some wireless PCMCIA card provides 50% greater range than standard 802.11g and support maximum bandwidth performance of 108 Mbps. Here are some examples of wireless PCMCIA cardicon.

Wireless PCMCIA

USB Wireless Adapter

Whether you are computer or notebook user, If you want to share wireless adapter with other computers, then you can consider to use USB wireless adapter. You can just plug/unplug the USB wireless adapter on the computer you wish to have wireless access. The size is pretty small and looks like USB thumb drive. Click here if want to check more on this USB wireless adaptericon.

USB Wireless Card

Ha.. there are quite some wireless gadgets available for wireless network setup, but only pick those you need. Let's start wireless network setup by connecting wireless router.

802.11 Wireless Standard

Before setting up wireless network, you need to understand 802.11 wireless standard that can be used. 802.11a, 802.11b and 802.11g are three popular wireless communication standards. Wireless networks can be built using any of the three, but each has its advantages and disadvantages.

802.11b

In September of 1999, the IEEE 802 committee extended the 802.11 standard, created 802.11b standard. It became popular due to low setup cost and bandwidth support up to 11Mbps in the 2.4GHz S-Band Industrial, Scientific, and Medical (ISM) frequency range. For your information, the maximum bandwidth supported by original 802.11 standard is only 2Mbps.

Being an unregulated frequency, 802.11b device can suffer interference from other wireless users, cordless phones, microwave ovens and other devices using the same 2.4 GHz band. However the interference can be avoided by placing 802.11b device a reasonable distance from other devices.

802.11a

802.11a was created the same time with 802.11b with the ability to support 55Mbps in the 5GHz band. 802.11a is not popular due to the slow availability of the 5 GHz components needed to implement products by vendor, more expensive cost and not compatible with 802.11b. The higher frequency also makes 802.11a signals have more difficulty to penetrate walls and other obstructions.

However the advantage of 802.11a is that it operates at a radio frequency that's less clogged by competing signals from other wireless users, cordless phones and microwave ovens. Its maximum bandwidth is higher as well comparing to 802.11b. 802.11a is usually found on business networks whereas 802.11b better suits the home network.

802.11g

Due to 802.11b is not compatible with 802.11a and there are needs for higher bandwidth, 802.11g was ratified in June 2003 to provide high data rate and maintain backward compatibility with 802.11b products.

802.11g supports bandwidth up to 55Mbps in the 2.4GHz band. 802.11g is compatible with 802.11b products because they both use the same radio frequency (2.4GHz) to transmit data over the airwaves, it means 802.11g wireless router will be able to talk to 80.11b wireless adapter. 802.11g also provides better security features, such as WiFi Protected Access (WAP) and WPA2 authentication with pre-shared key or RADIUS server.

Again, 802.11g also suffers from the same interference as 802.11b in the already crowded 2.4 GHz range, but can be avoided by placing 802.11g device a reasonable distance from other devices

You might heard about 802.11n standard, it’s a new standard that currently developed by IEEE and can provide bandwidth up to 540Mbps, 10 times faster than 802.11a/g. Although several vendors already started to release 802.11n products, but the cost is expensive and yet to be evaluated.

If you want to set up wireless network, I would recommend you to use 802.11g standard based on slightly higher cost but with higher bandwidth and better security features comparing to 802.11b.

What is Wireless Network

Wireless network is a network set up by using radio signal frequency to communicate among computers and other network devices. Sometimes it’s also referred to as WiFi network or WLAN. This

network is getting popular nowadays due to easy to setup feature and no cabling involved. You can connect computers anywhere in your home without the need for wires.

Here is simple explanation of how it works, let say you have 2 computers each equipped with wireless adapter and you have set up wireless router. When the computer send out the data, the binary data will be encoded to radio frequency and transmitted via wireless router. The receiving computer will then decode the signal back to binary data.

It doesn’t matter you are using broadband cable/DSL modem to access internet, both ways will work with wireless network. If you heard about wireless hotspot, that means that location is equipped with wireless devices for you and others to join the network. You can check out the nearest hotspots from your home here.

The two main components are wireless router or access point and wireless clients.

If you have not set up any wired network, then just get a wireless router and attach it to cable/DSL modem. You then set up wireless client by adding wireless card to each computer and form a simple wireless network. You can also cable connect computer directly to router if there are switch ports available.

Wireless Router Network

If you already have wired Ethernet network at home, you can attach a wireless access point to existing network router and have wireless access at home.

Wireless  AP Network

Wireless router or access points should be installed in a way that maximizes coverage as well as throughput. The coverage provided is generally referred to as the coverage cell. Large areas usually require more than one access point in order to have adequate coverage. You can also add access point to your existing wireless router to improve coverage.

Wireless Operating Mode

The IEEE 802.11 standards specify two operating modes: infrastructure mode and ad hoc mode.

Infrastructure mode is used to connect computers with wireless network adapters, also known as wireless clients, to an existing wired network with the help from wireless router or access point. The 2 examples which I specified above operate in this mode.

Ad hoc mode is used to connect wireless clients directly together, without the need for a wireless router or access point. An ad hoc network consists of up to 9 wireless clients, which send their data directly to each other. Click here to learn more on this ad hoc mode.

Wireless Network Security

Here are some tips on wireless network security. Read and implement them in your wireless network. Wireless network security is important, don't overlook it!

Change Factory Default Username and Password on Wireless Router

This is the first task you must do to better secure your wireless router. Factory default username and password must be changed when you start to configure the router. Those username and password are known publicly, so don’t leave it as default setting.

If you don’t believe, download some router manuals from vendor website, you would be able to find all these information…

Here are some examples of default username and password of wireless router from different vendors:

Linksys default username:(leave it blank) password:admin
Dlink default username:admin password:(leave it blank)
Netgear default username:admin password:password

Note: A good password is composed of number, alphabet (upper case/lower case) and symbol.

Change Factory Default SSID on Wireless Router

Please also change factory default SSID of wireless router. Same as default username and password, it would be easy for people to know the default SSID even though you have disabled SSID broadcasting. The only information they need is your wilreless router model.

So, always assign the SSID that not easily to guess, and don’t use your name, pet’s name or home address as SSID. Quick suggestion, you can try to use the name that is unique and only known among family members but not others.

Again, here are some examples of default SSID of wireless router from different vendors:

Linksys factory default SSID:linksys
Dlink factory default SSID:default
Netgear factory default SSID:NETGEAR

Disable SSID Broadcast

By default, most wireless router will broadcast the SSID to all wireless devices. That means your neighbour can detect the SSID you use in your network and gain access to your network with a computer equipped with wireless network adapter.

If you really want to broadcast the SSID, please make sure you enable WPA2 encryption and MAC address filtering to limit the access to your network.

Enable WPA2 Encryption

Don’t forget to enable WPA2 encryption to encrypt the network traffic and improve wireless network security. For most of the latest routers, WPA2 encryption is supported. So far, WAP2 is the best and strongest encryption among WEP, WPA and WPA2 encryptions.

If you are using old wireless router that only support WPA/WEP encryption, try to upgrade the router firmware to have WPA2 support. Just go to the vendor website and check what’s the latest firmware for your router. This is because WPA/WEP encryption is not secured and can be cracked after gathering enough network traffic. Check out here on how to crack the WPA/WEP encryption key.

Note: If so bad that no WPA2 support even after upgrading to latest firmware, then use WPA or WEP encryption. It’s better then no encryption at all. :o)

Enable MAC Address Filtering

You can enable MAC address filtering to allow the computers with specific MAC address to join the wireless network only. This is one of the methods to enhance wireless network security from unauthorized access.

In order to make it work, you need to define a list of MAC address that are allowed to join the network. If you are not too sure how to check MAC address, kindly click here to learn how to check MAC address of network card.

Disable Wireless Router Administration by Wireless Client

It’s advisable to disable wireless router administration by wireless clients. This means you can only access and change the router configuration after wire connecting your computer to router.

Note: You should also use https (with encryption) method to access your router administration webpage instead of http (without encryption).

Disable Remote Wireless Router Administration

Don’t enable remote wireless router administration from Internet unless you really need it. Other Internet users would be able to find and hack your router through bruteforce password cracking or security exploits.

Note: Have a check on this feature although it’s usually disabled by default.

That's all for wireless network security tips.. I would recommend you to check how to secure Ethernet wired network after this wireless network security reading. You would find additional information on securing wireless network.

Wireless Adapter Configuration

In this article I will show you how to configure wireless adapter for joining wireless network.


I’ll show by using D-Link USB DWL-G122 wireless adapter icon together with Windows XP built-in wireless configuration tool. You can use the configuration software supplied with the wireless network adapter if you wish.

Since I’ve quite a number wireless clients at home, windows built-in wireless configuration tool is used to standardize the wireless client management.

Windows XP/2000 built-in Wireless Configuration Tool

However this XP built-in configuration tool is not installed by default in Windows XP/2000, some additional patches might need to be installed depending on system patch level.

For Windows XP, install either Windows XP Service Pack 2 and WPA2/WPS IE Update or Windows XP Service Pack 1 and Wireless Update Rollup Package for Windows XP.

For Windows 2000, install Service Pack 4 or later for adding this built-in wireless feature.

Please note that WPA2/WPS IE Update is not available if the wireless card driver does not support these additional features.

There is currently no built-in wireless LAN support in Windows Me, Windows 98, or Windows NT 4.0. Wireless network adapter manufacturers must supply all wireless and authentication functionality for these versions of Windows.

Installing Wireless Adapter Driver and Configuring TCP/IP

Please check here to install wireless adapter driver and configure TCP/IP. This process is the same as you configure Ethernet network adapter.

Configuring Wireless Adapter Properties

Before you start to configure wireless network adapter properties, you need to make sure wireless zero configuration service is running and it’s supported by wireless adapter.

1) Go to Start and click on Control Panel.

2) Control Panel window will appear. Double click on Network Connections.

3) Network Connections window will appear. Right click correct Wireless Network Connection by identifying correct wireless adapter and click Properties.

4) Wireless Network Connection Properties will appear. Click Wireless Networks tab.

5) Tick Use Windows to configure my wireless network settings. This will change the wireless adapter management from wireless adapter configuration software to Windows XP built-in wireless configuration tool. Click Add to create preferred wireless network.

Note: Adding preferred networks will detect and join the added wireless network automatically if available when you restart your computer next time.

Wireless Connection Properties

6) Wireless Network Properties window will appear. Here is the place you key in your wireless network information, it must match with the settings you set on wireless router. If not, you will fail to join the network.

Please key in SSID of your wireless network. SSID is the network name of this wireless network and must be identical for all devices in the network.

Choose network authentication if it’s enabled in your wireless router. Here are supported network authentications:

Open – If you want to use this option, I recommend you to use it with wired equivalent privacy (WEP) encryption key that shared among computers on wireless network. All network traffic is encrypted. If you do not enabled WEP with Open option, then everybody can join this wireless network without authentication and it’s not recommended.

Shared – You can use this option with WEP encryption key, however according to Microsoft, the traffic is not encrypted. Too bad and not recommended to use.

WPA – WiFi Protected Access (WPA) authentication with RADIUS server. This authentication is usually found in business networks.

WPA-PSK – WPA authentication with pre-shared key. AES or TKIP encryption is provided. Mostly used by home wireless users.

WPA2 – WPA2 authentication with RADIUS server. This authentication is usually found in business networks.

WPA2-PSK – WPA2 authentication with pre-shared key. AES or TKIP encryption is provided. Mostly used by home wireless users.

For my setup, I will key in home-network as SSID, enable WPA2-PSK authentication with AES encryption and key in network key as last.

Note: If the network that you are adding provides a network key automatically, make sure that The key is provided for me automatically check box is ticked. This option is only available if you choose Open or Shared authentication.

Wireless Network Properties

After keying wireless network information, click Connection tab, and tick Connect when this network is in range. The computer should be able to connect to wireless network when it’s in range.

Network in Range

You can create several networks and arrange the preferred network as according to your wish.

Preferred Network

Manual Connecting to An Available Wireless Network

If you don’t wish to set preferred wireless network, click here to learn manual connecting to an available wireless network.

Assign Computer Name and Workgroup

Each computer in your network must have a name and assigned to a workgroup, so that it’s easy for you to identify the computers in your network. Follow step-by-step instructions here to set computer name and workgroup.

After that, you can proceed to do file sharing or printer sharing in the network.

At this stage, you should be able to join the wireless network… Have fun...