How to Detect if a URL is a High-Risk Server Administration Path in Ruby

Cloudmersive
2 min readMay 17, 2021

--

Cyber attackers are always looking for new ways to target websites, companies, and users, so it should come as no surprise that it may require multiple levels of security to guard against the various forms of attack. The following API can be used in Ruby to determine if a URL or relative path is a server administration path that could be putting your website at risk to remote access.

First, we will need to add the Ruby client to our Gemfile:

gem 'cloudmersive-validate-api-client', '~> 2.1.6'

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

# load the gem
require 'cloudmersive-validate-api-client'
# setup authorization
CloudmersiveValidateApiClient.configure do |config|
# Configure API key authorization: Apikey
config.api_key['Apikey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Apikey'] = 'Bearer'
end
api_instance = CloudmersiveValidateApiClient::DomainApi.newvalue = 'value_example' # String | URL or relative path to check, e.g. \"/admin/login\". The input is a string so be sure to enclose it in double-quotes.begin
#Check if path is a high-risk or vulnerable server administration path
result = api_instance.domain_is_admin_path(value)
p result
rescue CloudmersiveValidateApiClient::ApiError => e
puts "Exception when calling DomainApi->domain_is_admin_path: #{e}"
end

If your input request is identified as a server admin path, it will be indicated in the returned result. To retrieve your API key, head over to the Cloudmersive website to register for a free account that will provide access to 800 monthly calls 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