Files
OpenCanary_Tinkerboard/README.md
2024-12-21 17:25:03 +01:00

2.6 KiB

OpenCanary 0.9.5 (latest)

Device preparation

Tested for Tinkerboard S and Tinkerboard S R2.0

  1. Install OS Armbian 24.11 Bookworm using Balena Etcher. During post installation process create user canary. You need to connect device to the monitor.

  2. Update and upgrade

sudo apt update && sudo apt upgrade -y
  1. Change SSH server port to be able to use Canary SSH on port 22
sudo nano /etc/ssh/sshd_config
#Uncoment Port section and change port from 22 to 33
#Restart SSH server:
sudo service sshd restart

#Connect SSH using terminal with: ssh -l canary -p 33 'HostIP'
  1. Download OpenCanary config file
wget https://download.csec.ba/tinkerboard/opencanary.conf
  1. Install Python3
sudo apt install -y python3-dev python3-pip python3-venv
  1. Install prerequisites
sudo apt install -y build-essential libssl-dev libffi-dev libpcap-dev net-tools
  1. Install Rust
sudo apt install rustc -y
  1. Instal Cargo
sudo apt install cargo -y
  1. Disable build Rust
export CRYPTOGRAPHY_DONT_BUILD_RUST=1
  1. Install dependencies
mkdir opencanary
cd opencanary
python3 -m venv env
source env/bin/activate
pip install wheel
pip install cryptography==38.0.1
pip install opencanary==0.9.5
pip install scapy
  1. Create config file and copy it to the path
opencanaryd --copyconfig
sudo mv /home/canary/opencanary.conf /etc/opencanaryd/opencanary.conf

Edit config file according to your needs. Add api key to webhook.
  1. Create OpenCanary service
sudo nano /etc/systemd/system/opencanary.service

#Add following lines into it
[Unit]
Description=OpenCanary
After=syslog.target
After=network.target

[Service]
User=root
Type=simple
RemainAfterExit=yes
Restart=always
ExecStart=/home/canary/opencanary/env/bin/opencanaryd --start
ExecStop=/home/canary/opencanary/env/bin/opencanaryd --stop

[Install]
WantedBy=multi-user.target
  1. Enable and start service
sudo systemctl enable opencanary && sudo systemctl start opencanary
  • or symply download install script to avoid all manual work
wget https://download.csec.ba/tinkerboard/opencanary.sh
#Make it executable
sudo chmod +x opencanary.sh
#Execute script
sudo ./opencanary.sh

#One thing you have to do manually is to change SSH port as described in part 3.
  1. Install and configure Samba server: Read document

  2. Configure device with Static IP address: Read document