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

Displaying image pathname instead of image
Hello

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

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

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

1,000 select boxes with 100 options?!
I have 1 drop down select box with 1,000 options.


In some case, there will be 100+ of the

Embed Video Problem
Hey, thanks for looking!

File to be embedded:

Code: <playlist version="1&q

Comparing MySql data and arrays.
I have a mysql table set up like this:
idsubjectbodyuseriddatetimetags1blog subjectblog body111|2

problem with refreshing
in my site, i have an index page, it has a main div. this main div's content is changing according t

adding up might be solved tell us cheers.
i think i finally solved this anybody.

last time i was getting the wrong results.

Code

records between 2 dates
Hello all,

I have a date tracked table which contains effective_start_date and effective

How to use php and sql to check if values match the ones in a table (for logins)
How would I code it that the script takes two variables that are passed to it (UserID and PIN), and

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