Advertisement
Guest User

Untitled

a guest
Apr 1st, 2024
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1.  
  2. public string IsItMalware()
  3. {
  4. Logger.AddToActivityLog("Checking if " + _website + " is listed as hosting malware by Google...");
  5.  
  6. string JSON = @"
  7. {
  8. 'client': {
  9. 'clientId': 'Max Results SEO - Outbound Link Checker',
  10. 'clientVersion': '0.1'
  11. },
  12. 'threatInfo': {
  13. 'threatTypes': ['MALWARE', 'SOCIAL_ENGINEERING', 'UNWANTED_SOFTWARE', 'POTENTIALLY_HARMFUL_APPLICATION'],
  14. 'platformTypes': ['WINDOWS'],
  15. 'threatEntryTypes': ['URL'],
  16. 'threatEntries': [
  17. {'url': '" + _website + @"'}
  18. ]
  19. }
  20. }";
  21.  
  22. string result = "";
  23.  
  24. try
  25. {
  26. using (var client = new WebClient())
  27. {
  28. client.Headers[HttpRequestHeader.ContentType] = "application/json";
  29. result = client.UploadString("https://safebrowsing.googleapis.com/v4/threatMatches:find?key=????????????", "POST", JSON);
  30. }
  31. }
  32. catch
  33. {
  34. return "Unknown";
  35. }
  36.  
  37. if (result.Contains("threatEntryType")) return "Yes";
  38. if (result.Contains("matches")) return "Yes";
  39. if (result.Contains("threat")) return "Yes";
  40.  
  41. return "No";
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement