Skip to content

Commit

Permalink
corrected for change to fortiguard portal
Browse files Browse the repository at this point in the history
Scraping is unreliable at times, especially when the vendor changes the URL parameters... ¯\_(ツ)_/¯

Was only able to test this locally due to my dev environment being affected by TheHive-Project/Cortex#27 , but it appears to be functional once again. Let me know if there are any other issues with it, I promise to take less than 27 days to fix it :)
  • Loading branch information
ecapuano authored May 21, 2017
1 parent 3300c90 commit 0bdc4f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions analyzers/Fortiguard/urlcategory.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ def run(self):
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({
Expand Down

0 comments on commit 0bdc4f6

Please sign in to comment.