SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Fizlar's Avatar
    Join Date
    Aug 2003
    Location
    Sheffield
    Posts
    179
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    email vulnerbility!

    Hi i have an email function on my website... but i have just been told

    by using the local sendmail server as a mail relay there have been vunerabilities in webmail scripts that allow
    people to relay spam through them


    how can i stop that from happening ie spamming?


    PHP Code:
     <?
    // Set Script Variables

    $email $_GET['EMAIL']; 
    $id $_GET['id']; 
    $user "***";
    $pass "**** ";
    $db "*****";
    $link mysql_connect"localhost"$user$pass );
    if (! 
    $link)
        die (
    "could not connect to MySQL");
    mysql_select_db ($db)
        or die (
    "could not connect to $db: ".mysql_error() );

    $result mysql_query ("SELECT * FROM COURSES
                             WHERE COURSE_ID ='
    $id'"); 
                             
        
    while(
    $row mysql_fetch_array($result)) 
    {
        
    $coursename$row['COURSE_NAME'];
        
    $startdate$row['START_DATE'];
        
    $courselength=$row['DURATION'];
        
    $time=$row['START_FINISH_TIME'];
        
    $notes=$row['NOTES'];
        
    $organisedby=$row['ORGANISED_BY'];
    }
    $mailcontent 
    Dear Prospective Student,
    Thank you for browsing our website. Here is your requested details of the Course  
    $coursename If you have any more question please feel free to browse our website or call us on 0114 272 3167. 

    COURSE NAME:        
    $coursename

    START FINSIH TIME:        
    $time

    START DATE:                
    $startdate

    COURSE DURATION:           
    $courselength

    ORGANISED BY:             
    $organisedby

    ADDITIONAL NOTES:        

    $notes

    Kind Regards,

    Burngreave.net"
    ;
    if (
    mail($email$coursename." Course Details"$mailcontent))
    {
      echo 
    " Your Mail Has Been Sent";
        
    ?>
    </div>
    <p><a href="#" onClick="setInterval('scd()',1000)"><font size="+3">Close Window</font></a> 
    </p>
    <?
    } else {
        echo 
    "Failure Sending Email";
        
    ?> 
    <p><a href="#" onClick="setInterval('scd()',1000)"><font size="+3">Close Window</font></a> 
    </p>
    <?
    }
     
    ?>

  2. #2
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The vulnerability (which, I'm guessing your web hosting company has raised) lies in the fact that the TO: field of this script is completely user-definable.

    Meaning that whomever posted this form can simply pop in any $email into the Query String, and spam whomever he likes (with your message content, of course). Add to the fact that since this is passed via query string, it's even easier to loop than having the variables POSTed.

    The solution is, however, a bit more difficult.
    Ask yourself -- why can anyone visiting the site enter a simple e-mail address to receive information. Perhaps by developing a client-login procedure (where by the user signs up with an e-mail, confirms it's validity, then receives the information), you can prevent SPAMming.

    Another option, if you don't want to keep it complicated, is to track that user's IP address, and prevent him from sending any more letters for say, 12 hours (i.e. why would he want two copies of the same course?). This would put a lid on the spam considerably.
    My name is Steve, and I'm a super-villian.

  3. #3
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I believe what they are talking about is something that was recently discussed in GC, about if you don't restrict access to your mail server (as most people don't), anyone can use it to send spam from. Here is a link


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •