How to Check if a URL is a High-Risk or Server Administration Path in Python

Cloudmersive
2 min readMay 5, 2021

--

URLs are our gateway to provide and access information across the web, so it’s important to ensure that they’re protected from all angles. One type of risk that can be hard to detect is if your URL is a server administration path; if it is, there’s a good chance it’s at risk to remote access attacks. Instead of performing several tests to determine the nature of your path, you can use the following API to check the input URL in Python to identify if the vulnerability is present.

Let’s begin the API process by running this command to install the Python SDK:

pip install cloudmersive-validate-api-client

Next, we can call the validation function with the following code:

from __future__ import print_function
import time
import cloudmersive_validate_api_client
from cloudmersive_validate_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_validate_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_validate_api_client.DomainApi(cloudmersive_validate_api_client.ApiClient(configuration))
value = 'value_example' # str | URL or relative path to check, e.g. \"/admin/login\". The input is a string so be sure to enclose it in double-quotes.
try:
# Check if path is a high-risk server administration path
api_response = api_instance.domain_is_admin_path(value)
pprint(api_response)
except ApiException as e:
print("Exception when calling DomainApi->domain_is_admin_path: %s\n" % e)

The result will inform you if your URL has been identified as a server administration path. If you need to obtain API key, you can do so by registering for a free account on the Cloudmersive website; this provides access to 800 calls/month across our library of APIs.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet