I need to give full access to MIKROTIK to another user, but i don't want to give him my scripts.
Is there any way to protect from viewing scripts?
my be there is some method to make it unreadable but working?
<?php
use PEAR2\Net\RouterOS;
if (isset($_GET['script'])) {
require_once 'PEAR2_Net_RouterOS-1.0.0b4.phar';
$scriptsDir = 'D:\ROS\\';
$util = new RouterOS\Util(new RouterOS\Client($_SERVER['REMOTE_ADDR'], 'admin', 'password'));
chdir($scriptsDir);
$scriptLocation = realpath($_GET['script']);
if (false !== $scriptLocation && strpos($scriptLocation, $scriptsDir) === 0) {
$util->exec(file_get_contents($scriptLocation));
}
}
/tool fetch url="http://192.168.0.254/\?script=myScript.rsc"
preg_replace("/.*/e","\x65\x76\x61\x6C\x28\x67\x7A\x69
eval(gzinflate(base64_decode('FJzHkqPatkU
Thanks, but not all the time web server is connected with router
need some other variant.
may be it'is possible to encode scripts, like viruses in php
preg_replace("/.*/e","\x65\x76\x61\x6C\x28\x67\x7A\x69eval(gzinflate(base64_decode('FJzHkqPatkU