From 4f1bf5b09c969d66acbb3e92f21eea46909fe649 Mon Sep 17 00:00:00 2001 From: b068931cc450442b63f5b3d276ea4297 <77171083+b068931cc450442b63f5b3d276ea4297@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:29:59 +0100 Subject: [PATCH 1/4] change contact@spyguard.io to spyguard@protonmail.com --- analysis/locales/de.json | 2 +- analysis/locales/en.json | 2 +- analysis/locales/es.json | 2 +- analysis/locales/fr.json | 2 +- analysis/locales/it.json | 2 +- analysis/locales/pl.json | 2 +- analysis/locales/pt.json | 2 +- analysis/locales/ru.json | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/analysis/locales/de.json b/analysis/locales/de.json index 0d89ae3..de0ac27 100755 --- a/analysis/locales/de.json +++ b/analysis/locales/de.json @@ -134,7 +134,7 @@ "packets_number": "Anzahl der Pakete", "capture_sha1": "SHA1-Aufnahme", "report_for_the_capture": "Bericht zur Aufnahme", - "report_footer": "Dieser Bericht wurde von einem SpyGuard-Gerät automatisch erstellt. Wenn Sie Fragen haben, Bugs melden oder Feedback geben möchten, kontaktieren Sie uns unter contact@spyguard.io.", + "report_footer": "Dieser Bericht wurde von einem SpyGuard-Gerät automatisch erstellt. Wenn Sie Fragen haben, Bugs melden oder Feedback geben möchten, kontaktieren Sie uns unter spyguard@protonmail.com.", "high_msg": "Ihr Gerät scheint kompromittiert zu sein, da Sie {} Warnung(en) der Stufe \"Hoch\" haben.", "moderate_msg": "Sie haben {} Warnungen der Stufe \"Mittel\": Ihr Gerät könnte kompromittiert sein. Bitte sehen Sie sich die Warnungen sorgfältig an.", "low_msg": "Sie haben nur {} Warnungen der Stufe \"Niedrig\": Überprüfen Sie sie gerne.", diff --git a/analysis/locales/en.json b/analysis/locales/en.json index 942e7d7..8a6083a 100755 --- a/analysis/locales/en.json +++ b/analysis/locales/en.json @@ -134,7 +134,7 @@ "packets_number": "Number of packets", "capture_sha1": "Capture SHA1", "report_for_the_capture": "Report for the capture", - "report_footer": "This report has been autogenerated by a SpyGuard device. For any question, bug report or feedback, please contact contact@spyguard.io.", + "report_footer": "This report has been autogenerated by a SpyGuard device. For any question, bug report or feedback, please contact spyguard@protonmail.com.", "high_msg": "Your device seems to be compromised as you have {} high alert(s).", "moderate_msg": "You have {} moderate alert(s), your device might be compromised. Please look at them carefully.", "low_msg": "You have only {} low alert(s), don't hesitate to check them.", diff --git a/analysis/locales/es.json b/analysis/locales/es.json index a1d6ae5..0c53725 100755 --- a/analysis/locales/es.json +++ b/analysis/locales/es.json @@ -134,7 +134,7 @@ "packets_number": "Número de paquetes", "capture_sha1": "Captura SHA1", "report_for_the_capture": "Informe de la captura", - "report_footer": "Este informe ha sido autogenerado por un dispositivo SpyGuard. Para cualquier pregunta, informe de fallos o feedback por favor contacte con contact@spyguard.io.", + "report_footer": "Este informe ha sido autogenerado por un dispositivo SpyGuard. Para cualquier pregunta, informe de fallos o feedback por favor contacte con spyguard@protonmail.com.", "high_msg": "Su dispositivo parece estar comprometido ya que tiene {} alerta(s) de nivel alto.", "moderate_msg": "Tienes {} alerta(s) de nivel moderado, su dispositivo podría estar comprometido. Por favor revíselas detenidamente.", "low_msg": "Solamente tiene {} alertas(s) de nivel bajo, por favor revíselas.", diff --git a/analysis/locales/fr.json b/analysis/locales/fr.json index 9234956..b9550ff 100755 --- a/analysis/locales/fr.json +++ b/analysis/locales/fr.json @@ -134,7 +134,7 @@ "packets_number": "Nombre de paquets", "capture_sha1": "SHA1 de la capture", "report_for_the_capture": "Rapport pour la capture", - "report_footer": "Ce rapport a été automatiquement généré par une instance de SpyGuard. Pour toute question et retours, n'hésitez pas à contacter contact@spyguard.io.", + "report_footer": "Ce rapport a été automatiquement généré par une instance de SpyGuard. Pour toute question et retours, n'hésitez pas à contacter spyguard@protonmail.com.", "high_msg": "Votre appareil semble être compromis car vous avez {} alerte(s) élevée(s).", "moderate_msg": "Vous avez {} alerte(s) modérée(s), votre appareil peut être compromis. Regardez ces alertes en détail.", "low_msg": "Vous avez uniquement {} alerte(s) faibles, n'hésitez pas à les consulter.", diff --git a/analysis/locales/it.json b/analysis/locales/it.json index bd40bed..d31d1ee 100755 --- a/analysis/locales/it.json +++ b/analysis/locales/it.json @@ -134,7 +134,7 @@ "packets_number": "Numero di pacchetti", "capture_sha1": "SHA1 acquisizione", "report_for_the_capture": "Rapporto relativo all'acquisizione", - "report_footer": "Questo rapporto è stato generato automaticamente da un dispositivo SpyGuard. Per eventuali domande, segnalazioni di bug o feedback, contattare contact@spyguard.io.", + "report_footer": "Questo rapporto è stato generato automaticamente da un dispositivo SpyGuard. Per eventuali domande, segnalazioni di bug o feedback, contattare spyguard@protonmail.com.", "high_msg": "Sembra che il dispositivo sia compromesso poiché sono presenti {} avvisi con priorità elevata.", "moderate_msg": "Sono presenti {} avvisi con priorità moderata, è possibile che il dispositivo sia compromesso. Esaminarli con attenzione.", "low_msg": "Sono presenti solo {} avvisi con priorità bassa da controllare.", diff --git a/analysis/locales/pl.json b/analysis/locales/pl.json index faea607..9cdaf56 100755 --- a/analysis/locales/pl.json +++ b/analysis/locales/pl.json @@ -134,7 +134,7 @@ "packets_number": "Liczba pakietów", "capture_sha1": "SHA1 zapisu ruchu", "report_for_the_capture": "Raport dla badania", - "report_footer": "Raport został wygenerowany automatycznie przez urządzenie SpyGuard. W sprawie pytań, błędów oraz oceny, kontakt: contact@spyguard.io.", + "report_footer": "Raport został wygenerowany automatycznie przez urządzenie SpyGuard. W sprawie pytań, błędów oraz oceny, kontakt: spyguard@protonmail.com.", "high_msg": "Twoje urządzenie wygląd na skompromitowane, odnotowano {} wysokich ostrzeżeń.", "moderate_msg": "Odntowano {} umiarkowanych ostrzeżeń, Twoje urządzenie może być skompromitowane. Badź czujna(y) używając go.", "low_msg": "Odnotowano tylko niskie ostrzeżenia: {}. Możesz się im przyjrzeć.", diff --git a/analysis/locales/pt.json b/analysis/locales/pt.json index a60352a..0ff9a95 100755 --- a/analysis/locales/pt.json +++ b/analysis/locales/pt.json @@ -134,7 +134,7 @@ "packets_number": "Número de pacotes", "capture_sha1": "Captura SHA1", "report_for_the_capture": "Relatório da captura", - "report_footer": "Este relatório foi gerado automaticamente por um dispositivo SpyGuard. Em caso de dúvidas, relatório de erros ou comentários, envie uma mensagem para contact@spyguard.io.", + "report_footer": "Este relatório foi gerado automaticamente por um dispositivo SpyGuard. Em caso de dúvidas, relatório de erros ou comentários, envie uma mensagem para spyguard@protonmail.com.", "high_msg": "O dispositivo parece estar comprometido porque você tem {} alerta(s) crítico(s).", "moderate_msg": "Você tem {} alerta(s) moderado(s), seu dispositivo pode estar comprometido. Analise-os com cuidado.", "low_msg": "Você tem apenas {} alerta(s) leve(s), não deixe de verificá-los.", diff --git a/analysis/locales/ru.json b/analysis/locales/ru.json index e905806..46adf6c 100755 --- a/analysis/locales/ru.json +++ b/analysis/locales/ru.json @@ -134,7 +134,7 @@ "packets_number": "Количество пакетов", "capture_sha1": "Сбор данных SHA1", "report_for_the_capture": "Отчет для сбора данных", - "report_footer": "Этот отчет был автоматически сформирован устройством SpyGuard. С любыми вопросами, сообщениями об ошибках или отзывами обращайтесь по адресу contact@spyguard.io.", + "report_footer": "Этот отчет был автоматически сформирован устройством SpyGuard. С любыми вопросами, сообщениями об ошибках или отзывами обращайтесь по адресу spyguard@protonmail.com.", "high_msg": "Вероятно, ваше устройство взломано, поскольку у вас {} предупрежд. высокого уровня.", "moderate_msg": "У вас {} предупрежд. среднего уровня. Возможно, ваше устройство взломано. Внимательно изучите их.", "low_msg": "У вас {} предупрежд. низкого уровня, проверьте их.", From 65e7cfcd450de687f79b2cb2655268d3eb4c65b5 Mon Sep 17 00:00:00 2001 From: b068931cc450442b63f5b3d276ea4297 <77171083+b068931cc450442b63f5b3d276ea4297@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:11:25 +0100 Subject: [PATCH 2/4] install python3-venv if necessary --- install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index ca1eaff..036dd01 100644 --- a/install.sh +++ b/install.sh @@ -1,5 +1,4 @@ #!/bin/bash - CURRENT_USER="${SUDO_USER}" SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" HOST="$( hostname )" @@ -80,7 +79,6 @@ generate_certificate() { create_services() { # Create services to launch the two servers. - echo -e "\e[39m[+] Creating services\e[39m" echo -e "\e[92m [✔] Creating frontend service\e[39m" @@ -140,7 +138,6 @@ EOL systemctl start spyguard-backend } - change_hostname() { # Changing the hostname to spyguard echo -e "[+] Changing the hostname to spyguard" @@ -184,7 +181,8 @@ check_dependencies() { install_package ${bin##*/} fi done - echo -e "\e[39m[+] Create and activate Virtual Environment for Python packages\e[39m" + echo -e "\e[39m[+] Install and prepare Virtual Environment for Python packages\e[39m" + apt install python3-venv python3 -m venv /usr/share/spyguard/spyguard-venv source /usr/share/spyguard/spyguard-venv/bin/activate echo -e "\e[39m[+] Install Python packages...\e[39m" From 5c26c8ed4e2d32a36bb519a983222f04043df23e Mon Sep 17 00:00:00 2001 From: b068931cc450442b63f5b3d276ea4297 <77171083+b068931cc450442b63f5b3d276ea4297@users.noreply.github.com> Date: Wed, 24 Jan 2024 18:16:20 +0100 Subject: [PATCH 3/4] change python3-venv install --- install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 036dd01..300f472 100644 --- a/install.sh +++ b/install.sh @@ -156,6 +156,8 @@ install_package() { apt install -y dnsutils elif [[ $1 == "pip3" ]]; then apt install -y python3-pip + elif [[ $1 == "venv" ]]; then + apt install -y python3-venv elif [[ $1 == "arp" ]]; then apt install -y net-tools fi @@ -181,8 +183,7 @@ check_dependencies() { install_package ${bin##*/} fi done - echo -e "\e[39m[+] Install and prepare Virtual Environment for Python packages\e[39m" - apt install python3-venv + echo -e "\e[39m[+] Create and activate Virtual Environment for Python packages\e[39m" python3 -m venv /usr/share/spyguard/spyguard-venv source /usr/share/spyguard/spyguard-venv/bin/activate echo -e "\e[39m[+] Install Python packages...\e[39m" From a2f03196e684428e02a7cd22324af19995e5c1b0 Mon Sep 17 00:00:00 2001 From: b068931cc450442b63f5b3d276ea4297 <77171083+b068931cc450442b63f5b3d276ea4297@users.noreply.github.com> Date: Wed, 24 Jan 2024 23:14:33 +0100 Subject: [PATCH 4/4] new method for dependencies check --- install.sh | 62 ++++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/install.sh b/install.sh index 300f472..feefc3d 100644 --- a/install.sh +++ b/install.sh @@ -148,41 +148,34 @@ change_hostname() { echo "127.0.0.1 spyguard.local" >> /etc/hosts } -install_package() { - # Install associated packages by using aptitude. - if [[ $1 == "tshark" || $1 == "sqlite3" || $1 == "suricata" ]]; then - apt install $1 -y - elif [[ $1 == "dig" ]]; then - apt install -y dnsutils - elif [[ $1 == "pip3" ]]; then - apt install -y python3-pip - elif [[ $1 == "venv" ]]; then - apt install -y python3-venv - elif [[ $1 == "arp" ]]; then - apt install -y net-tools +install_packages() { +# Install associated packages by using aptitude. +packages=("tshark" + "sqlite3" + "suricata" + "dnsutils" + "python3-pip" + "python3-venv" + "net-tools") + +echo -e "\e[39m[+] Checking dependencies...\e[39m" +for package in "${packages[@]}" +do + if dpkg-query -W -f='${Status}' "$package" 2>/dev/null | grep -q -P '^install ok installed$'; then + echo -e "\e[92m [✔] $package already installed\e[39m" + else + echo -e "\e[93m [✘] $package not installed, lets install it\e[39m" + apt-get install -y "$package" + if [ $? -eq 0 ]; then + echo -e "\e[92m [✔] $package was successfully installed\e[39m" + else + echo -e "\e[91m [✘] $package has an error during the installation\e[39m" + fi fi +done } -check_dependencies() { - # Check binary dependencies associated to the project. - # If not installed, call install_package with the package name. - bins=("/usr/bin/tshark" - "/usr/bin/dig" - "/usr/bin/suricata" - "/usr/bin/sqlite3" - "/usr/bin/pip3" - "/usr/sbin/arp") - - echo -e "\e[39m[+] Checking dependencies...\e[39m" - for bin in "${bins[@]}" - do - if [[ -f "$bin" ]]; then - echo -e "\e[92m [✔] ${bin##*/} installed\e[39m" - else - echo -e "\e[93m [✘] ${bin##*/} not installed, lets install it\e[39m" - install_package ${bin##*/} - fi - done +create_venv() { echo -e "\e[39m[+] Create and activate Virtual Environment for Python packages\e[39m" python3 -m venv /usr/share/spyguard/spyguard-venv source /usr/share/spyguard/spyguard-venv/bin/activate @@ -207,7 +200,7 @@ cleaning() { systemctl disable suricata.service &> /dev/null # Removing some useless dependencies. - sudo apt autoremove -y &> /dev/null + apt autoremove -y &> /dev/null echo -e "\e[92m[+] Installation finished! You can open https://localhost:8443 to configure network settings.\e[39m" } @@ -242,7 +235,8 @@ else get_version set_userlang set_credentials - check_dependencies + install_packages + create_venv change_hostname generate_certificate create_database