Latest News: (loading..)
Jack_mcs

SiteMonitor

2,173 posts in this topic

It's a server setting. On shared servers, you don't have any control over it and it is usually 30 seconds. On dedicated servers, you can change it to what you want via the php.ini file.

 

Jack

Share this post


Link to post
Share on other sites

isn't it possible to spoof the edit time for any given file?

i would assume the majority of hackers would take this step to prevent you from knowing what files they touched.

 

would this contribution still work, in that case?

Share this post


Link to post
Share on other sites

You can change the timestamp of a file but the size would still have to be exact and that would be difficult to do since it involves more than just the file size.

 

Jack

Share this post


Link to post
Share on other sites

Anybody else getting errors in their cron output? Ive got the cron job setup and running ok but its outputting errors(the cron sends an email out after it runs).

 

This normal?

Share this post


Link to post
Share on other sites

heres the cron output is interested:

 

Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />

<br />

<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php:67) in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />

<br />

<b>Warning</b>: main(includes/languages/english/) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />

<br />

<b>Warning</b>: main() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home2/mydomain/public_html/catalog/admin') in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />

Share this post


Link to post
Share on other sites

Hi all,

I downloaded and installed Sitemonitor contribution and it works great, no pb at all :D

All the features work perfectly...

 

Many thanks to the author !!!

 

Jean-Pierre.

Share this post


Link to post
Share on other sites
heres the cron output is interested:
Does the sitemonitor.php script work when ran manually?

 

Jack

Share this post


Link to post
Share on other sites
Does the sitemonitor.php script work when ran manually?

 

Jack

 

Yes it works fine when run manually, I tried to modify one file and the email alert work too !!!

Thanks a lot.

Jean-Pierre

bonus34 likes this

Share this post


Link to post
Share on other sites
Does the sitemonitor.php script work when ran manually?

 

Jack

 

 

Yes. It works fine when run with the cron job as well, its just that the cron generates those errors. I still get the output from the sitemonitor if anything has changed.

 

I was just curious if anybody elses cron output was like that(if anybody even checks it).

Share this post


Link to post
Share on other sites
I have to block out my admin directory or the script times out. Is there a way to specify not to scan certain folders within the admin directory, such as images, so that we can scan the other php files in admin and not timeout?

 

Would something like this work? :

$excludeList = array("cgi-bin","admin/images","downloads","images","pub","tmp","temp");

 

 

Im back to this point. I was mistaken, the "admin/images" part didnt work. The admin images folder was still in the reference file.

 

Any ideas how how to block just this folder or any subfolder?

Share this post


Link to post
Share on other sites

Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />
<br />
<b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php:67) in <b>/home2/mydomain/public_html/catalog/admin/includes/functions/sessions.php</b> on line <b>67</b><br />
<br />
<b>Warning</b>: main(includes/languages/english/) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />
<br />
<b>Warning</b>: main() [<a href='function.include'>function.include</a>]: Failed opening 'includes/languages/english/' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/home2/mydomain/public_html/catalog/admin') in <b>/home2/mydomain/public_html/catalog/admin/includes/application_top.php</b> on line <b>133</b><br />

I also facing with that problem

Share this post


Link to post
Share on other sites

Hi Jack,

 

Thanks agian for this supper tool. Their is only one issue that I see. I think I just have a configure that I didnt do but not sure what.

 

The script works great when you run it manually, but it finds nothing when it runs with a cron job.

 

Any ideas?

 

What does it mean when the times are mismatched?

 

Thanks,

Eric

Edited by matrix2223

Share this post


Link to post
Share on other sites

Are you getting an error message from cron?

 

When a file is written to the server, the date and time are recorded for when that happened. So if the times don't match, it means the file has been rewritten.

 

Jack

Share this post


Link to post
Share on other sites

Great script, everything is working but....

 

If I delete a file and change a permission - only the deleted file is shown as being changed.

 

Anyway we can show both changes?

Edited by pyramids

Share this post


Link to post
Share on other sites

If a file is deleted, the rest of the checking is skipped. The reason for this is because in order to compare the reference file with the new list when a file is deleted, multiple compares would have to be performed between the two lists. That would take too much time for most servers and the script would time out. There is a way to code around it but I didn't think it was worth the time when I was writing it since, I think, most sites don't delete files as a general rule. But it can be added to the next version. For now, if a file is intentionally deleted, it is best to also delete the reference file.

 

Jack

Share this post


Link to post
Share on other sites

Hi Jack,

 

Im not getting any errors from the cron job. When it sends me the email it says everything is fine. Even though I have been working on it and adding a bunch of new files. Howerver when I run it automatically. It tells me all the necessarry stuff. No biggie to me I was just wondering if it was something that I was supposed to set with it the sitemonitor.php

 

Thanks,

 

Eric

Share this post


Link to post
Share on other sites

The only difference between running it from cron and manually, is that the path may be different. Try deleting the reference file and let cron create it when it runs. That might fix it.

 

Jack

Share this post


Link to post
Share on other sites

Jack

I modified the script to do the following:

 

1: Keep a detailed log

2: Update the reference file every time there are changes.

3: Added a timer

4: Will now check all file changes including deleted files

5: List sub directories to exclude

6: Removed the call to "require('includes/application_top.php')" and updated the mail function

7: Updated message and email reporting

 

Besides being a script to keep an eye out for hackers....especially any 777 folders - it now is a

great way to journal any modifications automatically.

 

If you are interested I will post the script

Share this post


Link to post
Share on other sites
Update the reference file every time there are changes.
Doesn't this defeat the purpose? If an email is missed or not delivered for some reason, one would never know a change has been made.

 

Jack

Share this post


Link to post
Share on other sites

I updated the script to be more of a journal to keep a running list of all changes. This way a year from now I won't be referencing files I may have removed or changed due to a modification. The script updates a log besides the email so a missing email shouldn't be a problem.

Share this post


Link to post
Share on other sites
I updated the script to be more of a journal to keep a running list of all changes. This way a year from now I won't be referencing files I may have removed or changed due to a modification. The script updates a log besides the email so a missing email shouldn't be a problem.

 

Jack,

After thinking about it you have a good point...In regard to the ref file and when it is written:

 

I added the ability for the user to choose between a journal that writes a new ref file every time there are changes or the original way of writing the file one time only that can only be overwritten when the user deletes the ref file.

 

Have a nice day!

Share this post


Link to post
Share on other sites
5: List sub directories to exclude

6: Removed the call to "require('includes/application_top.php')" and updated the mail function

 

Im interested in those two changes. Can we just remove the 'require('includes/application_top.php')' part without anything else being effected? Some of my cron job errors refer to application_top.php.

Edited by Sid04

Share this post


Link to post
Share on other sites
Im interested in those two changes. Can we just remove the 'require('includes/application_top.php')' part without anything else being effected? Some of my cron job errors refer to application_top.php.

 

It is more involved than just a few simple changes.

 

PM me with your email address and I will email you the updated script.

Share this post


Link to post
Share on other sites
Im interested in those two changes. Can we just remove the 'require('includes/application_top.php')' part without anything else being effected? Some of my cron job errors refer to application_top.php.

If your cron job is failing on that, it is because it is not setup correctly. You probably have to add a command to cd into the admin directory, something like

cd /home/user/public_html/admin/;

 

Jack

Share this post


Link to post
Share on other sites

Hi,

 

Is it possible to get this great contribution to check changes in directory permissions also?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now