USB Canary 项目使用教程

USB Canary 项目使用教程

usb-canaryA Linux or OSX tool that uses psutil to monitor devices while your computer is locked. In the case it detects someone plugging in or unplugging devices it can be configured to send you an SMS or alert you via Slack or Pushover.项目地址:https://gitcode.com/gh_mirrors/us/usb-canary

1. 项目的目录结构及介绍

USB Canary 是一个用于监控 USB 设备的 Linux 和 OSX 工具。以下是其目录结构及各部分介绍:

usb-canary/
├── LICENSE.txt
├── README.md
├── requirements.txt
├── settings.json
└── usbcanary.py
  • LICENSE.txt: 项目的许可证文件,遵循 GPL-3.0 许可证。
  • README.md: 项目说明文档,包含项目的基本介绍、安装和使用方法。
  • requirements.txt: 项目依赖的 Python 包列表。
  • settings.json: 项目的配置文件,用于设置通知方式和相关参数。
  • usbcanary.py: 项目的主启动文件,负责监控 USB 设备并发送通知。

2. 项目的启动文件介绍

usbcanary.py 是 USB Canary 项目的主启动文件。它使用 psutil 库来监控 USB 设备,并在检测到设备插入或移除时发送通知。以下是该文件的主要功能:

  • 监控 USB 设备: 使用 psutil 库实时监控 USB 设备的插入和移除事件。
  • 发送通知: 根据配置文件中的设置,通过 Twilio、Slack 或 Pushover 发送通知。

3. 项目的配置文件介绍

settings.json 是 USB Canary 项目的配置文件。它包含了用于设置通知方式和相关参数的配置项。以下是一个示例配置文件的内容:

{
  "slack": {
    "api_key": "xoxb-111111111111-abcdefghijklmnopqrstuvwx",
    "channel_name": "usb_canary",
    "botname": "USB Canary"
  },
  "twilio": {
    "auth_token": "l7cy56u3Nys72vPNRS8TAbaW3X1Ap4ma",
    "account_sid": "wP32p6qFNzJ25FD1IKM0YtX629eoHbrMiV",
    "twilio_number": "+61491570156",
    "mobile_number": "+61491570157"
  },
  "pushover": {
    "priority": 1,
    "user_key": "youruserkeygoeshere",
    "api_token": "yourapitokengoeshere"
  }
}
  • slack: 用于配置 Slack 通知的相关参数,包括 API 密钥、频道名称和机器人名称。
  • twilio: 用于配置 Twilio 短信通知的相关参数,包括认证令牌、账户 SID、Twilio 号码和移动号码。
  • pushover: 用于配置 Pushover 推送通知的相关参数,包括优先级、用户密钥和 API 令牌。

通过配置这些参数,用户可以根据自己的需求选择合适的通知方式,并确保在检测到 USB 设备事件时能够及时收到通知。

usb-canaryA Linux or OSX tool that uses psutil to monitor devices while your computer is locked. In the case it detects someone plugging in or unplugging devices it can be configured to send you an SMS or alert you via Slack or Pushover.项目地址:https://gitcode.com/gh_mirrors/us/usb-canary

  • 29
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胡唯隽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值