Jump to content

SPAM being sent


CanMan2004

Recommended Posts

Hi all

A whiile ago I setup a website which has a registeration form on it, it has been fine for a while, but recently, there has been 2 times when someone is managing to hyjack the form and sending SPAM out through the form. After the first time, we added a image check, which made the user have to enter a code embeded in the image before they could continue, but this doesnt seem to have worked.

What can I do to prevent this?

Thanks

Mark
Link to comment
Share on other sites

Add a function to check if the email being submitted is a hijacking email, you cna use these functions:

/**
* Check single-line inputs:
* Returns false if text contains newline character
*/
function has_no_newlines($text)
{
  return preg_match("/(%0A|%0D|\\n+|\\r+)/i", $text) == 0;
}

/**
* Check multi-line inputs:
* Returns false if text contains newline followed by
* email-header specific string
*/
function has_no_emailheaders($text)
{
  return preg_match("/(%0A|%0D|\\n+|\\r+)(content-type:|to:|cc:|bcc:)/i", $text) == 0;
}

Then check each of the fields that should only be single lines with the first function, and check any multiline fields with the second function to make sure it contains no email headers.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.