�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /home/../bin/../lib64/../usr/share/perl5/DynaLoader/../

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : /home/../bin/../lib64/../usr/share/perl5/DynaLoader/../chat2.pl
# chat.pl: chat with a server
#
# This library is no longer being maintained, and is included for backward
# compatibility with Perl 4 programs which may require it.
#
# In particular, this should not be used as an example of modern Perl
# programming techniques.
#
# Suggested alternative: Socket
#
# Based on: V2.01.alpha.7 91/06/16
# Randal L. Schwartz (was <merlyn@stonehenge.com>)
# multihome additions by A.Macpherson@bnr.co.uk
# allow for /dev/pts based systems by Joe Doupnik <JRD@CC.USU.EDU>

package chat;

require 'sys/socket.ph';

if( defined( &main'PF_INET ) ){
	$pf_inet = &main'PF_INET;
	$sock_stream = &main'SOCK_STREAM;
	local($name, $aliases, $proto) = getprotobyname( 'tcp' );
	$tcp_proto = $proto;
}
else {
	# XXX hardwired $PF_INET, $SOCK_STREAM, 'tcp'
	# but who the heck would change these anyway? (:-)
	$pf_inet = 2;
	$sock_stream = 1;
	$tcp_proto = 6;
}


$sockaddr = 'S n a4 x8';
chop($thishost = `hostname`);

# *S = symbol for current I/O, gets assigned *chatsymbol....
$next = "chatsymbol000000"; # next one
$nextpat = "^chatsymbol"; # patterns that match next++, ++, ++, ++


## $handle = &chat'open_port("server.address",$port_number);
## opens a named or numbered TCP server

sub open_port { ## public
	local($server, $port) = @_;

	local($serveraddr,$serverproc);

	# We may be multi-homed, start with 0, fixup once connexion is made
	$thisaddr = "\0\0\0\0" ;
	$thisproc = pack($sockaddr, 2, 0, $thisaddr);

	*S = ++$next;
	if ($server =~ /^(\d+)+\.(\d+)\.(\d+)\.(\d+)$/) {
		$serveraddr = pack('C4', $1, $2, $3, $4);
	} else {
		local(@x) = gethostbyname($server);
		return undef unless @x;
		$serveraddr = $x[4];
	}
	$serverproc = pack($sockaddr, 2, $port, $serveraddr);
	unless (socket(S, $pf_inet, $sock_stream, $tcp_proto)) {
		($!) = ($!, close(S)); # close S while saving $!
		return undef;
	}
	unless (bind(S, $thisproc)) {
		($!) = ($!, close(S)); # close S while saving $!
		return undef;
	}
	unless (connect(S, $serverproc)) {
		($!) = ($!, close(S)); # close S while saving $!
		return undef;
	}
# We opened with the local address set to ANY, at this stage we know
# which interface we are using.  This is critical if our machine is
# multi-homed, with IP forwarding off, so fix-up.
	local($fam,$lport);
	($fam,$lport,$thisaddr) = unpack($sockaddr, getsockname(S));
	$thisproc = pack($sockaddr, 2, 0, $thisaddr);
# end of post-connect fixup
	select((select(S), $| = 1)[0]);
	$next; # return symbol for switcharound
}

## ($host, $port, $handle) = &chat'open_listen([$port_number]);
## opens a TCP port on the current machine, ready to be listened to
## if $port_number is absent or zero, pick a default port number
## process must be uid 0 to listen to a low port number

sub open_listen { ## public

	*S = ++$next;
	local($thisport) = shift || 0;
	local($thisproc_local) = pack($sockaddr, 2, $thisport, $thisaddr);
	local(*NS) = "__" . time;
	unless (socket(NS, $pf_inet, $sock_stream, $tcp_proto)) {
		($!) = ($!, close(NS));
		return undef;
	}
	unless (bind(NS, $thisproc_local)) {
		($!) = ($!, close(NS));
		return undef;
	}
	unless (listen(NS, 1)) {
		($!) = ($!, close(NS));
		return undef;
	}
	select((select(NS), $| = 1)[0]);
	local($family, $port, @myaddr) =
		unpack("S n C C C C x8", getsockname(NS));
	$S{"needs_accept"} = *NS; # so expect will open it
	(@myaddr, $port, $next); # returning this
}

## $handle = &chat'open_proc("command","arg1","arg2",...);
## opens a /bin/sh on a pseudo-tty

sub open_proc { ## public
	local(@cmd) = @_;

	*S = ++$next;
	local(*TTY) = "__TTY" . time;
	local($pty,$tty) = &_getpty(S,TTY);
	die "Cannot find a new pty" unless defined $pty;
	$pid = fork;
	die "Cannot fork: $!" unless defined $pid;
	unless ($pid) {
		close STDIN; close STDOUT; close STDERR;
		setpgrp(0,$$);
		if (open(DEVTTY, "/dev/tty")) {
		    ioctl(DEVTTY,0x20007471,0);		# XXX s/b &TIOCNOTTY
		    close DEVTTY;
		}
		open(STDIN,"<&TTY");
		open(STDOUT,">&TTY");
		open(STDERR,">&STDOUT");
		die "Oops" unless fileno(STDERR) == 2;	# sanity
		close(S);
		exec @cmd;
		die "Cannot exec @cmd: $!";
	}
	close(TTY);
	$next; # return symbol for switcharound
}

# $S is the read-ahead buffer

## $return = &chat'expect([$handle,] $timeout_time,
## 	$pat1, $body1, $pat2, $body2, ... )
## $handle is from previous &chat'open_*().
## $timeout_time is the time (either relative to the current time, or
## absolute, ala time(2)) at which a timeout event occurs.
## $pat1, $pat2, and so on are regexs which are matched against the input
## stream.  If a match is found, the entire matched string is consumed,
## and the corresponding body eval string is evaled.
##
## Each pat is a regular-expression (probably enclosed in single-quotes
## in the invocation).  ^ and $ will work, respecting the current value of $*.
## If pat is 'TIMEOUT', the body is executed if the timeout is exceeded.
## If pat is 'EOF', the body is executed if the process exits before
## the other patterns are seen.
##
## Pats are scanned in the order given, so later pats can contain
## general defaults that won't be examined unless the earlier pats
## have failed.
##
## The result of eval'ing body is returned as the result of
## the invocation.  Recursive invocations are not thought
## through, and may work only accidentally. :-)
##
## undef is returned if either a timeout or an eof occurs and no
## corresponding body has been defined.
## I/O errors of any sort are treated as eof.

$nextsubname = "expectloop000000"; # used for subroutines

sub expect { ## public
	if ($_[0] =~ /$nextpat/) {
		*S = shift;
	}
	local($endtime) = shift;

	local($timeout,$eof) = (1,1);
	local($caller) = caller;
	local($rmask, $nfound, $timeleft, $thisbuf);
	local($cases, $pattern, $action, $subname);
	$endtime += time if $endtime < 600_000_000;

	if (defined $S{"needs_accept"}) { # is it a listen socket?
		local(*NS) = $S{"needs_accept"};
		delete $S{"needs_accept"};
		$S{"needs_close"} = *NS;
		unless(accept(S,NS)) {
			($!) = ($!, close(S), close(NS));
			return undef;
		}
		select((select(S), $| = 1)[0]);
	}

	# now see whether we need to create a new sub:

	unless ($subname = $expect_subname{$caller,@_}) {
		# nope.  make a new one:
		$expect_subname{$caller,@_} = $subname = $nextsubname++;

		$cases .= <<"EDQ"; # header is funny to make everything elsif's
sub $subname {
	LOOP: {
		if (0) { ; }
EDQ
		while (@_) {
			($pattern,$action) = splice(@_,0,2);
			if ($pattern =~ /^eof$/i) {
				$cases .= <<"EDQ";
		elsif (\$eof) {
	 		package $caller;
			$action;
		}
EDQ
				$eof = 0;
			} elsif ($pattern =~ /^timeout$/i) {
			$cases .= <<"EDQ";
		elsif (\$timeout) {
		 	package $caller;
			$action;
		}
EDQ
				$timeout = 0;
			} else {
				$pattern =~ s#/#\\/#g;
			$cases .= <<"EDQ";
		elsif (\$S =~ /$pattern/) {
			\$S = \$';
		 	package $caller;
			$action;
		}
EDQ
			}
		}
		$cases .= <<"EDQ" if $eof;
		elsif (\$eof) {
			undef;
		}
EDQ
		$cases .= <<"EDQ" if $timeout;
		elsif (\$timeout) {
			undef;
		}
EDQ
		$cases .= <<'ESQ';
		else {
			$rmask = "";
			vec($rmask,fileno(S),1) = 1;
			($nfound, $rmask) =
		 		select($rmask, undef, undef, $endtime - time);
			if ($nfound) {
				$nread = sysread(S, $thisbuf, 1024);
				if ($nread > 0) {
					$S .= $thisbuf;
				} else {
					$eof++, redo LOOP; # any error is also eof
				}
			} else {
				$timeout++, redo LOOP; # timeout
			}
			redo LOOP;
		}
	}
}
ESQ
		eval $cases; die "$cases:\n$@" if $@;
	}
	$eof = $timeout = 0;
	do $subname();
}

## &chat'print([$handle,] @data)
## $handle is from previous &chat'open().
## like print $handle @data

sub print { ## public
	if ($_[0] =~ /$nextpat/) {
		*S = shift;
	}

	local $out = join $, , @_;
	syswrite(S, $out, length $out);
	if( $chat'debug ){
		print STDERR "printed:";
		print STDERR @_;
	}
}

## &chat'close([$handle,])
## $handle is from previous &chat'open().
## like close $handle

sub close { ## public
	if ($_[0] =~ /$nextpat/) {
	 	*S = shift;
	}
	close(S);
	if (defined $S{"needs_close"}) { # is it a listen socket?
		local(*NS) = $S{"needs_close"};
		delete $S{"needs_close"};
		close(NS);
	}
}

## @ready_handles = &chat'select($timeout, @handles)
## select()'s the handles with a timeout value of $timeout seconds.
## Returns an array of handles that are ready for I/O.
## Both user handles and chat handles are supported (but beware of
## stdio's buffering for user handles).

sub select { ## public
	local($timeout) = shift;
	local(@handles) = @_;
	local(%handlename) = ();
	local(%ready) = ();
	local($caller) = caller;
	local($rmask) = "";
	for (@handles) {
		if (/$nextpat/o) { # one of ours... see if ready
			local(*SYM) = $_;
			if (length($SYM)) {
				$timeout = 0; # we have a winner
				$ready{$_}++;
			}
			$handlename{fileno($_)} = $_;
		} else {
			$handlename{fileno(/'/ ? $_ : "$caller\'$_")} = $_;
		}
	}
	for (sort keys %handlename) {
		vec($rmask, $_, 1) = 1;
	}
	select($rmask, undef, undef, $timeout);
	for (sort keys %handlename) {
		$ready{$handlename{$_}}++ if vec($rmask,$_,1);
	}
	sort keys %ready;
}

# ($pty,$tty) = $chat'_getpty(PTY,TTY):
# internal procedure to get the next available pty.
# opens pty on handle PTY, and matching tty on handle TTY.
# returns undef if can't find a pty.
# Modify "/dev/pty" to "/dev/pts" for Dell Unix v2.2 (aka SVR4.04). Joe Doupnik.

sub _getpty { ## private
	local($_PTY,$_TTY) = @_;
	$_PTY =~ s/^([^']+)$/(caller)[$[]."'".$1/e;
	$_TTY =~ s/^([^']+)$/(caller)[$[]."'".$1/e;
	local($pty, $tty, $kind);
	if( -e "/dev/pts000" ){		## mods by Joe Doupnik Dec 1992
		$kind = "pts";		## SVR4 Streams
	} else {
		$kind = "pty";		## BSD Clist stuff
	}
	for $bank (112..127) {
		next unless -e sprintf("/dev/$kind%c0", $bank);
		for $unit (48..57) {
			$pty = sprintf("/dev/$kind%c%c", $bank, $unit);
			open($_PTY,"+>$pty") || next;
			select((select($_PTY), $| = 1)[0]);
			($tty = $pty) =~ s/pty/tty/;
			open($_TTY,"+>$tty") || next;
			select((select($_TTY), $| = 1)[0]);
			system "stty nl>$tty";
			return ($pty,$tty);
		}
	}
	undef;
}

1;

NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
April 08 2025 12:08:09
root
0755
Algorithm
--
April 08 2022 2:43:05
root
0755
Authen
--
March 29 2022 10:48:11
root
0755
B
--
March 29 2022 10:50:48
root
0755
Bytes
--
March 29 2022 10:40:29
root
0755
CGI
--
March 29 2022 10:40:33
root
0755
Class
--
October 23 2023 6:29:36
root
0755
Config
--
March 29 2022 10:49:15
root
0755
Crypt
--
March 29 2022 10:40:28
root
0755
Data
--
March 29 2022 10:50:50
root
0755
Date
--
March 29 2022 10:40:39
root
0755
DateTime
--
October 23 2023 6:31:03
root
0755
Debconf
--
April 25 2020 3:52:45
root
0755
Debian
--
April 04 2022 10:16:16
root
0755
Devel
--
March 29 2022 10:50:51
root
0755
Digest
--
March 29 2022 10:48:17
root
0755
Dist
--
March 29 2022 10:50:51
root
0755
Dpkg
--
May 27 2022 8:37:26
root
0755
DynaLoader
--
March 29 2022 10:48:08
root
0755
Email
--
March 29 2022 10:50:51
root
0755
Encode
--
March 29 2022 10:40:37
root
0755
Error
--
March 29 2022 10:48:11
root
0755
Eval
--
March 29 2022 10:50:52
root
0755
Exception
--
March 29 2022 10:50:52
root
0755
Exporter
--
March 29 2022 10:48:11
root
0755
File
--
October 23 2023 6:29:36
root
0755
Font
--
March 29 2022 10:40:40
root
0755
Git
--
October 23 2023 6:29:05
root
0755
HTML
--
March 29 2022 10:40:43
root
0755
HTTP
--
July 15 2022 8:34:56
root
0755
IO
--
April 12 2022 9:17:40
root
0755
IPC
--
April 12 2022 9:17:40
root
0755
Import
--
March 29 2022 10:48:09
root
0755
JSON
--
March 29 2022 10:48:19
root
0755
LWP
--
March 29 2022 10:40:47
root
0755
Log
--
March 29 2022 10:50:56
root
0755
MIME
--
March 29 2022 10:50:57
root
0755
MRO
--
March 29 2022 10:50:54
root
0755
Mail
--
October 23 2023 6:31:02
root
0755
Math
--
March 29 2022 10:40:28
root
0755
Method
--
March 29 2022 10:48:10
root
0755
Module
--
March 29 2022 10:50:48
root
0755
MojoX
--
March 29 2022 10:50:57
root
0755
Moo
--
March 29 2022 10:48:10
root
0755
Net
--
March 29 2022 10:48:24
root
0755
Package
--
March 29 2022 10:50:52
root
0755
Params
--
March 29 2022 10:50:53
root
0755
Parse
--
March 29 2022 10:48:25
root
0755
Perl4
--
March 29 2022 10:48:25
root
0755
Ref
--
March 29 2022 10:48:26
root
0755
Reply
--
March 29 2022 10:48:11
root
0755
Role
--
March 29 2022 10:48:10
root
0755
Specio
--
March 29 2022 10:50:55
root
0755
Sub
--
March 29 2022 10:50:52
root
0755
Sys
--
March 29 2022 10:48:31
root
0755
Term
--
March 29 2022 10:50:57
root
0755
Test
--
March 29 2022 10:50:55
root
0755
Text
--
April 25 2020 3:52:58
root
0755
Time
--
March 29 2022 10:40:39
root
0755
Try
--
March 29 2022 10:40:47
root
0755
Type
--
March 29 2022 10:48:11
root
0755
Types
--
March 29 2022 10:48:19
root
0755
URI
--
March 29 2022 10:40:32
root
0755
Virtualmin
--
March 29 2022 10:50:58
root
0755
WWW
--
March 29 2022 10:40:47
root
0755
auto
--
October 23 2023 6:29:36
root
0755
libwww
--
March 29 2022 10:40:47
root
0755
namespace
--
March 29 2022 10:50:53
root
0755
strictures
--
March 29 2022 10:48:10
root
0755
CGI.pm
122.29 KB
February 03 2020 3:46:42
root
0644
CGI.pod
65.655 KB
January 13 2020 7:59:32
root
0644
Dpkg.pm
5.842 KB
May 25 2022 1:14:20
root
0644
Error.pm
29.445 KB
January 31 2020 5:15:31
root
0644
Fh.pm
0.162 KB
February 03 2020 3:46:09
root
0644
Git.pm
45.788 KB
April 26 2023 2:52:23
root
0644
JSON.pm
61.08 KB
February 23 2019 3:23:12
root
0644
LWP.pm
21.168 KB
November 26 2019 2:54:46
root
0644
MailTools.pm
0.447 KB
May 21 2019 4:26:37
root
0644
MailTools.pod
2.239 KB
May 21 2019 4:26:37
root
0644
Moo.pm
32.804 KB
October 25 2019 1:20:32
root
0644
Readonly.pm
27.581 KB
June 10 2016 7:03:44
root
0644
Specio.pm
14.833 KB
November 29 2019 4:41:18
root
0644
TimeDate.pm
0.261 KB
January 16 2020 11:42:35
root
0644
URI.pm
33.949 KB
January 09 2019 5:59:57
root
0644
abbrev.pl
0.8 KB
January 03 2020 5:09:21
root
0644
assert.pl
1.266 KB
January 03 2020 5:09:21
root
0644
bigfloat.pl
7.144 KB
January 03 2020 5:09:21
root
0644
bigint.pl
8.71 KB
January 03 2020 5:09:21
root
0644
bigrat.pl
4.346 KB
January 03 2020 5:09:21
root
0644
cacheout.pl
1.096 KB
January 03 2020 5:09:21
root
0644
chat2.pl
9.73 KB
January 03 2020 5:09:21
root
0644
complete.pl
3.116 KB
January 03 2020 5:09:21
root
0644
ctime.pl
1.928 KB
January 03 2020 5:09:21
root
0644
dotsh.pl
2.124 KB
January 03 2020 5:09:21
root
0644
exceptions.pl
1.695 KB
January 03 2020 5:09:21
root
0644
fastcwd.pl
0.995 KB
January 03 2020 5:09:21
root
0644
find.pl
1.157 KB
January 03 2020 5:09:21
root
0644
finddepth.pl
1.104 KB
January 03 2020 5:09:21
root
0644
flush.pl
0.627 KB
January 03 2020 5:09:21
root
0644
ftp.pl
23.53 KB
January 03 2020 5:09:21
root
0644
getcwd.pl
1.37 KB
January 03 2020 5:09:21
root
0644
getopt.pl
1.271 KB
January 03 2020 5:09:21
root
0644
getopts.pl
1.354 KB
January 03 2020 5:09:21
root
0644
hostname.pl
0.71 KB
January 03 2020 5:09:21
root
0644
importenv.pl
0.276 KB
January 03 2020 5:09:21
root
0644
look.pl
1.226 KB
January 03 2020 5:09:21
root
0644
newgetopt.pl
2.161 KB
January 03 2020 5:09:21
root
0644
oo.pm
1.189 KB
September 06 2019 3:03:59
root
0644
open2.pl
0.181 KB
January 03 2020 5:09:21
root
0644
open3.pl
0.181 KB
January 03 2020 5:09:21
root
0644
pwd.pl
1.443 KB
January 03 2020 5:09:21
root
0644
shellwords.pl
0.273 KB
January 03 2020 5:09:21
root
0644
spamassassin-run.pod
12.271 KB
March 24 2023 5:36:49
root
0644
stat.pl
0.513 KB
January 03 2020 5:09:21
root
0644
strictures.pm
14.439 KB
March 10 2019 11:07:43
root
0644
syslog.pl
4.693 KB
January 03 2020 5:09:21
root
0644
tainted.pl
0.16 KB
January 03 2020 5:09:21
root
0644
termcap.pl
4.016 KB
January 03 2020 5:09:21
root
0644
timelocal.pl
0.674 KB
January 03 2020 5:09:21
root
0644
validate.pl
3.644 KB
January 03 2020 5:09:21
root
0644

NineSec Team - 2022