Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 29-11-2005, 07:56 PM   #1 (permalink)
Version 2.0
 
Deep's Avatar
 
Join Date: Jan 2004
Location: Mumbai
Posts: 977
Default Saving yourself from contact form hijacking


These days contact from hijacking is on run…spammers are using weak contact forms to send spam emails and this makes a server black listed in many sites. And these spammers are targeting most of the emails in AOL and our server get black listed with them.

I came across this when one of my client’s contact form was hijacked and my server IP got black listed. I figured out the problem with the help of Outblaze guys and fixed the issues with the form but that was not the fixed solution to this.

Now what is contact form hijacking?

The spammers pass invalid characters and headers through the form fields using bots.
For example, they pass BCC header with MANY emails in any of the form fields and send out emails. They even modify the values passed in subject variable if its not fixed. In my case they were sending diet pills mails using that form.

This works if we do not check for invalid characters in the form validation.

Example of it would be following code:

Code:
"sender@anonymous.www%0ACc:recipient@someothersite.xxx%0ABcc:somebloke@grrrr.xxx,someotherbloke@oooops.xxx"

This code ads CC and BCC field in the headers and the email will go to these people as well.

How to stop it from our side and make the forms secure?

If we check for CC and BCC or say recurrence of @ character on action page then it can be stopped. And we can log that IP and other details and take action. (Report spammer’s IP or something)

In PHP you can write a function which will do all necessary cleanup, code on this page would help you with it.

Many people say that it can be stopped by using Captchas (image verification scripts) but these days there are scripts which can decode Captchas too. No kidding, here is the link to working example of captcha decoder script.

How to stop it from server side?

Since I run web hosting company so it is difficult to check each and every form used by client and sit and clean it.

I then enabled few things on server side, i.e. I allowed only 100 emails to be sent from one domain in an hour. 2nd thing was I installed mod_security module to take care of these spam mails.

If you are linux server admin then you should know what mod_security is and what it does. I must say it is a very powerful module; you can set rules in it and delete spam mails being sent from your server. It also allows many other rules like disabling few PHPBB and other exploits. Disabling XSS and SQL injections etc….

I just had to add 2 lines to stop spam mails. The code will check for BCC headers and allow only 20 addresses in BCC per mail.

I am reading lot of stuff on mod_security and learning the stuff so I can try my level best to save the server from these kind of attacks.

Good reads for contact form hijacking would be:

For end users:

- Info on email injection
- Secured PHP contact form
- Project Killbot

For server admins:

- Info on form hijacking
- mod_security home page
- mod_security rules

Source: Written by me
Deep is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 29-11-2005, 08:04 PM   #2 (permalink)
SNIST Screamer !!
 
vijay_7287's Avatar
 
Join Date: Aug 2005
Location: Hyderabad
Posts: 1,163
Default

grt info dude
found it really useful

thank you !!!!
__________________
http://snistscreamers.blogspot.com/
http://insidevoidmain.blogspot.com/

SNIST-Blog: the Voice of SNIST... http://www.snistblog.com/
vijay_7287 is offline  
Old 30-11-2005, 10:00 AM   #3 (permalink)
Distinguished Member
 
anandk's Avatar
 
Join Date: Mar 2005
Location: Pune
Posts: 3,783
Default

useful pc of info. thnx.
__________________
> www.TheWindowsClub.com <
= www.WinVistaClub.com =
Microsoft® MVP
anandk is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by chris
- by icebags
- by Tenida

Advertisement




All times are GMT +5.5. The time now is 01:15 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2