Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
php e-mail
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
bokke  
View profile  
 More options Nov 1 2005, 10:29 pm
Newsgroups: comp.lang.php
From: "bokke" <micr...@gmail.com>
Date: 1 Nov 2005 19:29:24 -0800
Local: Tues, Nov 1 2005 10:29 pm
Subject: php e-mail
I have a simple form asking for name, e-mail and comment on page one.
Page two sends the form via e-mail to me and thanks the person for
filling in the form.
But I've started getting this in my inbox?  I think I'm being used here
- any ideas."Their e-mail address is:" is hard coded

Their e-mail address is: an
Content-Type: text/plain; charset=\"us-ascii\"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: take half
bcc: onemoreaddr...@hotpop.com

usually I would get,
Their e-mail address is: soan...@soanso.com

here is the e-mail code:

      <?
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$comment=$_POST['comment'];
$to="m...@ssoandso.com";

$message="First Name:$fname\n\nLast Name:$lname
\n\nPhone:$phone\n\nTheir e-mail address is: $email\n\n
comment::\n\n$comment";
if(mail($to,"E-mail from MySite",$message,"From:$email\n")){
echo "Thank you $fname.  Your Information has been inserted into my
contact database and forwarded to my E-Mail address.  I'll get back to
you shortly.";

}else{

echo"There was a problem sending the message.";
}

?>

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve  
View profile  
 More options Nov 2 2005, 10:20 am
Newsgroups: comp.lang.php
From: "Steve" <googles...@nastysoft.com>
Date: 2 Nov 2005 07:20:43 -0800
Local: Wed, Nov 2 2005 10:20 am
Subject: Re: php e-mail

> But I've started getting this in my inbox?  I think I'm being used here
> - any ideas."Their e-mail address is:" is hard coded
> here is the e-mail code:
...
> $email=$_POST['email'];
...
> if(mail($to,"E-mail from MySite",$message,"From:$email\n")){

Take it down, it is being abused - or is about to be abused - by
spammers.

The last argument to mail() is a list of extra headers and because of
the way your script is structured a custom form or script can submit
extra Bcc: email addresses tagged on to the 'email' form field.

At the very least get rid of any newlines inserted in the 'email'
field:

   $email = preg_replace( '/[\r\n]/', '', $email );

---
Steve


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
feed_sheep  
View profile  
 More options Nov 2 2005, 10:31 am
Newsgroups: comp.lang.php
From: "feed_sheep" <feed_sh...@sbcglobal.net>
Date: Wed, 02 Nov 2005 15:31:04 GMT
Local: Wed, Nov 2 2005 10:31 am
Subject: Re: php e-mail

>> $email=$_POST['email'];
> ...
>> if(mail($to,"E-mail from MySite",$message,"From:$email\n")){

> Take it down, it is being abused - or is about to be abused - by
> spammers.

> The last argument to mail() is a list of extra headers and because of
> the way your script is structured a custom form or script can submit
> extra Bcc: email addresses tagged on to the 'email' form field.

Can you expand on how this works and how to prevent spammers from using
this?  I'm not sure I understand.  Thanks!

David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
juglesh  
View profile  
 More options Nov 2 2005, 12:52 pm
Newsgroups: comp.lang.php
From: "juglesh" <jugleshj...@hotmail.com>
Date: 2 Nov 2005 09:52:54 -0800
Local: Wed, Nov 2 2005 12:52 pm
Subject: Re: php e-mail

feed_sheep wrote:
> >> $email=$_POST['email'];
> > ...
> >> if(mail($to,"E-mail from MySite",$message,"From:$email\n")){

> > Take it down, it is being abused - or is about to be abused - by
> > spammers.

> > The last argument to mail() is a list of extra headers and because of
> > the way your script is structured a custom form or script can submit
> > extra Bcc: email addresses tagged on to the 'email' form field.

> Can you expand on how this works and how to prevent spammers from using
> this?  I'm not sure I understand.  Thanks!

do this first on the page:

$find =
array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i","/MIME\-Version\: /i");
$_POST = preg_replace($find,'BAD INPUT, NAUGHTY HACKER',$_POST);

http://www.anders.com/cms/75/Crack.Attempt/Spam.Relay
http://securephp.damonkohler.com/index.php/Email_Injection

--
juglesh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bokke  
View profile  
 More options Nov 15 2005, 12:18 am
Newsgroups: comp.lang.php
From: "bokke" <micr...@gmail.com>
Date: 14 Nov 2005 21:18:36 -0800
Local: Tues, Nov 15 2005 12:18 am
Subject: Re: php e-mail
So I tried this ..

      <?
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$phone=$_POST['phone'];
$email=$_POST['email'];
$email = preg_replace( '/[\r\n]/', '', $email );
$comment=$_POST['comment'];
$to="mich...@xxx.com";

$message="First Name:$fname\n\nLast Name:$lname
\n\nPhone:$phone\n\nTheir e-mail address is: $email\n\n
comment::\n\n$comment";
if(mail($to,"E-mail from MySite",$message,"From:$email\n")){
echo "Thank you $fname.  Your Information has been inserted into my
contact database and forwarded to my E-Mail address.  I'll get back to
you shortly.";

}else{

echo"There was a problem sending the message.";
}

?>

and today got this:

First Name:nachrally8...@xxx.com

Last Name:nachrally8...@xxx.com

Phone:nachrally8...@xxx.com

Their e-mail address is: nachrally8...@xxx.com

 comment::

for
Content-Type: text/plain; charset=\"us-ascii\"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: could not so easily have torn himself away. need hardly
bcc: onemoreaddr...@hotpop.com

fad1169020f931de3b2f524b3f0d3c9a
.

So I took it down again .. please help.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve  
View profile  
 More options Nov 15 2005, 4:15 am
Newsgroups: comp.lang.php
From: "Steve" <googles...@nastysoft.com>
Date: 15 Nov 2005 01:15:19 -0800
Local: Tues, Nov 15 2005 4:15 am
Subject: Re: php e-mail

The spammer doesn't know that your form is no longer abusable and
his/her script is still running somewhere - but it is now doing no harm
apart from being annoying.

The body of your email shows the headers the spammer is attempting to
add to the email, but is failing to do so.

---
Steve


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bokke  
View profile  
 More options Nov 21 2005, 12:23 pm
Newsgroups: comp.lang.php
From: "bokke" <micr...@gmail.com>
Date: 21 Nov 2005 09:23:59 -0800
Local: Mon, Nov 21 2005 12:23 pm
Subject: Re: php e-mail
Thanks Steve

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Feuergold  
View profile  
 More options Dec 13 2005, 3:28 pm
Newsgroups: comp.lang.php
From: "Feuergold" <googlegr...@feuergold.de>
Date: 13 Dec 2005 12:28:19 -0800
Local: Tues, Dec 13 2005 3:28 pm
Subject: Re: php e-mail
First I take the Script that juglesh has postet (sorry about my bad
english please), but in the last few weeks every day I delete lot of
posts in my guestbook. That for I look for a alternativ to the replace,
and I found this:

if (preg_match( '/bcc\:|Content\-Type\:|cc\:|to\:|MIME\-Version\:/i' ,
$email)) {
die ("BAD INPUT, NAUGHTY HACKER");}
else{
....

}

Now the time to delete every day the posts is gone, and in my
mailformular I make the same, and I hope it is enough to stop the mails
the hacker have send through my formular.

Perhaps my little function is good enough to help other people with the
same problems.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »