ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:22.59 GB of 70.42 GB (32.08%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: 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,

/ usr/ share/ doc/ libsnmp-session-perl/ examples/ - drwxr-xr-x

Directory:
Viewing file:     if-status.pl (3.34 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/perl -w
#
# Small sample application for table walking
#
# Given a router name and SNMP community string, traverse the RFC1213
# ifTable and write a message for each interface whose ifOperStatus
# differs from the ifAdminStatus.

require 5.003;

use strict;

use lib qw(/opt/www/cgi-bin/cug/switch/snmp);

use BER;
use SNMP_Session;
use CGI qw(:html2 :html3);

### Forward declarations
sub out_interface ($$$$$ );
sub usage ();
sub print_html_header ($ );
sub print_html_trailer ();

my $output_mode = 'text';
my $have_html_header = 0;

my ($host, $community);
my $query;
my $version;

if (defined $ENV{'REQUEST_METHOD'}) {
  $output_mode = 'html';
  $query = new CGI;

  $host = $query->param ('host');
  $community = $query->param ('community');
  print $query->header;
} else {
  my $arg;

  while (defined $ARGV[0] and $ARGV[0] =~ /^-/) {
    if ($ARGV[0] =~ /^-v/) {
    if ($ARGV[0] eq '-v') {
        shift @ARGV;
        usage () unless defined $ARGV[0];
    } else {
        $ARGV[0] = substr($ARGV[0], 2);
    }
    if ($ARGV[0] eq '1') {
        $version = '1';
    } elsif ($ARGV[0] eq '2c' or $ARGV[0] eq '2') {
        $version = '2c';
    } else {
        usage ();
    }
    } elsif ($arg eq '-html') {
      $output_mode = 'html';
    } else {
      usage ();
    }
    shift @ARGV;
  }
  $host = shift @ARGV || die;
  $community = shift @ARGV || die;
}

my $ifDescr = [1,3,6,1,2,1,2,2,1,2];
my $ifAdminStatus = [1,3,6,1,2,1,2,2,1,7];
my $ifOperStatus = [1,3,6,1,2,1,2,2,1,8];
my $locIfDescr = [1,3,6,1,4,1,9,2,2,1,1,28];

my $the_router;

sub out_interface ($$$$$) {
    my ($index, $descr, $admin, $oper, $comment) = @_;
    grep (defined $_ && ($_=pretty_print $_),
      ($descr, $admin, $oper, $comment));

    return if defined $admin && $admin == 2;
    return if defined $admin && defined $oper && $admin == $oper;

    my $admin_string = $admin ? ($admin == 1 ? 'up' : ($admin == 2 ? 'down' : "?($admin)")) : "?";
    my $oper_string = $oper ? ($oper == 1 ? 'up' : ($oper == 2 ? 'down' : "?($oper)")) : "?";
    $comment = '' unless defined $comment;

    if ($output_mode eq 'text') {
    printf "%2d  %-20s %10s %10s %s\n",
    $index, $descr, $admin_string, $oper_string,
    defined $comment ? $comment : '';
    } elsif ($output_mode eq 'html') {
    print_html_header ($the_router), $have_html_header = 1
        unless $have_html_header;
    print TR(th($index),
         td(CGI->escapeHTML($descr)),
         td({align=>'center'},$admin_string),
         td({align=>'center'},$oper_string),
         td(CGI->escapeHTML($comment))),"\n";
    }
}

$the_router = $host;

my $session =
    ($version eq '1' ? SNMPv1_Session->open ($host, $community, 161)
     : $version eq '2c' ? SNMPv2c_Session->open ($host, $community, 161)
     : die "Unknown SNMP version $version")
  || die "Opening SNMP_Session";
$session->map_table ([$ifDescr,$ifAdminStatus,$ifOperStatus,$locIfDescr],
             \&out_interface);

if ($output_mode eq 'html' && $have_html_header) {
  print_html_trailer ();
}
1;

sub usage () {
  die "Usage: $0 [-html] hostname community";
}

sub print_html_header ($ ) {
  my ($router) = @_;
  print "<html>\n";
  print head(title("Interface Listing for ".$router)),"\n";
  print " <BODY BGCOLOR=\"#ffffff\">\n",
         h1("Interface Listing for ".tt($router)),"\n",
         "  <TABLE>\n",
         TR(th("index"),
        th("descr"),
        th("admin"),
        th("oper"),
        th("description"));
}

sub print_html_trailer () {
  print "  </table>\n </body>\n</html>\n";
}
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.2138 seconds