Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string IsItMalware()
- {
- Logger.AddToActivityLog("Checking if " + _website + " is listed as hosting malware by Google...");
- string JSON = @"
- {
- 'client': {
- 'clientId': 'Max Results SEO - Outbound Link Checker',
- 'clientVersion': '0.1'
- },
- 'threatInfo': {
- 'threatTypes': ['MALWARE', 'SOCIAL_ENGINEERING', 'UNWANTED_SOFTWARE', 'POTENTIALLY_HARMFUL_APPLICATION'],
- 'platformTypes': ['WINDOWS'],
- 'threatEntryTypes': ['URL'],
- 'threatEntries': [
- {'url': '" + _website + @"'}
- ]
- }
- }";
- string result = "";
- try
- {
- using (var client = new WebClient())
- {
- client.Headers[HttpRequestHeader.ContentType] = "application/json";
- result = client.UploadString("https://safebrowsing.googleapis.com/v4/threatMatches:find?key=????????????", "POST", JSON);
- }
- }
- catch
- {
- return "Unknown";
- }
- if (result.Contains("threatEntryType")) return "Yes";
- if (result.Contains("matches")) return "Yes";
- if (result.Contains("threat")) return "Yes";
- return "No";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement