mirror of https://github.com/CIRCL/lookyloo
new: Global proxy setting.
Overwrites any proxy given by the user. Still uses the tor proxy when needed. Related: https://github.com/Lookyloo/lookyloo/issues/318pull/719/head
parent
97a668aa91
commit
0505edff0e
|
@ -33,6 +33,12 @@
|
||||||
"tor_proxy": {
|
"tor_proxy": {
|
||||||
"server": "socks5://127.0.0.1:9050"
|
"server": "socks5://127.0.0.1:9050"
|
||||||
},
|
},
|
||||||
|
"global_proxy": {
|
||||||
|
"enable": false,
|
||||||
|
"server": "",
|
||||||
|
"username": "",
|
||||||
|
"password": ""
|
||||||
|
},
|
||||||
"email": {
|
"email": {
|
||||||
"from": "Lookyloo <lookyloo@myorg.local>",
|
"from": "Lookyloo <lookyloo@myorg.local>",
|
||||||
"to": "Investigation Team <investigation_unit@myorg.local>",
|
"to": "Investigation Team <investigation_unit@myorg.local>",
|
||||||
|
@ -79,7 +85,8 @@
|
||||||
"enable_mail_notification": "Allow users to notify a pre-configured email address about a specific capture",
|
"enable_mail_notification": "Allow users to notify a pre-configured email address about a specific capture",
|
||||||
"remote_lacus": "By default, lookyloo will do the capture locally. Enabling this feature means you have a dedicated Lacus instance somewhere",
|
"remote_lacus": "By default, lookyloo will do the capture locally. Enabling this feature means you have a dedicated Lacus instance somewhere",
|
||||||
"monitoring": "Enable connection to a remote monitoring instance",
|
"monitoring": "Enable connection to a remote monitoring instance",
|
||||||
"tor_proxy": "URL to connect to a SOCKS 5 proxy for tor",
|
"tor_proxy": "URL to connect to a SOCKS 5 proxy for tor - If you capture via a lacus instance, this value is ignored",
|
||||||
|
"global_proxy": "Proxy configuration to use for *all* the requests (except .onions) - If you capture via a lacus instance, this value is ignored",
|
||||||
"email": "Configuration for sending email notifications.",
|
"email": "Configuration for sending email notifications.",
|
||||||
"priority": "Define the priority of a new capture. A capture from the web interface has priority over a capture from the API, same for authenticated user vs. anonymous.",
|
"priority": "Define the priority of a new capture. A capture from the web interface has priority over a capture from the API, same for authenticated user vs. anonymous.",
|
||||||
"hide_captures_with_error": "Capturing an URL may result in an error (domain non-existent, HTTP error, ...). They may be useful to see, but if you have a public instance, they will clutter the index.",
|
"hide_captures_with_error": "Capturing an URL may result in an error (domain non-existent, HTTP error, ...). They may be useful to see, but if you have a public instance, they will clutter the index.",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
import copy
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import operator
|
import operator
|
||||||
|
@ -77,6 +78,12 @@ class Lookyloo():
|
||||||
self.is_public_instance = get_config('generic', 'public_instance')
|
self.is_public_instance = get_config('generic', 'public_instance')
|
||||||
self.public_domain = get_config('generic', 'public_domain')
|
self.public_domain = get_config('generic', 'public_domain')
|
||||||
|
|
||||||
|
self.global_proxy = {}
|
||||||
|
if global_proxy := get_config('generic', 'global_proxy'):
|
||||||
|
if global_proxy.get('enable'):
|
||||||
|
self.global_proxy = copy.copy(global_proxy)
|
||||||
|
self.global_proxy.pop('enable')
|
||||||
|
|
||||||
self.securitytxt = PySecurityTXT(useragent=get_useragent_for_requests())
|
self.securitytxt = PySecurityTXT(useragent=get_useragent_for_requests())
|
||||||
|
|
||||||
self.taxonomies = get_taxonomies()
|
self.taxonomies = get_taxonomies()
|
||||||
|
@ -598,7 +605,7 @@ class Lookyloo():
|
||||||
browser=query.get('browser', None),
|
browser=query.get('browser', None),
|
||||||
device_name=query.get('device_name', None),
|
device_name=query.get('device_name', None),
|
||||||
user_agent=query.get('user_agent', None),
|
user_agent=query.get('user_agent', None),
|
||||||
proxy=query.get('proxy', None),
|
proxy=self.global_proxy if self.global_proxy else query.get('proxy', None),
|
||||||
general_timeout_in_sec=query.get('general_timeout_in_sec', None),
|
general_timeout_in_sec=query.get('general_timeout_in_sec', None),
|
||||||
cookies=query.get('cookies', None),
|
cookies=query.get('cookies', None),
|
||||||
headers=query.get('headers', None),
|
headers=query.get('headers', None),
|
||||||
|
|
|
@ -967,7 +967,8 @@ def _prepare_capture_template(user_ua: Optional[str], predefined_url: Optional[s
|
||||||
personal_ua=user_ua,
|
personal_ua=user_ua,
|
||||||
default_public=get_config('generic', 'default_public'),
|
default_public=get_config('generic', 'default_public'),
|
||||||
devices=lookyloo.get_playwright_devices(),
|
devices=lookyloo.get_playwright_devices(),
|
||||||
predefined_url_to_capture=predefined_url if predefined_url else '')
|
predefined_url_to_capture=predefined_url if predefined_url else '',
|
||||||
|
has_global_proxy=True if lookyloo.global_proxy else False)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/recapture/<string:tree_uuid>', methods=['GET'])
|
@app.route('/recapture/<string:tree_uuid>', methods=['GET'])
|
||||||
|
|
|
@ -297,12 +297,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if not has_global_proxy %}
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="proxy" class="col-sm-2 col-form-label">Proxy:</label>
|
<label for="proxy" class="col-sm-2 col-form-label">Proxy:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<input type="text" class="form-control" name="proxy" id="proxy" placeholder="Expected format: [scheme]://[username]:[password]@[hostname]:[port]">
|
<input type="text" class="form-control" name="proxy" id="proxy" placeholder="Expected format: [scheme]://[username]:[password]@[hostname]:[port]">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{%endif%}
|
||||||
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<label for="httpauth" class="col-sm-2 col-form-label">HTTP Authentication</label>
|
<label for="httpauth" class="col-sm-2 col-form-label">HTTP Authentication</label>
|
||||||
|
|
Loading…
Reference in New Issue