403Webshell
Server IP : 103.119.228.120  /  Your IP : 18.191.129.241
Web Server : Apache
System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : nobody ( 99)
PHP Version : 5.6.40
Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime
MySQL : ON |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /usr/sbin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/sbin/exim_checkaccess
#! /bin/sh

# Copyright (c) University of Cambridge, 1995 - 2007
# See the file NOTICE for conditions of use and distribution.

# Except when they appear in comments, the following placeholders in this
# source are replaced when it is turned into a runnable script:
#
# CONFIGURE_FILE_USE_NODE
# CONFIGURE_FILE
# BIN_DIRECTORY
# PERL_COMMAND

# This file has been so processed.

# A shell+perl wrapper script to run an automated -bh test to check out
# ACLs for incoming addresses.

# Save the shell arguments because we are going to need the shell variables
# while sorting out the configuration file.

args="$@"

# See if this installation is using the esoteric "USE_NODE" feature of Exim,
# in which it uses the host's name as a suffix for the configuration file name.

if [ "" = "yes" ]; then
  hostsuffix=.`uname -n`
fi

# Now find the configuration file name. This has got complicated because
# CONFIGURE_FILE may now be a list of files. The one that is used is the first
# one that exists. Mimic the code in readconf.c by testing first for the
# suffixed file in each case.

set `awk -F: '{ for (i = 1; i <= NF; i++) print $i }' <<End
/etc/exim.conf
End
`
while [ "$config" = "" -a $# -gt 0 ] ; do
  if [ -f "$1$hostsuffix" ] ; then
    config="$1$hostsuffix"
  elif [ -f "$1" ] ; then
    config="$1"
  fi
  shift
done

# Search for an exim_path setting in the configure file; otherwise use the bin
# directory. BEWARE: a tab character is needed in the command below. It has had
# a nasty tendency to get lost in the past. Use a variable to hold a space and
# a tab to keep the tab in one place.

exim_path=`perl -ne 'chop;if (/^\s*exim_path\s*=\s*(.*)/){print "$1\n";last;}' $config`
if test "$exim_path" = ""; then exim_path=/usr/sbin/exim; fi


#########################################################################


# Now run the perl script, passing in the Exim path and the arguments given
# to the overall script.

/usr/local/cpanel/3rdparty/perl/536/bin/perl - $exim_path $args <<'End'

BEGIN { pop @INC if $INC[-1] eq '.' };
use FileHandle;
use File::Basename;
use IPC::Open2;

if ($ARGV[0] eq '--version') {
    print basename($0) . ": $0\n",
          "build: 4.96.2\n",
          "perl(runtime): $]\n";
          exit 0;
}

if (scalar(@ARGV) < 3)
  {
  print "Usage: exim_checkaccess <IP address> <email address> [exim options]\n";
  exit(1);
  }

$exim_path = $ARGV[0];          # Set up by the calling shell script
$host      = $ARGV[1];          # Mandatory original first argument
$recipient = $ARGV[2];          # Mandatory original second argument

$c4 = qr/2 (?:[0-4]\d | 5[0-5]) | 1\d\d | \d{1,2}/x;  # IPv4 component
$a4 = qr/^$c4\.$c4\.$c4\.$c4$/;                       # IPv4 address

$c6 = qr/[0-9a-f]{1,4}/i;                             # IPv6 component

# Split the various formats of IPv6 addresses into several cases. I don't
# think I can graft regex that matches all of them without using alternatives.

# 1. Starts with :: followed by up to 7 components

$a6_0 = qr/^::(?:$c6:){0,6}$c6$/x;

# 2. 8 non-empty components

$a6_1 = qr/^(?:$c6:){7}$c6$/x;

# 3. This is the cunning one. Up to 7 components, one (and only one) of which
# can be empty. We use 0 to cause a failure when we've already matched
# an empty component and may be hitting other. This has to fail, because we
# know we've just failed to match a component. We also do a final check to
# ensure that there has been an empty component.

$a6_2 = qr/^(?: (?: $c6 | (?(1)0 | () ) ) : ){1,7}$c6 $ (?(1)|.)/x;

if ($host !~ /$a4 | $a6_0 | $a6_1 | $a6_2/x)
  {
  print "** Invalid IP address \"$host\"\n";
  print "Usage: exim_checkaccess <IP address> <email address> [exim options]\n";
  exit(1);
  }

# Build any remaining original arguments into a string for passing over
# as Exim options.

$opt = "";
for ($i = 3; $i < scalar(@ARGV); $i++) { $opt .= "$ARGV[$i] "; }

# If the string contains "-f xxxx", extract that as the sender. Otherwise
# the sender is <>.

$sender    = "";
if ($opt =~ /(?:^|\s)-f\s+(\S+|"[^"]*")/)
  {
  $sender = $1;
  $opt = $` . $';
  }

# Run a -bh test in Exim, passing the test data

$pid = open2(*IN, *OUT, "$exim_path -bh $host $opt 2>/dev/null");
print OUT "HELO [$host]\r\n";
print OUT "MAIL FROM:<$sender>\r\n";
print OUT "RCPT TO:<$recipient>\r\n";
print OUT "QUIT\r\n";
close OUT;

# Read the output, ignoring anything but the SMTP response to the RCPT
# command.

$count = 0;
$reply = "";

while (<IN>)
  {
  next if !/^\d\d\d/;
  $reply .= $_;
  next if /^\d\d\d\-/;

  if (++$count != 4)
    {
    $reply = "";
    next;
    }

  # We have the response we want. Interpret it.

  if ($reply =~ /^2\d\d/)
    {
    print "Accepted\n";
    }
  else
    {
    print "Rejected:\n";
    $reply =~ s/\n(.)/\n  $1/g;
    print "  $reply";
    }
  last;
  }

# Reap the child process

waitpid $pid, 0;

End

Youez - 2016 - github.com/yon3zu
LinuXploit