Check if a URL is a High-Risk Path in C#

Cloudmersive
2 min readMay 18, 2021

--

Due to an inherent vulnerability in their design, server administration paths are consistently being targeted by attackers. Similar to SSRF and SQL injection attacks, these attempts to obtain information occur by exploiting an already present vulnerability to execute commands and access restricted files. However, in this brief tutorial we will provide a quick and easy way to identify a server administration path from an input URL or path by using an API in C#.

To begin, we will run this command to install the .NET Framework SDK:

Install-Package Cloudmersive.APIClient.NET.Validate -Version 3.2.0

After the installation, we can call the function with the following code:

using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.Validate.Api;
using Cloudmersive.APIClient.NET.Validate.Client;
using Cloudmersive.APIClient.NET.Validate.Model;
namespace Example
{
public class DomainIsAdminPathExample
{
public void main()
{
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new DomainApi();
var value = 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.
try
{
// Check if path is a high-risk or vulnerable server administration path
IsAdminPathResponse result = apiInstance.DomainIsAdminPath(value);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling DomainApi.DomainIsAdminPath: " + e.Message );
}
}
}
}

Your result will be ready in no time, allowing you to immediately determine if you have a vulnerability to address.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

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

No responses yet