Jump to content
Jack_mcs

SiteMonitor

Recommended Posts

the htaccess I can see I have to download latest osc and take that copy of the file for the imaghes directory

 

 

I couldnt find it in the downloaded contribution files at all, think I have found it in sitemonitor_functions.php seen post.

 

struggling at the moment, how do I know when I have covered all my sites files?


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

the htaccess I can see I have to download latest osc and take that copy of the file for the imaghes directory

 

 

I couldnt find it in the downloaded contribution files at all, think I have found it in sitemonitor_functions.php seen post.

 

struggling at the moment, how do I know when I have covered all my sites files?

 

got it sorted i think


Getting better with mods but no programmer am I.

Share this post


Link to post
Share on other sites

Ahh, I wasn't aware someone had uploaded a different version. Too bad that person chose to muddy the contribution waters. It happens all to often, unfortunately. This version is for both versions of oscommerce so the other will just tend to confuse people. Thanks for pointing that out since I'm sure it will come up again.

The other version does refer to previous versions and probably had it written somewhere and I missed it. So Sorry, my Bad. Although, opening up the catalog folder and seeing the choice is much better.

But as you mentioned, if someone has the same problem as I had, hopefully they can find this thread.

Share this post


Link to post
Share on other sites

What are the instructions for upgrading? I have v2.7 and want to upgrade to 2.9.

I'm not an expert at this but try copying the the V2.9 files over the old ones. Make sure the code to be inserted the other 3 files are the same in both versions too.

Share this post


Link to post
Share on other sites

What are the instructions for upgrading? I have v2.7 and want to upgrade to 2.9.

You could try using the update files included in the contribution.

Share this post


Link to post
Share on other sites

A new version has been uploaded containing the following changes:

 

- Added an option to the configure settings to delete log files after a set number of days.

- Added a log reader.

- Changed filter code so sitemonitor files are ignored in a scan.

- Changed code that checks for possible hacker files in the images directory (suggested by user burt).

- Changed the setting that add error checking to false since too many sites were having problems with it.

- Corrected instructions for creatnig cron jobs (found by user csiemons).

- Declared a variable at the beginning of sitemonitor_admin.php to prevent a missing variable warning.

- Fixed coding mistake in sitemonitor_hacker_cron.php that prevented the reference file that was causing the array_flip error.

 

Hi Jack,

 

Thanks for the new version. I noticed the sitemonitor_hacker_cron job is sending the email report to the store owner's email address from the store configuration and not the email address in the sitemonitor_configuration file. My store owner has no clue about this report. Is there any fix for this to use the config file email address? I also wanted to point out the sitemonitor_hacker_excludes.txt is not used, it uses sitemonitor_hacker_excludes_0.txt

 

Thanks,

Chuck

Share this post


Link to post
Share on other sites

Hi Jack,

 

Thanks for the new version. I noticed the sitemonitor_hacker_cron job is sending the email report to the store owner's email address from the store configuration and not the email address in the sitemonitor_configuration file. My store owner has no clue about this report. Is there any fix for this to use the config file email address? I also wanted to point out the sitemonitor_hacker_excludes.txt is not used, it uses sitemonitor_hacker_excludes_0.txt

 

Thanks,

Chuck

I seem to recall someone else mentioning the email problem. I forgot to add that to the list of changes. I'll do that with the next version. But in the meantime, you can edit the hacker file. Change

mail($config['email_address'], $subject, $results, $configuration['store_name']);

to

mail('your_address@aol.com', $subject, $results, $configuration['store_name']);

Thanks for mentioning the mistake with the file.

Share this post


Link to post
Share on other sites

I seem to recall someone else mentioning the email problem. I forgot to add that to the list of changes. I'll do that with the next version. But in the meantime, you can edit the hacker file. Change

mail($config['email_address'], $subject, $results, $configuration['store_name']);

to

mail('your_address@aol.com', $subject, $results, $configuration['store_name']);

Thanks for mentioning the mistake with the file.

 

Thanks Jack. That worked. One minor change (at least for my host) is that the email address needed to be in double-quotes:

mail("your_address@aol.com", $subject, $results, $configuration['store_name']);

Thanks again for all your help,

Chuck

Share this post


Link to post
Share on other sites

Hi Jack!

 

Great contrib. !!! You are the man!

 

But, whats wrong?

 

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/livpapc/public_html/loja/admin/sitemonitor_admin.php on line 66

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/livpapc/public_html/loja/admin/sitemonitor_admin.php on line 66

WARNING: The file_manager.php file in admin is a security risk. It should be deleted.

 

 

??

 

Sorry my english. I am brazilian!

 

God bless you!

Share this post


Link to post
Share on other sites

Hi Jack!

 

Great contrib. !!! You are the man!

 

But, whats wrong?

 

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/livpapc/public_html/loja/admin/sitemonitor_admin.php on line 66

 

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/livpapc/public_html/loja/admin/sitemonitor_admin.php on line 66

WARNING: The file_manager.php file in admin is a security risk. It should be deleted.

Try changing this line

  $invalidFiles = array_merge(glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.php'),glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.txt'));

to

  $invalidFiles = array_merge((array)glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.php'),(array)glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.txt'));

Share this post


Link to post
Share on other sites

Hi Jack,

 

Great contrib from you. I use your other contribs from you as well.

 

I have set up sitemonitor, put cron jobs etc. all is fine.

 

I have a question:

