Get The Virustotal report for the given domain. :param domain: The name of the domain to search. :return: The JSON response or None if not found.
(self, domain)
| 75 | self.APIKEY = self.PUBLIC_APIKEY |
| 76 | |
| 77 | def get_domain_report(self, domain): |
| 78 | """ |
| 79 | Get The Virustotal report for the given domain. |
| 80 | |
| 81 | :param domain: The name of the domain to search. |
| 82 | :return: The JSON response or None if not found. |
| 83 | """ |
| 84 | req = requests.get( |
| 85 | ( |
| 86 | self.URL |
| 87 | + "domain/report" |
| 88 | + "?apikey=" |
| 89 | + self.APIKEY |
| 90 | + "&domain=" |
| 91 | + domain |
| 92 | ), |
| 93 | timeout=120, |
| 94 | ) |
| 95 | if req.status_code != 200: |
| 96 | self._logger.error("Error: " + str(req.status_code)) |
| 97 | return None |
| 98 | try: |
| 99 | res = json.loads(req.text) |
| 100 | except: |
| 101 | return None |
| 102 | |
| 103 | return res |