Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python < 2.7 crashes on version check #10

Closed
hybiepoo opened this issue Feb 17, 2017 · 2 comments
Closed

Python < 2.7 crashes on version check #10

hybiepoo opened this issue Feb 17, 2017 · 2 comments
Assignees
Labels
category:enhancement Issue is related to an existing feature to improve

Comments

@hybiepoo
Copy link

Cortexutils crashes on version check if python < 2.7

Request Type

Bug

Work Environment

Question Answer
OS version (server) RedHat 6.8
OS version (client) Seven
Cortex Analyzer Name cortexutils
Cortex Analyzer Version 1.0
Cortex Version 1.0.0, hash of the commit
Browser type & version N/A

Problem Description

When using Python 2.6.6, analysers crash with the following error:
"errorMessage": "Error: Invalid output\nTraceback (most recent call last):\n File "./virustotal.py", line 135, in \n VirusTotalAnalyzer().run()\n File "./virustotal.py", line 16, in init\n Analyzer.init(self)\n File "/usr/lib/python2.6/site-packages/cortexutils-1.0.0-py2.6.egg/cortexutils/analyzer.py", line 16, in init\n self.setEncoding()\n File "/usr/lib/python2.6/site-packages/cortexutils-1.0.0-py2.6.egg/cortexutils/analyzer.py", line 38, in setEncoding\n if sys.version_info.major == 3:\nAttributeError: 'tuple' object has no attribute 'major'\n"

Steps to Reproduce

  1. Install/configure thehive
  2. Install/configure cortex
  3. Connect thehive to MISP
  4. Run analyzers against an observable

Possible Solutions

In cortexutils/analyzer.py lines 38 and 44
Replace:
if sys.version_info.major == 3:

with
if sys.version_info[0] == 3:

@nadouani nadouani self-assigned this Feb 17, 2017
@nadouani nadouani added the category:enhancement Issue is related to an existing feature to improve label Feb 17, 2017
@nadouani
Copy link
Contributor

Hi @hybiepoo, thanks for this catch. We can fix that in cortexutils in fat, but I don't know if all the dependencies used by the analyzers will work with a python version < 2.7.

Did you update cortexutils locally to fix this version check? Did you try the analyzers with a Python < 2.7?

@hybiepoo
Copy link
Author

hybiepoo commented Feb 17, 2017 via email

@nadouani nadouani added this to the cortexutils-1.0.1 milestone Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:enhancement Issue is related to an existing feature to improve
Projects
None yet
Development

No branches or pull requests

2 participants