if any file has system word it gets flagged as possible hacker code. Is it advisable to change the function a bit and check for system( with an opening bracket trimming all spaces between system and opening bracket? that way simple words like system wont get flagged, reducing the number of files to check greatly

 

Thanks.

Share this post


Link to post
Share on other sites

Hi Jack,

 

One more question. If some files were flagged as hack suspect and I put them in the ignore list, if those files really get hacked then does it mean it wont be flagged? The only way out would be to determine the file size difference?

 

Thanks.

Share this post


Link to post
Share on other sites

Hi Jack,

 

My sitemonitor report tells me 173 files suspected as hacked. Do I have to go through all 173 files and compare them with the originals to see if it is OK? That is an awful lot of files.

 

Thanks.

Share this post


Link to post
Share on other sites

Hi Jack,

 

Great contrib from you. I use your other contribs from you as well.

 

I have set up sitemonitor, put cron jobs etc. all is fine.

 

I have a question:

if any file has system word it gets flagged as possible hacker code. Is it advisable to change the function a bit and check for system( with an opening bracket trimming all spaces between system and opening bracket? that way simple words like system wont get flagged, reducing the number of files to check greatly

 

Thanks.

In theory, that sounds like a good idea. But it won't catch code like

system
(

That may not ever occur but if it does, the hacker code gets by. You could do a search for the next character after system, no matter where it is, and if it is a (, then flag it. But once you start coding like that, you have to start asking if you are covering everything. What happens if a hacker does this?

$array[] = 'system';
$array[] = 'exec';
foreach ($array as $try_function) 
 $try_function();

Share this post


Link to post
Share on other sites

One more question. If some files were flagged as hack suspect and I put them in the ignore list, if those files really get hacked then does it mean it wont be flagged? The only way out would be to determine the file size difference?

The ignore list is only for the hacker test. The regular SiteMonitor code will find the change.

Share this post


Link to post
Share on other sites

My sitemonitor report tells me 173 files suspected as hacked. Do I have to go through all 173 files and compare them with the originals to see if it is OK? That is an awful lot of files.

No, you don't have to.

Share this post


Link to post
Share on other sites

Hi Jack,

 

I've set up the cron job and I get an email saying:-

 

/bin/sh: home/www/ (myurl) .com.au/buy/admin/sitemonitor.php: Permission denied

 

I've checked my .htaccess files but don't know how to fix it.

 

If this problem has been discussed before, let me know and I'll look for it.

 

Cheers,

Christina

Share this post


Link to post
Share on other sites

Hi Jack,

 

I've set up the cron job and I get an email saying:-

 

/bin/sh: home/www/ (myurl) .com.au/buy/admin/sitemonitor.php: Permission denied

 

I've checked my .htaccess files but don't know how to fix it.

 

If this problem has been discussed before, let me know and I'll look for it.

If you can run Sitemonitor manually then the problem is with your cron job syntax. You will need to ask your host about that since that syntax can vary with the host.

Share this post


Link to post
Share on other sites

Hi, great contribution. I setup the cron job and the below syntax works great for the hacker test code.

 

/web/cgi-bin/php5 "$HOME/html/username/sitemonitor_hacker_cron.php"

 

but when I try using syntax below to run the run the normal file check code, I get errors. Should I be using some other syntax? I am using Godaddy's cron job. I am not sure if I am calling it correctly.

 

/web/cgi-bin/php5 "$HOME/html/username/sitemonitor.php?instance=0

 

Below is the errors recieved.

 

/bin/sh: -c: line 1: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 2: syntax error: unexpected end of file

 

Thanks

Share this post


Link to post
Share on other sites

but when I try using syntax below to run the run the normal file check code, I get errors. Should I be using some other syntax? I am using Godaddy's cron job. I am not sure if I am calling it correctly.

 

/web/cgi-bin/php5 "$HOME/html/username/sitemonitor.php?instance=0

 

Below is the errors recieved.

 

/bin/sh: -c: line 1: unexpected EOF while looking for matching `"'
/bin/sh: -c: line 2: syntax error: unexpected end of file

You're missing a " in the second one.It should be

/web/cgi-bin/php5 "$HOME/html/username/sitemonitor.php?instance=0"

Share this post


Link to post
Share on other sites

Hello,

 

On the shop of a partner he installed SiteMonito also.

But he got a error now Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in /www/htdocs__///__includes/functions/sitemonitor_functions.php on line 148

 

I think some permissions are not good becasue he has 644 on many files inside the admin

 

how to solve this?

 

Regards,

 

jasper

 

Hi, can you share how you fixed this problem? I am having the same issure.

 

Thanks

Share this post


Link to post
Share on other sites

You're missing a " in the second one.It should be

/web/cgi-bin/php5 "$HOME/html/username/sitemonitor.php?instance=0"

 

Thank you, i did miss the ". But now I get the following:

 

Status: 404 Not Found
Content-type: text/html

No input file specified.

 

What can I do to fix this part.

 

Thanks

Share this post


Link to post
Share on other sites

Thank you, i did miss the ". But now I get the following:

 

Status: 404 Not Found
Content-type: text/html

No input file specified.

 

What can I do to fix this part.

 

Thanks

Try running it manually by going to http://your_domain.com/admin/sitemonitor.php?instance=0. If it runs, something is wrong with your cron job. If not, you are probably missing a required file. If you haven't ran it initially after installation, that might happen.

Share this post


Link to post
Share on other sites

Try running it manually by going to http://your_domain.com/admin/sitemonitor.php?instance=0. If it runs, something is wrong with your cron job. If not, you are probably missing a required file. If you haven't ran it initially after installation, that might happen.

Thanks for your help on this Jack. I ran that and that worked. My admin directory is password protected. Is it possible that this is the reason it didn't work from the cron job? To access my admin directory I must first enter the user name and password before I was able to run http://your_domain.com/admin/sitemonitor.php?instance=0.

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

×