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

155 Like 19 Dislike
Previous php-forum Next php-forum
Other php-forum

Image upload - determine folder
I have an upload script that may be accessed from different directories. Problem is, the script is m

MySQL noob question
hi guys

I have a simple mysql table set up, along the lines of

Col 1 - Col 2 - Date_l

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

Filtering for a phrase using pregmatch
Here is my code which looks for addresses which start with ' src=" '

Code: [Select]preg_

Problem with shopcart code
Hello, I am having a bit of trouble being able to add a product to my shopcart. My mysql database i

php ajax - two drop down list with a submit button
i have created a form with 2 drop-down list and a submit button. I would like to know how to pass th

file_put_contents and createimagefromjpeg
All,
I do somethings and then I have the following code:
file_put_contents('./test/'.$filename

I got my hosting suspended XD
So I saw this challenge a day or so ago

http://www.programming-challenges.com/pg.php?page=dow

PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 200

Need help urgant
why down my code ony return one item instead of all the items selected.

$arr = array($date,$

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