????JFIF??x?x????'403WebShell
403Webshell
Server IP : 79.136.114.73  /  Your IP : 216.73.216.170
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 :  /usr/share/doc/lsof/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/doc/lsof/examples/identd.perl5
#!/usr/bin/perl
###################################################################
# identd.perl5 : An implementation of RFC 1413 Ident Server
#                using Vic Abell's lsof.
#
# - Started from inetd with 'nowait' option. This entry in 
#   /etc/inetd.conf will suffice :
#
#   ident   stream  tcp     nowait  root    /usr/local/bin/identd.perl5 -t200
#
# - Multiple instances of the server are not a performance penalty
#   since they shall use lsof's cacheing mechanism. (compare with
#   Peter Eriksson's pidentd)
# - assumes 'lsof' binary in $PATH
# - Command line arguments :
#   -t TIMEOUT Number of seconds to wait for a query before aborting.
#              Default is 120.
#
# Kapil Chowksey <kchowksey@hss.hns.com>
###################################################################

use Socket;
use Getopt::Std;

# Set path to lsof.

if (($LSOF = &isexec("../lsof")) eq "") {	# Try .. first
    if (($LSOF = &isexec("lsof")) eq "") {	# Then try . and $PATH
	print "can't execute $LSOF\n"; exit 1
    }
}

# redirect lsof's warnings/errors to /dev/null
close(STDERR);
open(STDERR, ">/dev/null");

$Timeout = "120";

&getopts('t:');
if ($opt_t) {
    $Timeout = $opt_t;
}

($port, $iaddr) = sockaddr_in(getpeername(STDIN));
$peer_addr = inet_ntoa($iaddr);

# read ident-query from socket (STDIN) with a timeout.
$timeout = int($Timeout);
eval {
    local $SIG{ALRM} = sub { die "alarm\n" };
    alarm $timeout;
    $query = <STDIN>;
    alarm 0;
};
die if $@ && $@ ne "alarm\n";
if ($@) {
    # timed out
    exit;
}

# remove all white-spaces from query
$query =~ s/\s//g;

$serv_port = "";
$cli_port = "";
($serv_port,$cli_port) = split(/,/,$query);

if ($serv_port =~ /^[0-9]+$/) {
    if (int($serv_port) < 1 || int($serv_port) > 65535) {
        print $query." : ERROR : INVALID-PORT"."\n";
        exit;
    }
} else {
    print $query." : ERROR : INVALID-PORT"."\n";
    exit;
}

if ($cli_port =~ /^[0-9]+$/) {
    if (int($cli_port) < 1 || int($cli_port) > 65535) {
        print $query." : ERROR : INVALID-PORT"."\n";
        exit;
    }
} else {
    print $query." : ERROR : INVALID-PORT"."\n";
    exit;
}

open(LSOFP,"$LSOF -nPDi -T -FLn -iTCP@".$peer_addr.":".$cli_port."|");

$user = "UNKNOWN";
while ($a_line = <LSOFP>) {
    # extract user name.
    if ($a_line =~ /^L.*/) {
        ($user) = ($a_line =~ /^L(.*)/);
    }

    # make sure local port matches.
    if ($a_line =~ /^n.*:\Q$serv_port->/) {
        print $serv_port.", ".$cli_port." : USERID : UNIX :".$user."\n";
        exit;
    }
}

print $serv_port.", ".$cli_port." : ERROR : NO-USER"."\n";


## isexec($path) -- is $path executable
#
# $path   = absolute or relative path to file to test for executabiity.
#	    Paths that begin with neither '/' nor '.' that arent't found as
#	    simple references are also tested with the path prefixes of the
#	    PATH environment variable.  

sub
isexec {
    my ($path) = @_;
    my ($i, @P, $PATH);

    $path =~ s/^\s+|\s+$//g;
    if ($path eq "") { return(""); }
    if (($path =~ m#^[\/\.]#)) {
	if (-x $path) { return($path); }
	return("");
    }
    $PATH = $ENV{PATH};
    @P = split(":", $PATH);
    for ($i = 0; $i <= $#P; $i++) {
	if (-x "$P[$i]/$path") { return("$P[$i]/$path"); }
    }
    return("");
}

Youez - 2016 - github.com/yon3zu
LinuXploit