Skip to content

Commit fcd3ee3

Browse files
authored
Merge pull request #674 from yeti-platform/1.8.0
1.8.0
2 parents d5b43bc + e0b37d2 commit fcd3ee3

11 files changed

+66
-317
lines changed

Diff for: plugins/feeds/public/ViruSign.py

-69
This file was deleted.

Diff for: plugins/feeds/public/abuseipdb.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from configparser import Error
12
import logging
23
from datetime import timedelta
34

@@ -18,16 +19,16 @@ class AbuseIPDB(Feed):
1819
def update(self):
1920
api_key = yeti_config.get("abuseIPDB", "key")
2021

21-
if api_key:
22-
self.source = (
23-
"https://api.abuseipdb.com/api/v2/blacklist?&key=%s&plaintext&limit=10000"
24-
% (api_key)
25-
)
26-
# change the limit rate if you subscribe to a paid plan
27-
for line in self.update_lines():
28-
self.analyze(line)
29-
else:
30-
logging.error("Your abuseIPDB API key is not set in the yeti.conf file")
22+
if not api_key:
23+
raise Exception("Your abuseIPDB API key is not set in the yeti.conf file")
24+
25+
self.source = (
26+
"https://api.abuseipdb.com/api/v2/blacklist?&key=%s&plaintext&limit=10000"
27+
% (api_key)
28+
)
29+
# change the limit rate if you subscribe to a paid plan
30+
for line in self.update_lines():
31+
self.analyze(line)
3132

3233
def analyze(self, line):
3334
line = line.strip()

Diff for: plugins/feeds/public/feodo_tracker_ip_blocklist.py

+22-13
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from core.errors import ObservableValidationError
55
from core.feed import Feed
6-
from core.observables import Url
6+
from core.observables import Ip
77

88

99
class FeodoTrackerIPBlockList(Feed):
@@ -15,34 +15,43 @@ class FeodoTrackerIPBlockList(Feed):
1515
}
1616

1717
def update(self):
18-
18+
firs_line = 0
1919
for index, line in self.update_csv(
2020
delimiter=",",
21-
filter_row="Firstseen",
22-
names=["Firstseen", "DstIP", "DstPort", "LastOnline", "Malware"],
21+
filter_row="first_seen_utc",
22+
names=[
23+
"first_seen_utc",
24+
"dst_ip",
25+
"dst_port",
26+
"c2_status",
27+
"last_online",
28+
"malware",
29+
],
2330
):
24-
self.analyze(line)
31+
if firs_line != 0:
32+
self.analyze(line)
33+
firs_line += 1
2534

2635
# pylint: disable=arguments-differ
2736
def analyze(self, line):
2837

2938
tags = []
30-
tags.append(line["Malware"].lower())
39+
tags.append(line["malware"].lower())
3140
tags.append("c2")
3241
tags.append("blocklist")
3342

3443
context = {
35-
"first_seen": line["Firstseen"],
44+
"first_seen": line["first_seen_utc"],
3645
"source": self.name,
37-
"last_online": line["LastOnline"],
46+
"last_online": line["last_online"],
47+
"c2_status": line["c2_status"],
48+
"port": line["dst_port"],
3849
}
3950

4051
try:
41-
new_url = Url.get_or_create(
42-
value="http://{}:{}/".format(line["DstIP"], line["DstPort"])
43-
)
44-
new_url.add_context(context, dedup_list=["last_online"])
45-
new_url.tag(tags)
52+
ip_obs = Ip.get_or_create(value=line["dst_ip"])
53+
ip_obs.add_context(context, dedup_list=["last_online"])
54+
ip_obs.tag(tags)
4655

4756
except ObservableValidationError as e:
4857
logging.error("Invalid line: {}\nLine: {}".format(e, line))

Diff for: plugins/feeds/public/h3x_feeds.py

-56
This file was deleted.

Diff for: plugins/feeds/public/malware_domains_dot_com.py

-60
This file was deleted.

Diff for: plugins/feeds/public/obtemoslab_urls.py

-31
This file was deleted.

Diff for: plugins/feeds/public/otx_alienvault.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def update(self):
3636

3737
number_page = yeti_config.get("otx", "pages")
3838

39-
assert otx_key and number_page
39+
assert otx_key and number_page, "OTX key and pages not configured in yeti.conf"
4040

4141
headers = {"X-OTX-API-KEY": otx_key}
4242

Diff for: plugins/feeds/public/proxyrss.py

-50
This file was deleted.

0 commit comments

Comments
 (0)