Merge pull request #51 from ecapuano/patch-1

corrected for change to fortiguard portal
This commit is contained in:
Jerome Leonard 2017-05-22 14:12:38 +02:00 committed by GitHub
commit 42aa819349

View File

@ -18,9 +18,8 @@ class URLCategoryAnalyzer(Analyzer):
if self.data_type == 'domain' or self.data_type == 'url':
try:
pattern = re.compile("(?:Category: )([\w\s]+)")
baseurl = 'http://www.fortiguard.com/iprep?data='
tailurl = '&lookup=Lookup'
url = baseurl + self.getData() + tailurl
baseurl = 'http://www.fortiguard.com/webfilter?q='
url = baseurl + self.getData()
req = requests.get(url)
category_match = re.search(pattern, req.content, flags=0)
self.report({