Skip to content

Commit

Permalink
refactor: change wording when hash has low score
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo23x0 committed Apr 25, 2023
1 parent 9dbe018 commit e6e038d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/lokilogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import socket
from .helpers import removeNonAsciiDrop

__version__ = '0.46.0'
__version__ = '0.46.1'


# Logger Class -----------------------------------------------------------------
Expand Down
9 changes: 7 additions & 2 deletions loki.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ def scan_path(self, path):

# Malware Hash
matchScore = 100
matchLevel = "Malware"
if ioc_contains(self.hashes_md5_list, md5_num):
matchType = "MD5"
matchDesc = self.hashes_md5[md5_num]
Expand All @@ -407,12 +408,16 @@ def scan_path(self, path):
matchHash = sha256
matchScore = self.hashes_scores[sha256_num]

# If score is low change the description
if matchScore < 80:
matchLevel = "Suspicious"

# Hash string
hashString = "MD5: %s SHA1: %s SHA256: %s" % ( md5, sha1, sha256 )

if matchType:
reasons.append("Malware Hash TYPE: %s HASH: %s SUBSCORE: %d DESC: %s" % (
matchType, matchHash, matchScore, matchDesc))
reasons.append("%s Hash TYPE: %s HASH: %s SUBSCORE: %d DESC: %s" % (
matchLevel, matchType, matchHash, matchScore, matchDesc))
total_score += matchScore

# Script Anomalies Check
Expand Down

0 comments on commit e6e038d

Please sign in to comment.