DirectoryIterator and Hacked Website


Posted on 16th Feb 2014 07:03 pm by admin

Hi Everyone.

My problem:
Some one has been sneaking in to my website hidden Iframes. I've changed passwords & reset permissions to read, but then the permissions get changed to include write and they inject the IFRAMES. I go through this process daily and am tired of it.

The challenge:
To write a script that scans the files for permission changes and email me the results.

The solution:
This is what I have so far:

$it = new RecursiveDirectoryIterator("/home/content/e/n/v/<website name>/html/");
foreach(new RecursiveIteratorIterator($it) as $file) {
echo $file . "n"; echo date ("F d Y H:i:s.", filemtime($file)); echo substr(sprintf('%o', fileperms($file)), -4);
echo "<br/>";
}


I know the ultimate challenge is to secure the website, but until I can figure out how I need a mechanism to
help me cope.

Thanks

No comments posted yet

Your Answer:

Login to answer
155 Like 19 Dislike
Previous forums Next forums
Other forums

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Extract text from string
Hi folks,

I have a string that looks like this:

aaaaaaaaaa:
bbbbbbbbbb (ccccccccc)

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

Scheduler problems related to execution of a single BLT by many schedules
Hello all,

We are running several MII instances in a distibuted architecture using a sing

Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
My application wants to send/recv data to 2 different UDP ports on a remote computer, us

Preg_match question
I want to use preg_match to make sure a string is always 6 characters long and only contains 0-9 and

PayPal Redirect Issue
When I have my paypal button set so that is redirects to http://empiremarketing.ca/order.php,it work

unexpected T_VARIABLE error
Hey all! I'm getting an unexpected T_VARIABLE with the following function:

function getHighes

Insert Failing.
Hey,
I am making a Sign up page for a website, but the insert query into the Database does not se

form variables from database help.
Hi all,

I would like to have a form that gives you options based on the results of an mysql q

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash