Skip to content

Commit ad442e9

Browse files
Merge pull request #1432 from TheHive-Project/lookyloo-improvements-2
Lookyloo - support for categories
2 parents fb8cbfe + 73b0eb0 commit ad442e9

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

analyzers/Lookyloo/Lookyloo.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@
3232
"multi": false,
3333
"required": false,
3434
"defaultValue": false
35+
},
36+
{
37+
"name": "api_key",
38+
"description": "Lookyloo API key. Required for setting categories on captures.",
39+
"type": "string",
40+
"multi": false,
41+
"required": false
42+
},
43+
{
44+
"name": "categories",
45+
"description": "Categories to tag captures with. Requires an API key.",
46+
"type": "string",
47+
"multi": true,
48+
"required": false
3549
}
3650
],
3751
"registration_required": false,

analyzers/Lookyloo/lookyloo.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,21 @@ def __init__(self):
1717
self.lookyloo_instance = self.get_param("config.Lookyloo_instance", "https://lookyloo.circl.lu/") # By default, it will query the public instance of Lookyloo
1818
self.timeout = self.get_param("config.Capture_timeout", 120) # Default timeout set at 120s
1919
self.listing = self.get_param("config.Capture_listing", False) # If True, capture will appear on Lookyloo's public index page
20+
self.api_key = self.get_param("config.api_key", None)
21+
self.categories = self.get_param("config.categories", None)
2022

2123
# The proxy will be automatically setup by Cortex
2224
self.lookyloo = LK(self.lookyloo_instance)
2325

2426
if not self.lookyloo.is_up: # to make sure it is up and reachable
2527
self.error("Lookyloo is not reachable or not up. Exit")
2628

29+
if self.categories and not self.api_key:
30+
self.error("Categories require an API key. Please set the api_key configuration.")
31+
32+
if self.api_key:
33+
self.lookyloo.init_apikey(apikey=self.api_key)
34+
2735
def summary(self, raw):
2836
taxonomies = []
2937
level = "info" # Put the report in blue
@@ -91,7 +99,7 @@ def submit(self, site):
9199
print("Submitting the url " + site + " to Lookyloo")
92100
# parameter listing: If False, the capture will be not be on the publicly accessible index page of lookyloo
93101
# parameter quiet: Returns the UUID only, instead of the whole URL
94-
return self.lookyloo.submit(url=site, listing=self.listing, quiet=True)
102+
return self.lookyloo.submit(url=site, listing=self.listing, categories=self.categories, quiet=True)
95103

96104
# Query Lookyloo each seconds to get status. If status is 1 (capture OK), then return.
97105
# If timeout of 120s is exceeded, return the status code

0 commit comments

Comments
 (0)