SPAMCOP HOME · SPAMCOP FAQ · NEWSGROUPS · FORUM FAQ · WEBMAIL · SSL WEBMAIL · SPAMCOPWIKI


 Other words, data, places -->  SpamCop Pages V  FAQs & Words V  Newsgroups V  WebMail V  News-Recent Stuff V   Poll on menu

------>------> Latest and Current Announcements <------<------

Welcome Guest ( Log In | Register )

> This is a SpamCop.net FAQ Development/Support area

Please do NOT post any requests for help in this forum. Please post all questions in the appropriate Help Forum. This forum is reserved for the development of the SpamCop FAQ (here) and is open to all who wish to contribute to building a better FAQ. Suggestions for improvements are welcome as well as pointing out areas that are unclear or you are unable to understand as we can use those comments to improve the current FAQ (here).

 
Reply to this topicStart new topic
> Web Contact Form Hacks Used to Send Spam, Reposted from a NANAE thread
Wazoo
post Aug 27 2006, 12:13 PM
Post #1


What Life?
Group Icon

Group: Forum Admin
Posts: 12892
Joined: 22-January 04
From: Iowa
Member No.: 18



stolen from NANAE
QUOTE
Date: 27 Aug 2006 07:04:13 -0000
Message-ID: <M2K9V4KJ38956.1279282407[at]twistycreek.com>
From: I Hate Web Spams
Subject: And Now an Epidemic of Web Contact Form Hacks Used to Send Spam
Newsgroups: news.admin.net-abuse.email


Over the last two weeks, the occasional spam from a hacked web form has
turned into a torrent. Most spammers aren't the brightest bulbs in the box,
so they like this technique because it requires virtually no talent and can
be run from a scri_pt. I did a random unscientific sample and found about a
10-15% of forms were exploitable, despite the stellar credentials of some
of their authors and webmasters. It's that easy to overlook.

The technique is perfect for spammers. Respected businesses end up sending
thousands of spams without their knowledge. Their mail addresses aren't on
any block lists (for the time being) because the recipients seldom
complain. As a result, lists of vulnerable web input forms can be recycled
and are probably being shared among spammers. These are world wide sources,
although the U.S., Britain, Germany and Japan has had the most exploited
forms so far.

How does he do it?? The spammer injects the characters '\n' and '\r' (end
of line and carriage return) in an explotiable web form  and then adds
"bcc:" followed by a long list of spamees. (If you host a web page with a
form and you start getting "bounces" related to your web form then that is
what has happened). After the spammer is allowed to do this several times,
your hosts's mail server ends up on a set of email blocklists from which
removal is unlikely. At that point your provider either disconnects you or
puts a contract out on you or both.

The bcc: lists vary from spam victim to spam victim, but I see a lot of
yahoo, gmail and hotmail addresses on there. Were talking about several
hundred per hacked web form. If the process is automated it is very easy to
see milions of spams coming out the other end.

If you have a web page with ANY kind of user input, verify that there is a
control character filter on you web form or that the mail handler you use
does not accept the "bcc" statement. Either one will foil his attempts. 
To filter
CODE

    with php use
      "if(egregi("\r",[field]) || egregi("\n",[field])) die("No Spam From Me!")   
    with perl use regular expression matching
    with C and C++ use regexec and regcomp.

to trap these characters.

There are a hundred good references in google on how to fix your form.

The spammer dejour using this technique is hawking hoodia/hgh/herbals
linking to coded urls from snipurl.com. She has also spammed for the fake
diploma guy at U.S. 314-219-2907. The snipurls are all coded differently,
probably to identify blocks of victims. The current scam site ends up at
http://hggdadcner.com, a hanaro site supposedly registered to a "Michael
McCain" in Palatine, IL, north of Chicago. Injection is coming from a
variety of sources in (where else?) China.

Blocklists trap 95% of "conventional" spam, but can not trap any of the web
form spam. If you host customers with web forms, demand that you check the
forms before they go online. Also, someone needs to start automatically
probing the millions of web forms out there and letting the owners and
hosting sites know if their forms are vulnerable. Since probing can be
construed as "computer invasion", it sounds like a project for a government
agency or a delegate like isc.org or cert.org.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
inko9nito
post Jan 1 2007, 11:24 PM
Post #2


Newbie
*

Group: Members
Posts: 1
Joined: 1-January 07
Member No.: 7305



CODE

      if(egregi("\r",[field]) || egregi("\n",[field])) die("No Spam From Me!");


Didn't anyone try testing this code? The eregi() function is misspelled twice. Or was that done on purpose?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
jongrose
post Jan 2 2007, 05:45 AM
Post #3


Advanced Member
***

Group: Membera
Posts: 187
Joined: 23-February 04
Member No.: 480



Which web contact forms are vulnerable? Are there specific systems that are problematic, or is this occurring with many different types of setups?


--------------------
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
StevenUnderwood
post Jan 2 2007, 03:46 PM
Post #4


What Life?
Group Icon

Group: Membersph
Posts: 5172
Joined: 20-January 04
From: Whitinsville, MA USA
Member No.: 12



QUOTE(inko9nito @ Jan 1 2007, 11:24 PM) *

CODE

      if(egregi("\r",[field]) || egregi("\n",[field])) die("No Spam From Me!");


Didn't anyone try testing this code? The eregi() function is misspelled twice. Or was that done on purpose?

Is it also possible that a spell checker somewhere along the lines made this change? egregi seems to be Italian for Kind or Dear.


--------------------
Steven P. Underwood, DNRC
Whitinsville, MA
underwood+forum[at]spamcop.net

-No trees were killed in the sending of this message. However, a large number of electrons were terribly inconvenienced.-
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ivolator
post Apr 9 2007, 02:04 PM
Post #5


Newbie
*

Group: Members
Posts: 1
Joined: 9-April 07
Member No.: 7655



Why would this happen if you just escape the \r and \n? Or use just preg_replace('/\r/','',$message);. You can come up with more complex message to clean up the headers.
Also do not expose forms for not logged in users (why do that).
Log all activity.
Check for source of activity (i.e. add some GUID for user such as session id of some type).
Limit fields length, validate input .....

... only my humble opinion
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Wazoo
post Apr 9 2007, 02:58 PM
Post #6


What Life?
Group Icon

Group: Forum Admin
Posts: 12892
Joined: 22-January 04
From: Iowa
Member No.: 18



QUOTE(ivolator @ Apr 9 2007, 02:04 PM) *
Why would this happen if you just escape the \r and \n? Or use just preg_replace('/\r/','',$message);.

Depends on the code involved.
QUOTE
You can come up with more complex message to clean up the headers.
Also do not expose forms for not logged in users (why do that).
Log all activity.
Check for source of activity (i.e. add some GUID for user such as session id of some type).
Limit fields length, validate input .....

The general 'user' maintained web-site isn't also generally maintained by a programmer ....

Gee, I want a GuestBok ... Google for 'free GuestBok' ... toss out the hundreds that are "too hard to install" .. Oh kewl!! .. here's one that looks pretty easy and even better, it comes in Pink!!!!!

What are the odds that this one was 'easy to install' because it had no thoughts of security involved in the 5 lines of code that were provided (for free) ....
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

- Lo-Fi Version Time is now: 31st July 2010 - 08:58 AM