viper-framework / viper-modules

BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

MISP modules issues #7

Closed adulau closed 4 years ago

adulau commented 4 years ago

It seems that the MISP modules is still using the old function calls from PyMISP.

Such as:

adulau@dobbertin:~/.viper/modules$ git diff
diff --git a/misp.py b/misp.py
index 02b26cd..b841cdb 100644
--- a/misp.py
+++ b/misp.py
@@ -504,7 +504,7 @@ class MISP(Module):
             return
         open_session = len(self.args.event) == 1
         for e in self.args.event:
-            event = self.misp.get(e)
+            event = self.misp.get_events(e)
             if not self._has_error_message(event):
                 self._search_local_hashes(event, open_session)
                 self._dump()
diff --git a/misp_methods/check_hashes.py b/misp_methods/check_hashes.py
index 98ad179..16cd27a 100644
--- a/misp_methods/check_hashes.py
+++ b/misp_methods/check_hashes.py
@@ -34,7 +34,7 @@ def _populate(self, event):
         event_id = self._get_eventid()
         if event_id is None:
             return
-        event = self.misp.get(event_id)
+        event = self.misp.get_event(event_id)
         if self._has_error_message(event):
             return
         __sessions__.new(misp_event=MispEvent(event, self.offline_mode))
@@ -83,7 +83,7 @@ def check_hashes(self):
     event_id = self._get_eventid()
     if event_id is None:
         return
-    misp_event = self.misp.get(event_id)
+    misp_event = self.misp.get_event(event_id)
     if self._has_error_message(misp_event):
         return

There are also other issues related to the object

viper > misp check_hashes -p 73155
[!] The command misp raised an exception:
Traceback (most recent call last):
  File "/home/adulau/.local/lib/python3.6/site-packages/viper/core/ui/console.py", line 322, in start
    module.run()
  File "/home/adulau/.viper/modules/misp.py", line 642, in run
    self.check_hashes()
  File "/home/adulau/.viper/modules/misp_methods/check_hashes.py", line 94, in check_hashes
    for o in misp_event.Object:
AttributeError: 'dict' object has no attribute 'Object'
viper > quit

@Rafiot could you have a look? Thanks a lot.

Rafiot commented 4 years ago

(I cannot assign it to myself, but consider it assigned to me)