How to Check a URL for SSRF Threats using JavaScript

var data = JSON.stringify({
"URL": "<string>",
"BlockedDomains": [
"<string>",
"<string>"
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.cloudmersive.com/security/threat-detection/network/url/ssrf/detect");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Apikey", "YOUR-API-KEY-HERE");
xhr.send(data);
bower install jquery
var settings = {
"url": "https://api.cloudmersive.com/security/threat-detection/network/url/ssrf/detect",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"Apikey": "YOUR-API-KEY-HERE"
},
"data": JSON.stringify({
"URL": "<string>",
"BlockedDomains": [
"<string>",
"<string>"
]
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

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