mirror of https://github.com/CIRCL/lookyloo
parent
4f07b1253e
commit
95f05a3da1
|
@ -263,6 +263,16 @@ class Lookyloo():
|
||||||
json.dump(meta, f)
|
json.dump(meta, f)
|
||||||
return meta
|
return meta
|
||||||
|
|
||||||
|
def get_capture_settings(self, capture_uuid: str, /) -> CaptureSettings:
|
||||||
|
cache = self.capture_cache(capture_uuid)
|
||||||
|
if not cache:
|
||||||
|
return {}
|
||||||
|
cs_file = cache.capture_dir / 'capture_settings.json'
|
||||||
|
if cs_file.exists():
|
||||||
|
with cs_file.open('r') as f:
|
||||||
|
return json.load(f)
|
||||||
|
return {}
|
||||||
|
|
||||||
def categories_capture(self, capture_uuid: str, /) -> Dict[str, Any]:
|
def categories_capture(self, capture_uuid: str, /) -> Dict[str, Any]:
|
||||||
'''Get all the categories related to a capture, in MISP Taxonomies format'''
|
'''Get all the categories related to a capture, in MISP Taxonomies format'''
|
||||||
categ_file = self._captures_index[capture_uuid].capture_dir / 'categories'
|
categ_file = self._captures_index[capture_uuid].capture_dir / 'categories'
|
||||||
|
|
|
@ -727,6 +727,7 @@ def tree(tree_uuid: str, node_uuid: Optional[str]=None):
|
||||||
b64_thumbnail = lookyloo.get_screenshot_thumbnail(tree_uuid, for_datauri=True)
|
b64_thumbnail = lookyloo.get_screenshot_thumbnail(tree_uuid, for_datauri=True)
|
||||||
screenshot_size = lookyloo.get_screenshot(tree_uuid).getbuffer().nbytes
|
screenshot_size = lookyloo.get_screenshot(tree_uuid).getbuffer().nbytes
|
||||||
meta = lookyloo.get_meta(tree_uuid)
|
meta = lookyloo.get_meta(tree_uuid)
|
||||||
|
capture_settings = lookyloo.get_capture_settings(tree_uuid)
|
||||||
hostnode_to_highlight = None
|
hostnode_to_highlight = None
|
||||||
if node_uuid:
|
if node_uuid:
|
||||||
try:
|
try:
|
||||||
|
@ -770,7 +771,8 @@ def tree(tree_uuid: str, node_uuid: Optional[str]=None):
|
||||||
auto_trigger_modules=auto_trigger_modules,
|
auto_trigger_modules=auto_trigger_modules,
|
||||||
confirm_message=confirm_message if confirm_message else 'Tick to confirm.',
|
confirm_message=confirm_message if confirm_message else 'Tick to confirm.',
|
||||||
parent_uuid=cache.parent,
|
parent_uuid=cache.parent,
|
||||||
has_redirects=True if cache.redirects else False)
|
has_redirects=True if cache.redirects else False,
|
||||||
|
capture_settings=capture_settings)
|
||||||
|
|
||||||
except NoValidHarFile:
|
except NoValidHarFile:
|
||||||
flash(f'Unable to build a tree for {tree_uuid}: {cache.error}.', 'warning')
|
flash(f'Unable to build a tree for {tree_uuid}: {cache.error}.', 'warning')
|
||||||
|
|
|
@ -455,13 +455,18 @@
|
||||||
<dd class="col-sm-10">{{ info.referer }}</dd>
|
<dd class="col-sm-10">{{ info.referer }}</dd>
|
||||||
{%endif%}
|
{%endif%}
|
||||||
|
|
||||||
|
|
||||||
{% if meta %}
|
{% if meta %}
|
||||||
{% for k, v in meta.items() if k not in ['user_agent'] %}
|
{% for k, v in meta.items() if k not in ['user_agent'] %}
|
||||||
<dt class="col-sm-2">{{k.title()}}</dt>
|
<dt class="col-sm-2">{{k.title()}}</dt>
|
||||||
<dd class="col-sm-10">{{ v }}</dd>
|
<dd class="col-sm-10">{{ v }}</dd>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{%endif%}
|
{%endif%}
|
||||||
|
{% if capture_settings %}
|
||||||
|
{% for k, v in capture_settings.items() if v and k in ['proxy']%}
|
||||||
|
<dt class="col-sm-2">{{k.title()}}</dt>
|
||||||
|
<dd class="col-sm-10">{{ v }}</dd>
|
||||||
|
{% endfor %}
|
||||||
|
{%endif%}
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||||
|
|
Loading…
Reference in New Issue