Jump to content
Jack_mcs

SiteMonitor

Recommended Posts

Jack, does Site Monitor support regex or wild cards in the list of directories not to monitor?

No, there's not anything in the code for that to work. I'm not sure how it could be a benefit though. Can you explain a situation where it could be used so I can understand the reason better?

Share this post


Link to post
Share on other sites

No, there's not anything in the code for that to work. I'm not sure how it could be a benefit though. Can you explain a situation where it could be used so I can understand the reason better?

Sure, phpThumb has a cache directory that has dynamically created sub-directories. Many, many of them.

 

If regex or wildcards do not work perhaps I could move the phpThumb cache directory outside of the catalog directory.

Edited by mdtaylorlrim

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Do you mean this?:

 

/* function microtime_float() //just used for testing{ list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec);} */

 

Take that out of the sitemonitor_functions.php?

 

Sorry Jack, do you mean this?

Share this post


Link to post
Share on other sites

Sure, phpThumb has a cache directory that has dynamically created sub-directories. Many, many of them.

 

If regex or wildcards do not work perhaps I could move the phpThumb cache directory outside of the catalog directory.

If you are wanting to exclude those directories from monitoring, just enter the main directory, phpThumb, and all of the sub-directories will be skipped. If you want to exclude only certain ones, you can enter the names, even if they don't exist, providing you know what the names will be. But other than that, I can't think of how else to limit certain ones, as the code is now.

Share this post


Link to post
Share on other sites

Yes.

 

Right that eventually got the configure page to work, but on the admin page I am getting a few errors when I press the update buttons. Here is what I am getting:

 

Delete Reference File

Execute Sitemonitor

Manually Execute Sitemonitor

 

Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in mysite.com/admin/includes/functions/sitemonitor_functions.php on line 162

 

Warning: readdir(): supplied argument is not a valid Directory resource in mysite.com/admin/includes/functions/sitemonitor_functions.php on line 164

Reference file creation failed.

 

The Manually Check for Hacked Files (of which it has found 10!) seems to be working fine.

Share this post


Link to post
Share on other sites

No, there's not anything in the code for that to work. I'm not sure how it could be a benefit though. Can you explain a situation where it could be used so I can understand the reason better?

 

 

Sure, phpThumb has a cache directory that has dynamically created sub-directories. Many, many of them.

 

If regex or wildcards do not work perhaps I could move the phpThumb cache directory outside of the catalog directory.

Actually, it will not add sub-directories to the list. When you select a sub-directory the page refreshes but the sub-directory is not added to the list. It is like it was *meant* to effectively exclude all directories in the path, but it does not.

 

I'm gonna try and add a few of the sub directories by hand and see if they are excluded. I'm sure they are, but adding the dozens of sub-directories is going to be tedious...

Edited by mdtaylorlrim

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Warning: opendir(/home/username/public_html) [function.opendir]:

Is the username of your account username? If not, please try changing the settings to match your site.

Share this post


Link to post
Share on other sites

Actually, it will not add sub-directories to the list. When you select a sub-directory the page refreshes but the sub-directory is not added to the list. It is like it was *meant* to effectively exclude all directories in the path, but it does not.

It won't let you add a sub-directory if one of its parents is already in the list, though you should get a warning about that. Otherwise, there shouldn't be an issue with adding sub-directories.

Share this post


Link to post
Share on other sites

It won't let you add a sub-directory if one of its parents is already in the list, though you should get a warning about that. Otherwise, there shouldn't be an issue with adding sub-directories.

Then I do not understand... why not?

 

If having a parent directory does not also exclude sub-directories why should it not allow you to add it to the list? I need to sub-directories excluded as well, and it does not. Or else I have something set wrong. When I asked above about wild cards and regex it was because the parent directory is included in the list, but the sub-directories are not excluded from monitoring, and I need them to be.

 

Are we on the same page yet? What did I not understand?

 

 

Back to what my original question should have been. If I have a directory excluded, and all sub-directories also excluded by default?


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

That's the way it is supposed to work. I haven't tested it in a while but that's how it always has worked for me. If you exclude some directory, any sub-directory located within it will also be excluded. Maybe it doesn't work that way with the phpThmb directory due to the directories being generated on the fly. Although that really shouldn't come into play as long as the parent is listed. You might want to try setup up some test directory with a few products and sub-directories. Then exclude the parent and make a change to one of the files. If it catches it, then something is not right.

Share this post


Link to post
Share on other sites

That's the way it is supposed to work. I haven't tested it in a while but that's how it always has worked for me. If you exclude some directory, any sub-directory located within it will also be excluded. Maybe it doesn't work that way with the phpThmb directory due to the directories being generated on the fly. Although that really shouldn't come into play as long as the parent is listed. You might want to try setup up some test directory with a few products and sub-directories. Then exclude the parent and make a change to one of the files. If it catches it, then something is not right.

Will do. Let you know tomorrow.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Is the username of your account username? If not, please try changing the settings to match your site.

 

Ah I see. It had my details for FTP in it, but I don;t know why it said username instead. All is working now! :)

 

I have got these potential hacked files:

 

admin/includes/classes/nusoap.php

admin/includes/javascript/tiny_mce/plugins/paste/js/pasteword.js

admin/includes/javascript/tiny_mce/plugins/template/template.htm

