by daniel » Wed Apr 07, 2010 8:08 pm
latest auth.php should be like:
<?php
error_reporting(0);
include_once("config/config.php");
include_once("config/conectare.php");
$AuthPW = str_replace("``", "&", $_GET[AuthPW]);
include_once("Net/SSH2.php");
$ssh = new Net_SSH2('127.0.0.1');
if(!$ssh->login('root', $AuthPW)){
if (function_exists('ssh2_connect')) {
$connection = ssh2_connect('127.0.0.1', 22);
if(!ssh2_auth_password($connection, 'root', $AuthPW)){
@mysql_close();
exit('0');
}
}else{
@mysql_close();
exit('0');
}
}
print base64_encode($AuthPW);
@mysql_close();
?>
WebHTB PRO will have only this:
<?php
error_reporting(0);
include_once("config/config.php");
include_once("config/conectare.php");
$AuthPW = $_POST[AuthPW];
include_once("Net/SSH2.php");
$ssh = new Net_SSH2("127.0.0.1", $ssh2_port);
if(!$ssh->login('root', $AuthPW)){
@mysql_close();
exit('0');
}
print base64_encode($AuthPW);
@mysql_close();
?>
SO MAJOR CHANGES ARE:
php-pecl-ssh2 removed as alternative auth method and keeped only phpseclib, so even in 2.9 version, and work with method post because get may be logend in apache log files; when you want change the port if your ssh server is not running on 22:
$ssh = new Net_SSH2("127.0.0.1", $ssh2_port);
so, in 2.9 change port 22 ao create somewhere one var vamed $ssh2_port; example: $ssh2_port = 2222;
also search in apply_changes.php
best regards