Skip to content

Commit

Permalink
Fix the way results are returned so they are handled properly when saved
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaferrera committed Feb 23, 2018
1 parent a6d9a40 commit 7ea8b07
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions worker/trid/trid/trid.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def scan(self, payload, **kwargs):
:param **kwargs kwargs: Additional parameters (unused)
:returns: Results from scan
:rtype: dict or None
:rtype: list or None
"""

Expand Down Expand Up @@ -110,6 +110,6 @@ def scan(self, payload, **kwargs):
self.log.warn("Unable to delete temp file {}".format(path))

if results:
return results
return [results]
else:
return None
3 changes: 3 additions & 0 deletions worker/trid/trid/trid.stoq
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Website = https://github.com/PUNCH-Cyber/stoq-plugins-public
Description = Identify file types from their TrID signature

[options]
# Minimum version of stoQ required to work
min_stoq_version = 0.18.0

hashpayload = True
saveresults = True
bin = /usr/local/bin/trid
Expand Down
6 changes: 3 additions & 3 deletions worker/xorsearch/xorsearch/xorsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def scan(self, payload, **kwargs):
:param **kwargs kwargs: Additional parameters (unused)
:returns: Results from scan
:rtype: dict or None
:rtype: list or None
"""

Expand Down Expand Up @@ -96,7 +96,7 @@ def scan(self, payload, **kwargs):

# Time to cleanup if we wrote a temp file to disk
try:
if os.isfile(path):
if os.path.isfile(path):
os.remove(path)
except:
pass
Expand All @@ -105,6 +105,6 @@ def scan(self, payload, **kwargs):

# Return our results
if results:
return results
return [results]
else:
return None
3 changes: 3 additions & 0 deletions worker/xorsearch/xorsearch/xorsearch.stoq
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Website = https://github.com/PUNCH-Cyber/stoq-plugins-public
Description = Search a payload for XOR'd strings

[options]
# Minimum version of stoQ required to work
min_stoq_version = 0.18.0

hashpayload = True
saveresults = True
bin = /usr/local/bin/xorsearch
Expand Down

0 comments on commit 7ea8b07

Please sign in to comment.