Squid
Web Proxy
install
$ sudo apt install squid
Config
$ sudo vi /etc/squid/squid.conf
SSH
/etc/ssh/sshrc
HOOK="$Discord_webhook"
DATE=`date +"%Y/%m/%d %H:%M:%S"`
curl -H "Content-Type: application/json" -X POST \
-d "{\"username\": \"raspi_ssh\", \"content\": \"$USER has logged in from [$SSH_CLIENT] at $DATE \"}" $HOOK &
OpenVPN
pivpnでインストール
/etc/openvpn/server.conf
# on connection/disconnection
script-security 2
client-connect "/usr/local/vpn/connect.sh"
client-disconnect "/usr/local/vpn/disconnect.sh"
/usr/local/vpn/
connect.sh
#!/bin/bash
HOOK=""
DATE=`date +"%Y/%m/%d %H:%M:%S"`
curl -H "Content-Type: application/json" -X POST \
-d "{\"username\": \"raspi_vpn\", \"content\": \"$common_name has connected from [$untrusted_ip] as [$ifconfig_pool_remote_ip] at $DATE \"}" $HOOK &
disconnect.sh
#!/bin/bash
HOOK=""
DATE=`date +"%Y/%m/%d %H:%M:%S"`
curl -H "Content-Type: application/json" -X POST \
-d "{\"username\": \"raspi_vpn\", \"content\": \"$common_name has disconnected from [$untrusted_ip] as [$ifconfig_pool_remote_ip] at $DATE \"}" $HOOK &
Others
- usb on/off:
$ hdparm -S 120 /dev/sda
- ssh / reverse ssh
- mpd / mpc