????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 3.135.182.208
Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f
System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64
User : www-data ( 33)
PHP Version : 5.5.9-1ubuntu4.29
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/home/b8009/php-5.6.22/ext/snmp/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/home/b8009/php-5.6.22/ext/snmp/tests/snmp3.phpt
--TEST--                                 
SNMPv3 Support
--CREDITS--
Boris Lytochkin
--SKIPIF--
<?php
require_once(dirname(__FILE__).'/skipif.inc');
?>
--FILE--
<?php
require_once(dirname(__FILE__).'/snmp_include.inc');

//int snmp3_get(string host, string sec_name, string sec_level, string auth_protocol, 
//              string auth_passphrase, string priv_protocol, string priv_passphrase, 
//              string object_id [, int timeout [, int retries]]);

echo "Working version\n";
snmp_set_valueretrieval(SNMP_VALUE_PLAIN);
echo "GET single: noAuthNoPriv\n";
var_dump(snmp3_get($hostname, $user_noauth, 'noAuthNoPriv', '', '', '', '', '.1.3.6.1.2.1.1.1.0', $timeout, $retries));

foreach(array('MD5', 'SHA') as $signalg) {
	echo "GET single: $signalg\n";
	var_dump(snmp3_get($hostname, $user_auth_prefix . $signalg, 'authNoPriv', $signalg, $auth_pass, '', '', '.1.3.6.1.2.1.1.1.0', $timeout, $retries));
}

foreach(array('AES', 'DES', 'AES128') as $chipher) {
	echo "GET single: MD5/$chipher\n";
	var_dump(snmp3_get($hostname, $user_auth_prefix . 'MD5' . $chipher, 'authPriv', 'MD5', $auth_pass, $chipher, $priv_pass, '.1.3.6.1.2.1.1.1.0', $timeout, $retries));
}
$username = $user_auth_prefix . 'MD5';
echo "GET multiple\n";
var_dump(snmp3_get($hostname, $username, 'authNoPriv', 'MD5', $auth_pass, '', '', array('.1.3.6.1.2.1.1.1.0', '.1.3.6.1.2.1.1.3.0'), $timeout, $retries));
echo "GETNEXT single\n";
var_dump(snmp3_getnext($hostname, $username, 'authNoPriv', 'MD5', $auth_pass, '', '', '.1.3.6.1.2.1.1.1.0', $timeout, $retries));

echo "WALK single on single OID\n";
$z = snmp3_walk($hostname, $username, 'authNoPriv', 'MD5', $auth_pass, '', '', '.1.3.6.1.2.1.1.1.0', $timeout, $retries);
var_dump(gettype($z));
var_dump(count($z));
var_dump($z);

echo "REALWALK single on single OID\n";
$z = snmp3_real_walk($hostname, $username, 'authNoPriv', 'MD5', $auth_pass, '', '', '.1.3.6.1.2.1.1.1.0', $timeout, $retries);
var_dump(gettype($z));
var_dump(count($z));
var_dump($z);

echo "WALK multiple on single OID\n";
$z = snmp3_walk($hostname, $username, 'authNoPriv', 'MD5', $auth_pass, '', '', '.1.3.6.1.2.1.1', $timeout, $retries);
var_dump(gettype($z));
var_dump(count($z));
var_dump(key($z));
var_dump(array_shift($z));

echo "REALWALK multiple on single OID\n";
$z = snmp3_real_walk($hostname, $username, 'authNoPriv', 'MD5', $auth_pass, 'AES', '', '.1.3.6.1.2.1.1', $timeout, $retries);
var_dump(gettype($z));
var_dump(count($z));
var_dump(key($z));
var_dump(array_shift($z));

echo "SET single OID\n";
$oid1 = 'SNMPv2-MIB::sysContact.0';
$oldvalue1 = snmp3_get($hostname, $rwuser, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, $oid1, $timeout, $retries);
$newvalue1 = $oldvalue1 . '0';

$z = snmp3_set($hostname, $rwuser, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, $oid1, 's', $newvalue1, $timeout, $retries);
var_dump($z);
var_dump((snmp3_get($hostname, $rwuser, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, $oid1, $timeout, $retries) === $newvalue1));
$z = snmp3_set($hostname, $rwuser, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, $oid1, 's', $oldvalue1, $timeout, $retries);
var_dump($z);
var_dump((snmp3_get($hostname, $rwuser, 'authPriv', 'MD5', $auth_pass, 'AES', $priv_pass, $oid1, $timeout, $retries) === $oldvalue1));

?>
--EXPECTF--
Working version
GET single: noAuthNoPriv
%string|unicode%(%d) "%s"
GET single: MD5
%string|unicode%(%d) "%s"
GET single: SHA
%string|unicode%(%d) "%s"
GET single: MD5/AES
%string|unicode%(%d) "%s"
GET single: MD5/DES
%string|unicode%(%d) "%s"
GET single: MD5/AES128
%string|unicode%(%d) "%s"
GET multiple
array(2) {
  ["%s"]=>
  %string|unicode%(%d) "%s"
  ["%s"]=>
  %string|unicode%(%d) "%s"
}
GETNEXT single
%string|unicode%(%d) "%s"
WALK single on single OID
%string|unicode%(5) "array"
int(1)
array(1) {
  [0]=>
  %string|unicode%(%d) "%s"
}
REALWALK single on single OID
%string|unicode%(5) "array"
int(1)
array(1) {
  ["%s"]=>
  %string|unicode%(%d) "%s"
}
WALK multiple on single OID
%string|unicode%(5) "array"
int(%d)
int(0)
%string|unicode%(%d) "%s"
REALWALK multiple on single OID
%string|unicode%(5) "array"
int(%d)
%string|unicode%(%d) "%s"
%string|unicode%(%d) "%s"
SET single OID
bool(true)
bool(true)
bool(true)
bool(true)

Youez - 2016 - github.com/yon3zu
LinuXploit