carbonblack / cbapi-python

Carbon Black API - Python language bindings
Other
147 stars 86 forks source link

[BUG] #218

Closed garyjblackwell closed 4 years ago

garyjblackwell commented 4 years ago

I am seeing this behaviour on: (please complete the following information):

Describe the bug When I run get_reg_autoruns.py, it says:

_File "get_reg_autoruns.py", line 26, in from cbapi.event import onevent, registry File "C:\Python\lib\site-packages\cbapi\event.py", line 4, in import Queue ModuleNotFoundError: No module named 'Queue'

Steps to Reproduce Steps to reproduce the behavior (Provide a log message if relevant):

  1. Go to folder where get_reg_autoruns.py is in a command line.
  2. Run python get_reg_autoruns.py.

Expected behavior A list of registry entries and values as indicated in the script.

Screenshots If applicable, add screenshots or code to help explain your problem. image

NomDuProfil commented 4 years ago

Hi @garyjblackwell,

Did you try to change import Queue by import queue ?

I think the import Queue is for python2 not python3.

Could be a quickfix.

Thanks,

garyjblackwell commented 4 years ago

Yes, I changed the capital Q to a lower case q. it gets me a little further, but it is still not working. I'm getting TypeError: Descriptors should not be created directly, but only retrieved from their parent.

avanbrunt-cb commented 4 years ago

@garyjblackwell You'll have to provide more error details if you want to reopen the issue

garyjblackwell commented 4 years ago

Does this help? (base) C:\Users\GaryBlackwell\Documents\cbapi-python\examples\response\event>python get_reg_autoruns.py Traceback (most recent call last): File "get_reg_autoruns.py", line 29, in from cbapi.response import sensor_events, event File "C:\Users\GaryBlackwell\anaconda3\lib\site-packages\cbapi\response\sensor_events.py", line 36, in type=None), File "C:\Users\GaryBlackwell\anaconda3\lib\site-packages\google\protobuf\descriptor.py", line 717, in new _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors should not be created directly, but only retrieved from their parent.

avanbrunt-cb commented 4 years ago

This script likely only supports python2 as it was written quite awhile ago. We don't currently plan on updating the script for python3

garyjblackwell commented 4 years ago

Understood, thanks