LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-12-2014, 01:57 PM   #1
milanlukic
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Rep: Reputation: Disabled
Postfix securing binding to specific files or scripts


Hi guys

We've recently had a site exploited and the server used to send out a ton of spam. Code had been injected into a bunch of php files.

I am now rebuilding from clean however we have sites installed that need to send out email on occasion.

Is it possible to set postfix to only send email when it has been created by a specific script or file on the server, for example, the file located in

/home/www/websiteexample.com/htdocs/path/to/Sendmail.php

or should I be looking at an alternative method of sending out email, and if so, what would you suggest.

Thanks in advance
 
Old 02-12-2014, 02:48 PM   #2
gotfw
Member
 
Registered: Jan 2007
Posts: 416

Rep: Reputation: 70
Quote:
Originally Posted by milanlukic View Post
Hi guys

We've recently had a site exploited and the server used to send out a ton of spam. Code had been injected into a bunch of php files.

I am now rebuilding from clean however we have sites installed that need to send out email on occasion.

Is it possible to set postfix to only send email when it has been created by a specific script or file on the server, for example, the file located in

/home/www/websiteexample.com/htdocs/path/to/Sendmail.php

or should I be looking at an alternative method of sending out email, and if so, what would you suggest.

Thanks in advance
If code has been injected into a bunch of php files (i.e. "at will"), what do you hope to accomplish by allowing only this particular file? I suppose you could configure Postfix to require authentication and then build auth into your sendmail.php script. Else maybe also config Postfix to listen on some obscure and/or high port and only allow connections from localhost. But, again, if arbitrary code is being injected into a bunches of php files, there's not much to stop them from also injecting a port scanner tool. So all you can really do is raise the bar a bit and hope the kiddies go somewhere else where it's lower.
 
Old 02-12-2014, 03:33 PM   #3
milanlukic
LQ Newbie
 
Registered: Jan 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Well from what I've seen so far with the files that have been exploited or created is that the newly created files have random looking names, ie, w40688301n.php, and injected code is mostly limited to the top level of the domain, ie index.php. While my rebuild of the server and update to the software 'should' close these holes, as both the server and the software install was somewhat outdated, I was hoping I could further secure postfix by allowing only my said scripts to generate emails. Sort of like a whitelist. The problem is that the sendmail.php file is not my own, so any changes I make to it could easily get update during future updates to the site software.
 
  


Reply

Tags
postfix, secure, spam



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
binding htpasswd username and password with specific IP addresses roopakl Linux - Server 2 09-13-2011 11:47 PM
Binding USB drive to specific folder d3adpoetic Linux - Newbie 12 04-02-2010 06:35 AM
how can i get my scripts to read/write text from/to specific parts of files? Siljrath Linux - General 12 02-06-2010 02:58 PM
binding to one specific IP polemon Linux - Networking 3 04-13-2008 04:04 PM
Q: Binding applications to a specific cpu Lazy Linux - Software 1 03-02-2006 07:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration