MCPcopy Index your code
hub / github.com/SpyGuard/SpyGuard

github.com/SpyGuard/SpyGuard @v2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.1 ↗ · + Follow
362 symbols 1,236 edges 55 files 221 documented · 61%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

title

[!IMPORTANT] Version 2 finally emerged after two years devoted to my family, marking a return to the project after an extended period away. An update of Suricata introduced breaking changes in the detection mechanism; version 2 addresses these changes while further enhancing the detection of suspicious network flows. You can see changes between the V1 and the V2 in this PR description.

Description

SpyGuard's main objective is to detect signs of compromise by monitoring network flows transmitted by a device.

As it uses WiFi, SpyGuard can be used against a wide range of devices, such as smartphones, laptops, IOTs or workstations. To do its job, the analysis engine of SpyGuard is using Indicators of Compromise (IOCs), anomaly detection and is supported by Suricata.

Examples of use cases

📰 Journalists 🏦 IT Services 🌏 NGOs 👩 Women's Shelter 👮‍♂️ LEA
As a journalist, I need to test my smartphone's against spyware before or during engagements with confidential informants. Working for a public institution, I aim to set up a self-service kiosk where individuals can check their smartphones for spyware. After traveling overseas, I'm looking to check my phone and laptop quickly. I seek to examine the smartphones of women upon their arrival for any stalkerware. I aim to check the communications of a smartphone in response to a complaint, as a preliminary step before proceeding with a full forensic analysis.

Note: SpyGuard is not a forensic tool. Therefore, it might miss malware that does not communicate during the analysis. Please refer to the FAQ for more information.

Installation

You need a debian-like operating system to install it easly by using the provided bash script. Once you've cloned the repository, just launch install.sh as root. Here are the command lines to do that:

cd /tmp/ && git clone https://github.com/SpyGuard/spyguard
cd spyguard && sudo bash install.sh

Once installed, you can go to the backend interface located at https://localhost:8443 to manage the device and setup the right network interfaces to get it working. Please look at the dedicated wiki page to get some tips regarding it.

[!WARNING] Please check prior the installation that your Linux distribution is using nmcli to manage networks. Old Raspberry Pi operating systems require activation of nmcli the raspi-config interface prior Spyguard installation (See here).

The frontend is available at the URL https://localhost:8000.

Smartphone analysis best practices

  • Do the interception in a public place (library, restaurant, train station...) or common place (office, home...);
  • Intercept the network communications of the device for at least 30 minutes;
  • Interact with the analysed device during the interception (reboot it, take a photo, send an SMS...);

SpyGuard and Stalkerware threat

The indicators of compromise (IOCs) linked to stalkerware are now fully managed by ECHAP, a French association working against cyberviolence. Even though stalkerware still remains a threat, remember that most of digital violence and surveillance is done by using simple means, such as hacking cloud & mail accounts. Therefore, we encourage you to consult the ECHAP guides and apply their advice to your digital life alongside of device checks.

[!IMPORTANT] It is worth mentioning that the IOCs are distributed under the Creative Common BY-NC-SA licence. This imply a non commercial use of them. Please respect this licence and ask ECHAP for any question related to that.

Commercial use

You can use SpyGuard in a commercial product. However, you can't use SpyGuard as the name of your product and you’re still required to follow the terms and conditions that the Apache License imposes, like refering to the SpyGuard project in customer documentation. Moreover, a sweet note to explain your use to the author is always appreciated, please see the contact below. You liked SpyGuard? Do not hesistate to make a donation!

Contact

If you need an express help to understand the results of the analysis or have a specific demand/question, do not hesitate to contact the author via Twitter or by sending an email at felix.aime@gmail.com. A bug? Do not hesitate to open a new issue.

They have contributed to or helped this project

  

To work, Spyguard is using a lot of awesome opensource projects, libraries, and fonts, kudos to them:

Dumpcap, Dig, Suricata, NetworkManager, Python, VueJS, Pip, pydig, pymisp, netaddr, pyyaml, flask, flask_httpauth, pyjwt, sqlalchemy, psutil, pyudev, qrcode, netifaces, weasyprint, python-whois, publicsuffix2, six, Exo2 font, Virtual Keyboard, OpenSSL, Spectre CSS.

Icons and design created via Figma, list of active TOR nodes taken from Dan.me.uk

Core symbols most depended-on inside this repo

get
called by 192
server/frontend/app/classes/device.py
read_config
called by 27
server/frontend/app/utils.py
add
called by 26
server/backend/app/classes/iocs.py
load
called by 23
analysis/classes/engine.py
_health_event
called by 18
analysis/classes/engine.py
get_iocs
called by 11
analysis/utils.py
_indicator_type_enabled
called by 11
analysis/classes/engine.py
search
called by 8
server/backend/app/classes/iocs.py

Shape

Method 169
Function 115
Route 55
Class 23

Languages

Python100%

Modules by API surface

analysis/classes/engine.py70 symbols
analysis/classes/report.py20 symbols
analysis/classes/jarm.py18 symbols
server/frontend/app/blueprints/misc.py14 symbols
server/backend/app/classes/config.py14 symbols
server/backend/app/blueprints/ioc.py14 symbols
server/backend/app/blueprints/config.py14 symbols
server/frontend/app/utils.py10 symbols
server/frontend/app/classes/save.py10 symbols
server/frontend/app/classes/network.py10 symbols
server/frontend/app/blueprints/network.py10 symbols
server/backend/app/classes/iocs.py10 symbols

For agents

$ claude mcp add SpyGuard \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact