2019-10-02 17:26:29 +01:00
|
|
|
---
|
|
|
|
- hosts:
|
|
|
|
- 127.0.0.1
|
|
|
|
become: yes
|
|
|
|
vars:
|
2019-10-05 18:51:20 +02:00
|
|
|
pwnagotchi:
|
|
|
|
hostname: "{{ lookup('env', 'PWN_HOSTNAME') | default('pwnagotchi', true) }}"
|
2019-10-08 19:36:17 +01:00
|
|
|
version: "{{ lookup('env', 'PWN_VERSION') | default('master', true) }}"
|
2019-10-05 18:51:20 +02:00
|
|
|
system:
|
|
|
|
boot_options:
|
|
|
|
- "dtoverlay=dwc2"
|
|
|
|
- "dtparam=spi=on"
|
|
|
|
- "dtoverlay=spi1-3cs"
|
2019-10-09 16:57:00 +01:00
|
|
|
- "dtoverlay=i2c_arm=on"
|
|
|
|
- "dtoverlay=i2c1=on"
|
2019-10-05 18:51:20 +02:00
|
|
|
services:
|
|
|
|
enable:
|
|
|
|
- dphys-swapfile.service
|
2019-10-08 13:33:11 +01:00
|
|
|
- pwnagotchi.service
|
|
|
|
- bettercap.service
|
2019-10-09 16:57:00 +01:00
|
|
|
- epd-fuse.service
|
2019-10-05 18:51:20 +02:00
|
|
|
disable:
|
|
|
|
- apt-daily.timer
|
|
|
|
- apt-daily.service
|
|
|
|
- apt-daily-upgrade.timer
|
|
|
|
- apt-daily-upgrade.service
|
|
|
|
- wpa_supplicant.service
|
|
|
|
- bluetooth.service
|
|
|
|
- triggerhappy.service
|
|
|
|
- ifup@wlan0.service
|
|
|
|
packages:
|
2019-10-08 14:59:12 +01:00
|
|
|
bettercap:
|
|
|
|
url: "https://github.com/bettercap/bettercap/releases/download/v2.25/bettercap_linux_armv6l_2.25.zip"
|
2019-10-09 00:33:19 +01:00
|
|
|
ui: "https://github.com/bettercap/ui/releases/download/v1.3.0/ui.zip"
|
2019-10-05 18:51:20 +02:00
|
|
|
apt:
|
2019-10-10 23:46:10 +01:00
|
|
|
hold:
|
|
|
|
- firmware-atheros
|
|
|
|
- firmware-brcm80211
|
|
|
|
- firmware-libertas
|
|
|
|
- firmware-misc-nonfree
|
|
|
|
- firmware-realtek
|
2019-10-05 18:51:20 +02:00
|
|
|
remove:
|
|
|
|
- rasberrypi-net-mods
|
|
|
|
- dhcpcd5
|
|
|
|
- triggerhappy
|
|
|
|
- wpa_supplicant
|
|
|
|
- nfs-common
|
|
|
|
install:
|
|
|
|
- vim
|
|
|
|
- screen
|
|
|
|
- golang
|
|
|
|
- git
|
|
|
|
- build-essential
|
|
|
|
- python3-pip
|
2019-10-08 13:33:11 +01:00
|
|
|
- python3-mpi4py
|
2019-10-09 13:58:30 +02:00
|
|
|
- python3-smbus
|
2019-10-05 18:51:20 +02:00
|
|
|
- unzip
|
|
|
|
- gawk
|
|
|
|
- libopenmpi-dev
|
|
|
|
- libatlas-base-dev
|
|
|
|
- libjasper-dev
|
|
|
|
- libqtgui4
|
|
|
|
- libqt4-test
|
|
|
|
- libopenjp2-7
|
2019-10-08 13:33:11 +01:00
|
|
|
- libtiff5
|
2019-10-05 18:51:20 +02:00
|
|
|
- tcpdump
|
|
|
|
- lsof
|
|
|
|
- libilmbase23
|
|
|
|
- libopenexr23
|
|
|
|
- libgstreamer1.0-0
|
|
|
|
- libavcodec58
|
|
|
|
- libavformat58
|
|
|
|
- libswscale5
|
|
|
|
- libpcap-dev
|
|
|
|
- libusb-1.0-0-dev
|
|
|
|
- libnetfilter-queue-dev
|
2019-10-08 13:33:11 +01:00
|
|
|
- libopenmpi3
|
2019-10-05 18:51:20 +02:00
|
|
|
- dphys-swapfile
|
|
|
|
- kalipi-kernel
|
|
|
|
- kalipi-bootloader
|
|
|
|
- kalipi-re4son-firmware
|
|
|
|
- kalipi-kernel-headers
|
|
|
|
- libraspberrypi0
|
|
|
|
- libraspberrypi-dev
|
|
|
|
- libraspberrypi-doc
|
|
|
|
- libraspberrypi-bin
|
|
|
|
- fonts-dejavu
|
|
|
|
- fonts-dejavu-core
|
|
|
|
- fonts-dejavu-extra
|
|
|
|
- python3-pil
|
2019-10-09 16:57:00 +01:00
|
|
|
- python3-smbus
|
|
|
|
- libfuse-dev
|
|
|
|
- bc
|
|
|
|
- fonts-freefont-ttf
|
2019-10-05 18:51:20 +02:00
|
|
|
|
2019-10-02 17:26:29 +01:00
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: selected hostname
|
|
|
|
debug:
|
2019-10-05 18:51:20 +02:00
|
|
|
msg: "{{ pwnagotchi.hostname }}"
|
2019-10-02 17:26:29 +01:00
|
|
|
|
|
|
|
- name: build version
|
|
|
|
debug:
|
2019-10-05 18:51:20 +02:00
|
|
|
msg: "{{ pwnagotchi.version }}"
|
2019-10-02 17:26:29 +01:00
|
|
|
|
|
|
|
- name: change hostname
|
|
|
|
hostname:
|
2019-10-05 18:51:20 +02:00
|
|
|
name: "{{pwnagotchi.hostname}}"
|
2019-10-02 17:26:29 +01:00
|
|
|
|
|
|
|
- name: add hostname to /etc/hosts
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/hosts
|
|
|
|
regexp: '^127\.0\.0\.1[ \t]+localhost'
|
2019-10-05 18:51:20 +02:00
|
|
|
line: '127.0.0.1 localhost {{pwnagotchi.hostname}} {{pwnagotchi.hostname}}.local'
|
2019-10-02 17:26:29 +01:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add re4son-kernel repo key
|
|
|
|
apt_key:
|
|
|
|
url: https://re4son-kernel.com/keys/http/archive-key.asc
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add re4son-kernel repository
|
|
|
|
apt_repository:
|
|
|
|
repo: deb http://http.re4son-kernel.com/re4son/ kali-pi main
|
|
|
|
state: present
|
|
|
|
|
2019-10-10 23:46:10 +01:00
|
|
|
- name: add firmware packages to hold
|
|
|
|
dpkg_selections:
|
|
|
|
name: "{{ item }}"
|
|
|
|
selection: hold
|
|
|
|
with_items: "{{ packages.apt.hold }}"
|
|
|
|
|
2019-10-02 17:26:29 +01:00
|
|
|
- name: update apt package cache
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
|
2019-10-05 17:31:14 +01:00
|
|
|
- name: remove unecessary apt packages
|
|
|
|
apt:
|
2019-10-05 18:51:20 +02:00
|
|
|
name: "{{ packages.apt.remove }}"
|
2019-10-05 17:31:14 +01:00
|
|
|
state: absent
|
|
|
|
purge: yes
|
|
|
|
|
2019-10-02 17:26:29 +01:00
|
|
|
- name: upgrade apt distro
|
|
|
|
apt:
|
|
|
|
upgrade: dist
|
|
|
|
|
|
|
|
- name: install packages
|
|
|
|
apt:
|
2019-10-05 18:51:20 +02:00
|
|
|
name: "{{ packages.apt.install }}"
|
2019-10-02 17:26:29 +01:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: configure dphys-swapfile
|
|
|
|
file:
|
|
|
|
path: /etc/dphys-swapfile
|
|
|
|
content: "CONF_SWAPSIZE=1024"
|
|
|
|
|
2019-10-09 16:57:00 +01:00
|
|
|
- name: clone papirus repository
|
|
|
|
git:
|
|
|
|
repo: https://github.com/repaper/gratis.git
|
|
|
|
dest: /usr/local/src/gratis
|
|
|
|
|
|
|
|
- name: build papirus service
|
|
|
|
make:
|
|
|
|
chdir: /usr/local/src/gratis
|
|
|
|
target: rpi
|
|
|
|
params:
|
|
|
|
EPD_IO: epd_io.h
|
|
|
|
PANEL_VERSION: 'V231_G2'
|
|
|
|
|
|
|
|
- name: install papirus service
|
|
|
|
make:
|
|
|
|
chdir: /usr/local/src/gratis
|
|
|
|
target: rpi-install
|
|
|
|
params:
|
|
|
|
EPD_IO: epd_io.h
|
|
|
|
PANEL_VERSION: 'V231_G2'
|
|
|
|
|
|
|
|
- name: configure papirus display size
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/default/epd-fuse
|
|
|
|
regexp: "#EPD_SIZE=2.0"
|
|
|
|
line: "EPD_SIZE=2.0"
|
|
|
|
|
2019-10-04 23:15:47 +01:00
|
|
|
- name: acquire python3 pip target
|
|
|
|
command: "python3 -c 'import sys;print(sys.path.pop())'"
|
|
|
|
register: pip_target
|
2019-10-02 17:26:29 +01:00
|
|
|
|
2019-10-08 13:33:11 +01:00
|
|
|
- name: clone pwnagotchi repository
|
|
|
|
git:
|
|
|
|
repo: https://github.com/evilsocket/pwnagotchi.git
|
|
|
|
dest: /usr/local/src/pwnagotchi
|
|
|
|
|
|
|
|
- name: build pwnagotchi wheel
|
|
|
|
command: "python3 setup.py sdist bdist_wheel"
|
|
|
|
args:
|
|
|
|
chdir: /usr/local/src/pwnagotchi
|
2019-10-04 23:15:47 +01:00
|
|
|
|
2019-10-08 13:33:11 +01:00
|
|
|
- name: install opencv-python
|
|
|
|
pip:
|
|
|
|
name: "https://www.piwheels.hostedpi.com/simple/opencv-python/opencv_python-3.4.3.18-cp37-cp37m-linux_armv6l.whl"
|
|
|
|
extra_args: "--no-deps --no-cache-dir --platform=linux_armv6l --only-binary=:all: --target={{ pip_target.stdout }}"
|
2019-10-04 23:15:47 +01:00
|
|
|
|
|
|
|
- name: install tensorflow
|
2019-10-08 13:33:11 +01:00
|
|
|
pip:
|
|
|
|
name: "https://www.piwheels.hostedpi.com/simple/tensorflow/tensorflow-1.13.1-cp37-none-linux_armv6l.whl"
|
|
|
|
extra_args: "--no-deps --no-cache-dir --platform=linux_armv6l --only-binary=:all: --target={{ pip_target.stdout }}"
|
|
|
|
|
|
|
|
- name: install pwnagotchi wheel and dependencies
|
|
|
|
pip:
|
|
|
|
name: "{{ lookup('fileglob', '/usr/local/src/pwnagotchi/dist/pwnagotchi*.whl') }}"
|
|
|
|
extra_args: "--no-cache-dir"
|
2019-10-04 23:15:47 +01:00
|
|
|
|
|
|
|
- name: download and install bettercap
|
|
|
|
unarchive:
|
2019-10-08 14:59:12 +01:00
|
|
|
src: "{{ packages.bettercap.url }}"
|
2019-10-04 23:15:47 +01:00
|
|
|
dest: /usr/bin
|
|
|
|
remote_src: yes
|
|
|
|
exclude:
|
|
|
|
- README.md
|
|
|
|
- LICENSE.md
|
2019-10-02 17:26:29 +01:00
|
|
|
mode: 0755
|
|
|
|
|
|
|
|
- name: clone bettercap caplets
|
|
|
|
git:
|
|
|
|
repo: https://github.com/bettercap/caplets.git
|
|
|
|
dest: /tmp/caplets
|
|
|
|
|
|
|
|
- name: install bettercap caplets
|
|
|
|
make:
|
|
|
|
chdir: /tmp/caplets
|
|
|
|
target: install
|
|
|
|
|
2019-10-09 00:33:19 +01:00
|
|
|
- name: download and install bettercap ui
|
|
|
|
unarchive:
|
|
|
|
src: "{{ packages.bettercap.ui }}"
|
|
|
|
dest: /usr/local/share/bettercap/
|
|
|
|
remote_src: yes
|
|
|
|
mode: 0755
|
2019-10-08 22:31:27 +01:00
|
|
|
|
2019-10-02 17:26:29 +01:00
|
|
|
- name: create cpuusage script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/cpuusage
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
while true
|
|
|
|
do
|
|
|
|
top -b -n1 | awk '/Cpu\(s\)/ { printf("%d %", $2 + $4 + 0.5) }'
|
|
|
|
sleep 3
|
|
|
|
done
|
|
|
|
|
|
|
|
- name: create memusage script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/memusage
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
2019-10-03 17:44:07 +01:00
|
|
|
#!/usr/bin/env bash
|
2019-10-02 17:26:29 +01:00
|
|
|
free -m | awk '/Mem/ { printf( "%d %", $3 / $2 * 100 + 0.5 ) }'
|
|
|
|
|
2019-10-05 22:30:23 +02:00
|
|
|
- name: create bootblink script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/bootblink
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
for i in $(seq 1 "$1");
|
|
|
|
do
|
|
|
|
echo 0 >/sys/class/leds/led0/brightness
|
|
|
|
sleep 0.3
|
|
|
|
echo 1 >/sys/class/leds/led0/brightness
|
|
|
|
sleep 0.3
|
|
|
|
done
|
|
|
|
echo 0 >/sys/class/leds/led0/brightness
|
|
|
|
sleep 0.3
|
|
|
|
|
2019-10-05 23:23:31 +02:00
|
|
|
- name: create pwnagotchi-launcher script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/pwnagotchi-launcher
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
# blink 10 times to signal ready state
|
|
|
|
/usr/bin/bootblink 10 &
|
|
|
|
# start a detached screen session with bettercap
|
|
|
|
if ifconfig | grep usb0 | grep RUNNING; then
|
2019-10-08 14:12:05 +01:00
|
|
|
# if override file exists, go into auto mode
|
|
|
|
if [ -f /root/.pwnagotchi-auto ]; then
|
|
|
|
rm /root/.pwnagotchi-auto
|
|
|
|
/usr/local/bin/pwnagotchi
|
|
|
|
else
|
|
|
|
/usr/local/bin/pwnagotchi --manual
|
|
|
|
fi
|
2019-10-05 23:23:31 +02:00
|
|
|
else
|
2019-10-08 13:33:11 +01:00
|
|
|
/usr/local/bin/pwnagotchi
|
2019-10-05 23:23:31 +02:00
|
|
|
fi
|
|
|
|
|
2019-10-08 22:31:27 +01:00
|
|
|
- name: create bettercap-launcher script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/bettercap-launcher
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
# blink 10 times to signal ready state
|
|
|
|
/usr/bin/bootblink 10 &
|
|
|
|
if ifconfig | grep usb0 | grep RUNNING; then
|
|
|
|
# if override file exists, go into auto mode
|
|
|
|
if [ -f /root/.pwnagotchi-auto ]; then
|
|
|
|
rm /root/.pwnagotchi-auto
|
|
|
|
/usr/bin/bettercap -no-colors -caplet pwnagotchi-auto
|
|
|
|
else
|
|
|
|
/usr/bin/bettercap -no-colors -caplet pwnagotchi-manual
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
/usr/bin/bettercap -no-colors -caplet pwnagotchi-auto
|
|
|
|
fi
|
|
|
|
|
2019-10-02 17:26:29 +01:00
|
|
|
- name: create monstart script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/monstart
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
iw phy phy0 interface add mon0 type monitor && ifconfig mon0 up
|
|
|
|
|
|
|
|
- name: create monstop script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/monstop
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
ifconfig mon0 down && iw dev mon0 del
|
|
|
|
|
2019-10-06 09:48:18 +01:00
|
|
|
- name: create hdmion script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/hdmion
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
sudo /opt/vc/bin/tvservice -p
|
|
|
|
|
|
|
|
- name: create hdmioff script
|
|
|
|
copy:
|
|
|
|
dest: /usr/bin/hdmioff
|
|
|
|
mode: 0755
|
|
|
|
content: |
|
|
|
|
#!/usr/bin/env bash
|
|
|
|
sudo /opt/vc/bin/tvservice -o
|
|
|
|
|
2019-10-08 13:33:11 +01:00
|
|
|
- name: add HDMI powersave to rc.local
|
2019-10-02 17:26:29 +01:00
|
|
|
blockinfile:
|
|
|
|
path: /etc/rc.local
|
|
|
|
insertbefore: "exit 0"
|
|
|
|
block: |
|
|
|
|
if ! /opt/vc/bin/tvservice -s | grep HDMI; then
|
|
|
|
/opt/vc/bin/tvservice -o
|
|
|
|
fi
|
|
|
|
|
2019-10-10 23:46:10 +01:00
|
|
|
- name: create /etc/pwnagotchi folder
|
|
|
|
file:
|
|
|
|
path: /etc/pwnagotchi
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: check if user configuration exists
|
|
|
|
stat:
|
2019-10-05 23:23:31 +02:00
|
|
|
path: /etc/pwnagotchi/config.yml
|
2019-10-10 23:46:10 +01:00
|
|
|
register: user_config
|
|
|
|
|
|
|
|
- name: create /etc/pwnagotchi/config.yml
|
|
|
|
copy:
|
|
|
|
dest: /etc/pwnagotchi/config.yml
|
|
|
|
content: |
|
|
|
|
# Add your configuration overrides on this file any configuration changes done to defaults.yml will be lost!
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# ui:
|
|
|
|
# display:
|
|
|
|
# type: 'inkyphat'
|
|
|
|
# color: 'black'
|
|
|
|
#
|
|
|
|
when: not user_config.stat.exists
|
2019-10-05 23:23:31 +02:00
|
|
|
|
2019-10-03 09:28:47 +01:00
|
|
|
- name: configure lo interface
|
2019-10-10 23:46:10 +01:00
|
|
|
copy:
|
|
|
|
dest: /etc/network/interfaces.d/lo-cfg
|
|
|
|
content: |
|
2019-10-03 09:28:47 +01:00
|
|
|
auto lo
|
|
|
|
iface lo inet loopback
|
|
|
|
|
|
|
|
- name: configure wlan interface
|
2019-10-10 23:46:10 +01:00
|
|
|
copy:
|
|
|
|
dest: /etc/network/interfaces.d/wlan0-cfg
|
|
|
|
content: |
|
2019-10-03 09:28:47 +01:00
|
|
|
allow-hotplug wlan0
|
|
|
|
iface wlan0 inet static
|
|
|
|
|
2019-10-02 17:26:29 +01:00
|
|
|
- name: configure usb interface
|
2019-10-10 23:46:10 +01:00
|
|
|
copy:
|
|
|
|
dest: /etc/network/interfaces.d/usb0-cfg
|
|
|
|
content: |
|
2019-10-02 17:26:29 +01:00
|
|
|
allow-hotplug usb0
|
|
|
|
iface usb0 inet static
|
|
|
|
address 10.0.0.2
|
|
|
|
netmask 255.255.255.0
|
|
|
|
network 10.0.0.0
|
|
|
|
broadcast 10.0.0.255
|
|
|
|
gateway 10.0.0.1
|
|
|
|
|
|
|
|
- name: configure eth0 interface (pi2/3/4)
|
2019-10-10 23:46:10 +01:00
|
|
|
copy:
|
|
|
|
dest: /etc/network/interfaces.d/eth0-cfg
|
|
|
|
content: |
|
2019-10-02 17:26:29 +01:00
|
|
|
allow-hotplug eth0
|
|
|
|
iface eth0 inet dhcp
|
|
|
|
|
|
|
|
- name: enable ssh on boot
|
|
|
|
file:
|
|
|
|
path: /boot/ssh
|
|
|
|
state: touch
|
|
|
|
|
|
|
|
- name: adjust /boot/config.txt
|
|
|
|
lineinfile:
|
|
|
|
dest: /boot/config.txt
|
|
|
|
insertafter: EOF
|
|
|
|
line: '{{ item }}'
|
2019-10-10 23:46:10 +01:00
|
|
|
with_items: "{{system.boot_options}}"
|
2019-10-02 17:26:29 +01:00
|
|
|
|
|
|
|
- name: change root partition
|
|
|
|
replace:
|
|
|
|
dest: /boot/cmdline.txt
|
|
|
|
backup: no
|
|
|
|
regexp: "root=PARTUUID=[a-zA-Z0-9\\-]+"
|
|
|
|
replace: "root=/dev/mmcblk0p2"
|
|
|
|
|
|
|
|
- name: configure /boot/cmdline.txt
|
|
|
|
lineinfile:
|
|
|
|
path: /boot/cmdline.txt
|
|
|
|
backrefs: True
|
|
|
|
state: present
|
|
|
|
backup: no
|
|
|
|
regexp: '(.*)$'
|
2019-10-05 20:42:42 +01:00
|
|
|
line: '\1 modules-load=dwc2,g_ether'
|
2019-10-02 17:26:29 +01:00
|
|
|
|
|
|
|
- name: configure motd
|
|
|
|
copy:
|
|
|
|
dest: /etc/motd
|
2019-10-05 18:51:20 +02:00
|
|
|
content: "(◕‿‿◕) {{pwnagotchi.hostname}} (pwnagotchi-{{pwnagotchi.version}})"
|
2019-10-02 17:26:29 +01:00
|
|
|
|
|
|
|
- name: clean apt cache
|
|
|
|
apt:
|
|
|
|
autoclean: yes
|
|
|
|
|
|
|
|
- name: remove dependencies that are no longer required
|
|
|
|
apt:
|
|
|
|
autoremove: yes
|
|
|
|
|
2019-10-08 13:33:11 +01:00
|
|
|
- name: add bettercap service to systemd
|
|
|
|
copy:
|
|
|
|
dest: /etc/systemd/system/bettercap.service
|
|
|
|
content: |
|
|
|
|
[Unit]
|
|
|
|
Description=bettercap api.rest service.
|
|
|
|
Documentation=https://bettercap.org
|
|
|
|
Wants=network.target
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
PermissionsStartOnly=true
|
2019-10-09 09:47:00 +01:00
|
|
|
ExecStartPre=/usr/bin/monstart
|
2019-10-09 00:33:19 +01:00
|
|
|
ExecStart=/usr/bin/bettercap-launcher
|
2019-10-09 09:47:00 +01:00
|
|
|
ExecStopPost=/usr/bin/monstop
|
2019-10-08 13:33:11 +01:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
notify:
|
|
|
|
- reload systemd services
|
|
|
|
|
|
|
|
- name: add pwnagotchi service to systemd
|
|
|
|
copy:
|
|
|
|
dest: /etc/systemd/system/pwnagotchi.service
|
|
|
|
content: |
|
|
|
|
[Unit]
|
|
|
|
Description=pwnagotchi Deep Reinforcement Learning instrumenting bettercap for WiFI pwning.
|
|
|
|
Documentation=https://pwnagotchi.ai
|
|
|
|
Wants=network.target
|
|
|
|
After=bettercap.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
PermissionsStartOnly=true
|
|
|
|
ExecStart=/usr/bin/pwnagotchi-launcher
|
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
notify:
|
|
|
|
- reload systemd services
|
|
|
|
|
2019-10-05 18:51:20 +02:00
|
|
|
- name: enable services
|
|
|
|
systemd:
|
2019-10-08 13:33:11 +01:00
|
|
|
name: "{{ item }}"
|
2019-10-05 18:51:20 +02:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
2019-10-08 13:33:11 +01:00
|
|
|
with_items: "{{ services.enable }}"
|
2019-10-05 18:51:20 +02:00
|
|
|
|
|
|
|
- name: disable unecessary services
|
|
|
|
systemd:
|
2019-10-08 13:33:11 +01:00
|
|
|
name: "{{ item }}"
|
2019-10-05 18:51:20 +02:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
2019-10-08 13:33:11 +01:00
|
|
|
with_items: "{{ services.disable }}"
|
2019-10-05 18:51:20 +02:00
|
|
|
|
2019-10-02 17:26:29 +01:00
|
|
|
- name: remove ssh keys
|
|
|
|
file:
|
|
|
|
state: absent
|
|
|
|
path: "{{item}}"
|
2019-10-05 18:51:20 +02:00
|
|
|
with_fileglob:
|
|
|
|
- "/etc/ssh/ssh_host*_key*"
|
2019-10-08 13:33:11 +01:00
|
|
|
|
|
|
|
handlers:
|
|
|
|
- name: reload systemd services
|
|
|
|
systemd:
|
|
|
|
daemon_reload: yes
|