Please wait while we load your page...
 

Announcements

ChangeFinder

More Tools. . .

We provide this tool for FREE! However, we would greatly appreciate your support so we can continue to develop more tools (online tools and downloadable tools). You can show your support by sharing / liking this tool on Facebook. You can also tweet this page to your Twitter followers and following us on Twitter.


ChangeFinder is a tool that searches your site for changed files: existing files changed and new files added. If changed files are detected, you are notified via email of which file(s) was(were) changed. You can run this script two ways:

1. Automatically via cron process. Preferred method. You can create a cron job via cPanel. Otherwise, you can ask your web host to create a cron job for execute the app at preset times: for example, once daily.
2. Manually vis web browser.

Why install and run this app? For security precautions. The primary function of this app is to detect if a hacker has gained access to your server / website, and altered any files or added new files. Using this app is invaluable in detecting if this happened, and which files were affected. This app is highly recommended, and we suggest you run it daily. It won't stop hackers, but it will watch out for them.

changefinder.php


<?php
##########################################################################
#  ChangeFinder Version 2.00201510261
#
#  Created:		Oct 26, 2015
#  Updated:		Oct 26, 2015
#  Copyright:	2015 Password Sentry. All Rights Reserved
#
#  URL:			https://www.password-sentry.com/changefinder/
##########################################################################
##########################################################################
#  Copyright Notice
##########################################################################
#  Any redistribution of this script without the expressed written consent
#  of Password Sentry is strictly prohibited. Copying any of the code
#  contained within this script and claiming it as your own is also
#  prohibited. You may not remove any of these header notices. By using
#  this code you agree to indemnify Password Sentry from any liability
#  that might arise from its use.
##########################################################################
#  Installation
##########################################################################
#  1. Name file as changefinder.php
#  2. Define constants below.
#  3. Upload to web server (Either upload to password protected directory,
# or delete from web server after done)
#  4. Create cron job to call script. You can also call script via web
# browser. In either case you need to pass 'secret' value to the script.
# For example, via web browser: changefinder.php?secret=secretword
# For example, via cron: changefinder.php secretword
define('secret',		'secretword');
# Directory to start searching. Default is directory the script is installed.
define('dirtostart',	'./');
# Directory(ies) to skip. Enter as an array. Optional.
define('dirstoskip',	serialize (array('somedir1', 'somedir2')));
# Enter time in minutes to look for changes. Default is 1440 minutes
# (24 hours): find files changed in past 24 hours. The value should
# correspond to cron time. For example, if you run the app once weekly,
# then set to 10080 (1 week).
define('minutes',		'1440');
# Email address to send reports if changed files found.
define('email',			'pacific@shaw.ca');
##########################################################################
#  Do NOT change or alter the code below!
##########################################################################
chdir(dirname(__FILE__));
if ((PHP_SAPI == 'cli') and ($argv[1] != secret)) { die('No Secret passed or incorrect Secret passed!'); }
elseif ((PHP_SAPI != 'cli') and ($_GET['secret'] != secret)) { die('No Secret passed or incorrect Secret passed!!'); }
unset($prune);
$dirstoskip	= unserialize(dirstoskip);
if ($dirstoskip and is_array($dirstoskip)) {
	foreach ($dirstoskip as $dir) {
		$trimdir	= ltrim($dir, "/");
		$path		= escapeshellarg("*/{$trimdir}");
		$prune		.= " -path $path -prune -o ";
	}
}
$cmd		= 'find ' . escapeshellarg(dirtostart) . $prune . ' -cmin -' . minutes . ' -print | sort';
exec($cmd, $changed);
if ($changed) {
	$output	= "Files created or modified in past " . minutes . " minutes:\n\n";
	$output	.= implode("\n", $changed) . "\n\n";
	$output	.= "Generated by Password Sentry ChangeFinder app\n";
	$output	.= "https://www.password-sentry.com/changefinder/\n";
	if (email) {
		$headers	= 'From: ' . email . "\r\n";
		$headers	.= 'Reply-To: ' . email . "\r\n";
		$headers	.= 'Return-Path: ' . email . "\r\n";
		mail(email, 'Changed Files', $output, $headers);
	}
	echo $output;
}
else { die('No changed files found!'); }
?>


Live Chat Not Available