Jump to content

Recommended Posts

Posted (edited)

I realized yesterday that a contact form on our site was being exploited (header injection). I've been trying to block it, but things keep getting through.

I decided to set up a logging system — when someone uses the form, everything they submit is stored to a file using fopen, fwrite, and fclose

 

I spent all day trying to add this to our script. What I just realized is that if I call, for example, fopen("contact.log","a"); , the script crashes. EVERY TIME. I've wasted a day, and don't know what to do…

Edited by PathDæmon
Posted

Welcome to the forums PathDæmon :clapping:

 

Have you changed the permissions of the log file to 666 (world writeable)? Have you checked the error log in cPanel to see what errors you are getting?

Posted

Permissions turned out to be the main issue — my ftp client kept changing them. Thanks, Bruce.

 

Don — I wasn't the original site writer, but I believe it's homegrown. I'll keep updating its checks as the attempts get logged.

 

And thanks to everyone else for the warm welcome.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...