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.
Did you know?Explore Trending and Topic pages for more stories like this.

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

tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the e

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

getting most records by count
Code: [Select]<?php

$connect = mysql_connect("localhost","dam

Include with Parameters
In a particular page I would like to include a file that requires $_GET parameters.

when I go

DYNPRO_FIELD_CONVERSION
Hi gurus,

I got a dump when I run one of my program. the dump is described below:

MS are the best!!!
Visit http://www.microsoft.com/australia/windows/default.aspx?h=watch-a-demo and click the massive '

PHP code for a proxy
I was wondering which function I could use to create an online proxy tool. I was thinking cURL would

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

Displaying a clickable playername
I am going wrong somewhere with the mysql_query, can someone please put me straight?

$playern

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