admin/includes/javascript/tiny_mce/themes/advanced/js/about.js

admin/tiny_mce/plugins/paste/js/pasteword.js

admin/tiny_mce/plugins/template/template.htm

admin/tiny_mce/themes/advanced/js/about.js

includes/classes/nusoap.php

includes/classes/seo.class.php

includes/modules/payment/paypal_standard.php

 

What do I do about it once it has found them. I've never heard of the nusoap.php before?

Share this post


Link to post
Share on other sites

Ah I see. It had my details for FTP in it, but I don;t know why it said username instead. All is working now! :)

 

I have got these potential hacked files:

Read the thread or note in the admin section of Sitemonitor regarding this.

Share this post


Link to post
Share on other sites

That's the way it is supposed to work. I haven't tested it in a while but that's how it always has worked for me. If you exclude some directory, any sub-directory located within it will also be excluded. Maybe it doesn't work that way with the phpThmb directory due to the directories being generated on the fly. Although that really shouldn't come into play as long as the parent is listed. You might want to try setup up some test directory with a few products and sub-directories. Then exclude the parent and make a change to one of the files. If it catches it, then something is not right.

I think you are on to something here Jack. Creating directories and files by hand allows Site Monitor to work the way you intended. If a parent directory is selected, it also includes sub directories.

 

However, using phpThumb (or is it oscThumb? whichever..) although the parent directory, phpThumb/cache is selected I get reports daily of thousands of image files that are added, changed, or deleted, all in the phpThumb/cache directory or one of it's sub directories. It must have something to do with dynamically created files...more importantly, directories.

 

In my tests it DID NOT throw an error for a new directory. It only threw an error for files. Maybe there is a connection?

 

 

I tried to move the phpThumb/cache directory out of the catalog files space but apparently the path is hard coded in the scripts. I'll have to find the code and change it in order to go that route.

 

Anything you can do to solve this in Site Monitor will be appreciated.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

I'll test it when I get the chance. But in the meantime, you might want to verify your sitemonitor_config.php file has that directory listed, like

$excludeList = array("...,"phpThumb",...

Other than that, I can't think of anything else.

Share this post


Link to post
Share on other sites

I'll test it when I get the chance. But in the meantime, you might want to verify your sitemonitor_config.php file has that directory listed, like

$excludeList = array("...,"phpThumb",...

Other than that, I can't think of anything else.

Yep, it's there, although "phpThumb/cache"

 

Thanks for looking.


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

I'll test it when I get the chance. But in the meantime, you might want to verify your sitemonitor_config.php file has that directory listed, like

$excludeList = array("...,"phpThumb",...

Other than that, I can't think of anything else.

The problem I think is that the reference file is built with a recursive model, adding all of the directories and files beneath the parent directory instead of the logic during the scan using a recursive methodology to exclude the sub-directories.

 

This is a good thing should a hacker get in an is able to create a new directory under an excluded directory.

 

To not break a perfectly good contribution I think I will look at moving the oscThumb cache out of the catalog files space.

 

 

Do you agree with this, Jack?


Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Share this post


Link to post
Share on other sites

Hi Jack,

 

Could you tell me if there are settings saved to the database ? I moved a site from one host to the other and site monitor HATES that I did that. So, I deleted the log file but that didn't work, so I uninstalled everything and then reinstalled it from a fresh copy. BUT, the original errors are still there making me thing the configuration is saved in a database table somewhere.

 

These are the errors when I enter the config for sitemonitor:

 

Warning: opendir( /home/content/h/o/l/xxxxxxxx/html/) [function.opendir]: failed to open dir: No such file or directory in /home/content/h/o/l/xxxxxxxxxx/html/admin/includes/functions/sitemonitor_functions.php on line 232

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/content/h/o/l/xxxxxxxxxxxx/html/admin/includes/functions/sitemonitor_functions.php on line 234

 

Warning: closedir(): supplied argument is not a valid Directory resource in /home/content/h/o/l/xxxxxxxxxxxx/html/admin/includes/functions/sitemonitor_functions.php on line 246

 

 

Thanks

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

No, SiteMonitor doesn't use the database at all. It is probably because the configure settings weren't changed. Is teh correct path to your site /home/content/h/o/l/xxxxxxxx/html/?

Share this post


Link to post
Share on other sites

Hi Jack,

 

Yes, that is the correct path (minus the xxxxx which reflect the actual folder). Site Monitor was working flawlessly on the previous host, but it does not want to reconfigure for the new host.

 

Do you have any suggestions ?

 

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

The error is saying the path is incorrect. If you are sure that it is, then there must be something on the server preventing it from being recognized. I suggest you show the error to your host and ask that they look at it.

Share this post


Link to post
Share on other sites

Thanks Jack, I will dig deeper into it.

 

 

 

Chris


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

Is it possible for you to amend your original post with frequently asked questions?

 

It seems a number of issues are discussed over and over throughout this thread. Just a suggestion as other than the installation, I see no clear instructions on how exactly to use this contribution.

 

Once I have this installed, I will just press the bottom button in admin>sitemonitor>admin, it tells me of suspected hacked files and I go open them to verify if its actually hacked if it has code similar to one's hacker use, right? Is this understanding correct?

Edited by sarafina

Contributions installed: Purchase without Account / STS/ All Products/ Header Tags Controller

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

×