Skip to content

Commit f96cb00

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents b399e96 + 3b3b1c4 commit f96cb00

File tree

14 files changed

+137
-101
lines changed

14 files changed

+137
-101
lines changed

.github/workflows/install-slips-dependencies.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ jobs:
3535
run: sysctl vm.overcommit_memory=1
3636

3737
- name: Install APT dependencies
38-
run: sudo apt-get update --fix-missing && sudo apt-get -y --no-install-recommends install $(cat install/apt_dependencies.txt)
38+
run: |
39+
sudo apt-get update --fix-missing && sudo apt-get -y --no-install-recommends install $(cat install/apt_dependencies.txt)
40+
sudo apt-get -y install font-manager
3941
4042
- name: Save APT Cache
4143
uses: actions/cache@v4

config/slips.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ threatintelligence:
239239
# 2 weeks = 604800 seconds
240240
mac_db_update : 1209600
241241

242-
mac_db : https://maclookup.app/downloads/json-database/get-db?t=22-08-19&h=d1d39c52de447a7e7194331f379e1e99f94f35f1
242+
mac_db : https://maclookup.app/downloads/json-database/get-db?t=24-11-28&h=26271dbc3529f006a4be021ec4cf99fab16e39cd
243243

244244
# the file that contains all our TI feeds URLs and their threat level
245245
ti_files : config/TI_feeds.csv

modules/flowalerts/set_evidence.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,8 +1351,6 @@ def malicious_ssl(self, twid, flow, ssl_info_from_db: str) -> None:
13511351
timewindow=TimeWindow(number=int(twid.replace("timewindow", ""))),
13521352
uid=[flow.uid],
13531353
timestamp=flow.starttime,
1354-
src_port=flow.sport,
1355-
dst_port=flow.dport,
13561354
)
13571355

13581356
self.db.set_evidence(evidence)
@@ -1373,8 +1371,6 @@ def malicious_ssl(self, twid, flow, ssl_info_from_db: str) -> None:
13731371
timewindow=TimeWindow(number=int(twid.replace("timewindow", ""))),
13741372
uid=[flow.uid],
13751373
timestamp=flow.starttime,
1376-
src_port=flow.sport,
1377-
dst_port=flow.dport,
13781374
)
13791375

13801376
self.db.set_evidence(evidence)

modules/flowalerts/ssl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def detect_malicious_ja3(self, twid, flow):
8282
self.set_evidence.malicious_ja3(twid, flow, malicious_ja3_dict)
8383

8484
if flow.ja3s in malicious_ja3_dict:
85-
self.set_evidence.malicious_ja3s(twid, flow)
85+
self.set_evidence.malicious_ja3s(twid, flow, malicious_ja3_dict)
8686

8787
def detect_incompatible_cn(self, profileid, twid, flow):
8888
"""

modules/http_analyzer/http_analyzer.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ def check_multiple_empty_connections(self, twid: str, flow):
196196
self.connections_counter[host] = ([], 0)
197197
return True
198198

199-
def set_evidence_incompatible_user_agent(self, twid, flow, user_agent):
199+
def set_evidence_incompatible_user_agent(
200+
self, twid, flow, user_agent, vendor
201+
):
200202

201203
os_type: str = user_agent.get("os_type", "").lower()
202204
os_name: str = user_agent.get("os_name", "").lower()
@@ -207,7 +209,7 @@ def set_evidence_incompatible_user_agent(self, twid, flow, user_agent):
207209
f"that belongs to OS: {os_name} "
208210
f"type: {os_type} browser: {browser}. "
209211
f"while connecting to {flow.host}{flow.uri}. "
210-
f"IP has MAC vendor: {flow.vendor.capitalize()}"
212+
f"IP has MAC vendor: {vendor.capitalize()}"
211213
)
212214

213215
evidence: Evidence = Evidence(
@@ -298,7 +300,9 @@ def check_incompatible_user_agent(self, profileid, twid, flow):
298300
browser = user_agent.get("browser", "").lower()
299301
# user_agent = user_agent.get('user_agent', '')
300302
if "safari" in browser and "apple" not in vendor:
301-
self.set_evidence_incompatible_user_agent(twid, flow, user_agent)
303+
self.set_evidence_incompatible_user_agent(
304+
twid, flow, user_agent, vendor
305+
)
302306
return True
303307

304308
# make sure all of them are lowercase
@@ -340,7 +344,7 @@ def check_incompatible_user_agent(self, profileid, twid, flow):
340344
# [('microsoft', 'windows', 'NT'), ('android'), ('linux')]
341345
# is found in the UA that belongs to an apple device
342346
self.set_evidence_incompatible_user_agent(
343-
twid, flow, user_agent
347+
twid, flow, user_agent, vendor
344348
)
345349
return True
346350

modules/ip_info/asn_info.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
class ASN:
1212
def __init__(self, db=None):
1313
self.db = db
14+
# update asn every 1 month
15+
self.update_period = 2592000
16+
1417
# Open the maxminddb ASN offline db
1518
try:
1619
self.asn_db = maxminddb.open_database(
@@ -51,7 +54,7 @@ def get_cached_asn(self, ip):
5154
asn_info["asn"].update({"number": range_info["number"]})
5255
return asn_info
5356

54-
def update_asn(self, cached_data, update_period) -> bool:
57+
def should_update_asn(self, cached_data) -> bool:
5558
"""
5659
Returns True if
5760
- no asn data is found in the db OR ip has no cached info
@@ -61,10 +64,10 @@ def update_asn(self, cached_data, update_period) -> bool:
6164
try:
6265
return (
6366
time.time() - cached_data["asn"]["timestamp"]
64-
) > update_period
67+
) > self.update_period
6568
except (KeyError, TypeError):
66-
# no there's no cached asn info,or no timestamp, or cached_data is None
67-
# we should update
69+
# no there's no cached asn info,or no timestamp, or
70+
# cached_data is None. we should update
6871
return True
6972

7073
def get_asn_info_from_geolite(self, ip) -> dict:

0 commit comments

Comments
 (0)