mirror of
https://github.com/RoganDawes/P4wnP1_aloa.git
synced 2025-04-13 14:39:03 +02:00
Fixed init DB for startup template, removed unneeded files
This commit is contained in:
parent
457d50880f
commit
ee594aaf52
31
Makefile.old
31
Makefile.old
@ -1,31 +0,0 @@
|
||||
all: build
|
||||
|
||||
build:
|
||||
go build P4wnP1_service.go
|
||||
go build P4wnP1_cli.go
|
||||
|
||||
install:
|
||||
cp P4wnP1_service /usr/local/bin/
|
||||
cp P4wnP1_cli /usr/local/bin/
|
||||
cp P4wnP1.service /etc/systemd/system/P4wnP1.service
|
||||
mkdir /usr/local/P4wnP1
|
||||
cp -R keymaps /usr/local/P4wnP1/
|
||||
cp -R scripts /usr/local/P4wnP1/
|
||||
# reinit service daemon
|
||||
systemctl daemon-reload
|
||||
# enable service
|
||||
systemctl enable P4wnP1.service
|
||||
# start service
|
||||
service P4wnP1 start
|
||||
|
||||
remove:
|
||||
# stop service
|
||||
service P4wnP1 stop
|
||||
# disable service
|
||||
systemctl disable P4wnP1.service
|
||||
rm -f /usr/local/bin/P4wnP1_service
|
||||
rm -f /usr/local/bin/P4wnP1_cli
|
||||
rm -f /etc/systemd/system/P4wnP1.service
|
||||
rm -R /usr/local/P4wnP1/
|
||||
# reinit service daemon
|
||||
systemctl daemon-reload
|
74
ToDo.txt
74
ToDo.txt
@ -1,74 +0,0 @@
|
||||
CLI
|
||||
- add config caps for missing USB settings (serial, vid, pid ...)
|
||||
- DONE: add functionality to issue HIDScripts
|
||||
- DEONE: run async scripts
|
||||
- DONE: proper job management and cancelation
|
||||
- retrieve log output of scripts - !LOGGING HAS TO BE REWORKED COMPLETELY, TONS OF DEBUG OUT RIGHT NOW, MIXED
|
||||
USE OF STDOUT/STDERR!!
|
||||
- function to retrieve running HIDScript background jobs + function to interrupt all jobs
|
||||
|
||||
BOOT
|
||||
- WON'T BE IMPLEMENTED: deploy a default boot payload/configuration (Post Run in systemd service ??, config via /etc/P4wnP1/settings)
|
||||
- DONE: start a default bash script on service start, doing initial configuration by utilizing the CLI client
|
||||
|
||||
USB
|
||||
- DONE: add functionality to fetch target devices for HID (e.g. keyboard could be at /dev/hidg0..n depending on USB config)
|
||||
- DONE: init HIDController
|
||||
|
||||
HID
|
||||
- add additional keyboard layouts (not for first release)
|
||||
- add function to retrieve LED state (currently changes only)
|
||||
- DONE: fix absolute mouse movement
|
||||
- DONE: avoid memory leak on re-init of HIDController (re-use of memory leaking VMs + limited VM pool size, to keep
|
||||
impact reasonable)
|
||||
- DONE: implement job management
|
||||
- DONE: implement context for cancellation and cancellation propagation
|
||||
- DONE: interrupt blocking JavaScript to Go callbacks (waitLED, delay, waitLEDRepeated) by consuming VM IRQ channel
|
||||
|
||||
WIFI
|
||||
- implement connection to OPEN-AUTH network as STA
|
||||
- implement nexmon firmware support (not for first release)
|
||||
- implement failover from STA to AP (if connection fails)
|
||||
- add Option to reconfigure Wifi Ethernet Interface settings to DHCP client mode, when WiFi mode is station
|
||||
- fall back to old settings, if deployment of WiFi settings fails
|
||||
|
||||
BLUETOOTH:
|
||||
- configuration cpabilities for BNEP/NAP on server, keep in mind BLE use cases (idea of stand-alone proxy)
|
||||
- gRPC implementation
|
||||
- CLI client support
|
||||
|
||||
FILESYSTEM (not for first release)
|
||||
- remote pwd, cd, download, upload (up and download already implemented for HID script transfer)
|
||||
|
||||
DOCUMENTATION (not on first release ... yes, I know, anyway)
|
||||
- HIDScript docu (basically ES5 with some additional commands)
|
||||
- CLI docu (let's rely on the built-in help screens, for now. They need to be reworked themselves)
|
||||
- folder structure of resources/configuration files
|
||||
- language map format
|
||||
--> Lesson learned: Documenting, by providing example payloads didn't worked out for the P4wnP1 community (nearly no
|
||||
external payload contributions)
|
||||
|
||||
LOGGING:
|
||||
- consistent logging (no mix between STDOUT/STDERR)
|
||||
- reduce logging of gadget setting changes (only if settings are deployed)
|
||||
|
||||
Events:
|
||||
- remove debug out
|
||||
- Done: proper unregister of event listeners from web app
|
||||
|
||||
OTHER:
|
||||
- Done: extend installer to move HIDScripts to a fixed absolute path
|
||||
- Not possible (status isn't working here) proper error extraction from gRPC calls
|
||||
- set date from Browser
|
||||
- Load&Store runtime configuration from/to templates (accessible via web client)
|
||||
- Network events (interface down, DHCP lease/release)
|
||||
- add classes to all html elements of web client, to allow styling by sbd. who's able to do it better than me
|
||||
- add reboot/shutdown option accessible from webclient
|
||||
|
||||
TO FIX:
|
||||
- remove dependencies of CLI client on service package
|
||||
- debug out of HIDScript puts way to much CPU load on journaling daemon (floods logs)
|
||||
- Done: allow gRPC server to abort Running HID scripts on context.Done() -> possible, testing needed
|
||||
- jobs aren't deleted from global job list, unless result is fetched with waitResult. This affects interrupted
|
||||
jobs (f.e. timeout) and jobs run as background job --> cancelled jobs need a way to communicate back to the controller,
|
||||
that they could be deleted (Solution: goroutine listening for context.Done() per job in controller)
|
@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# install dependencies
|
||||
# - dnsmasq for DHCP / DNS server
|
||||
# - bridge-utils for bonding CDC ECM + RNDIS interface toa single bridge
|
||||
# - hostapd for AP deployment
|
||||
# - screen to attach interactive processes to a detachable tty
|
||||
# - autossh for "reachback" SSH connections
|
||||
# - bluez (bluez-bleutooth, policykit-1) for access to Bluetooth / BLE stack (depends on DBUS systemd service)
|
||||
# - haveged as entropy daemon to get enough entropy for hostapd AP with WPA2
|
||||
# - iodine for DNS tunnel capbilities
|
||||
# - genisoimage to allow on-the-fly CD-Rom image creation for CD emulation
|
||||
|
||||
sudo apt-get -y install git screen hostapd autossh bluez bluez-tools bridge-utils policykit-1 genisoimage iodine haveged
|
||||
sudo apt-get -y install tcpdump
|
||||
sudo apt-get -y install python-pip python-dev
|
||||
|
||||
# before installing dnsmasq, the nameserver from /etc/resolv.conf should be saved
|
||||
# to restore after install (gets overwritten by dnsmasq package)
|
||||
cp /etc/resolv.conf /tmp/backup_resolv.conf
|
||||
sudo apt-get -y install dnsmasq
|
||||
sudo /bin/bash -c 'cat /tmp/backup_resolv.conf > /etc/resolv.conf'
|
||||
|
||||
|
||||
|
||||
# python dependencies for HIDbackdoor
|
||||
sudo pip install pycrypto # already present on stretch
|
||||
sudo pip install pydispatcher
|
||||
|
||||
|
||||
sudo update-rc.d dhcpcd disable
|
||||
sudo update-rc.d dnsmasq disable
|
BIN
dist/db/init.db
vendored
BIN
dist/db/init.db
vendored
Binary file not shown.
37
examples.sh
37
examples.sh
@ -1,37 +0,0 @@
|
||||
# Update USB gadget configuration (enable RNDIS, disable CDC ECM, enable HID Keyboard)
|
||||
P4wnP1_cli USB set -r1 -e0 -k1
|
||||
|
||||
# Set new network configuration for "usbeth" (the interface is present when USB RNDIS, CDC ECM or both are enabled)
|
||||
# - "server" means a DHCP server is started for the interface "usbeth"
|
||||
# - set the address of the interface to 172.16.0.1 (-a flag)
|
||||
# - set the netmask of the interface to 255.255.255.252 (-m flag)
|
||||
# - add a range 127.16.0.2 to 172.16.0.2 to the DHCP server with leastime 3 minutes (-r flag, could be used multiple times to add more ranges)
|
||||
# - add option 3 (ROUTER) to the DHCP server, but don't provide a value to disable sending a gateway entry (-o flag)
|
||||
# - add option 6 (NAMESERVER) to the DHCP server, but don't provide a value to disable sending a DNS entry (-o flag, again)
|
||||
# - add option 252 (WPAD) to DHCP server with value 'http://172.16.0.1/wpad.dat' (-o flag, again)
|
||||
P4wnP1_cli NET set server -i usbeth -a 172.16.0.1 -m 255.255.255.252 -r "172.16.0.2|172.16.0.2|3m" -o "3:" -o "6:" -o "252:http://172.16.0.1/wpad.dat"
|
||||
|
||||
# Note: valid DHCP options are defined in RFC 2132 and additional RFCs (f.e. draft-ietf-wrec-wpad-01 defines WPAD)
|
||||
# Note 2: some option values are lists with comma, f.e option 121 (static route) "121:10.0.0.0/8,10.0.0.1,11.0.0.0,10.0.0.1"
|
||||
# as the comma "," is already used as delimiter for multiple options, it has to be replaced by a pipe operator "|"
|
||||
# and the option has to be provided like this:
|
||||
# -o "121:10.0.0.0/8|10.0.0.1|11.0.0.0/8|10.0.0.1"
|
||||
|
||||
|
||||
|
||||
# Start a DHCP Client for interface wlan0
|
||||
P4wnP1_cli NET set client -i wlan0
|
||||
# Configure usbeth manually (no DHCP server or client on this interface)
|
||||
P4wnP1_cli NET set manual -i usbeth -a 172.16.0.1 -m 255.255.255.252
|
||||
|
||||
# Set LED to blink one time in a loop
|
||||
P4wnP1_cli LED set -b 1
|
||||
# Set LED to blink 10 times in a loop
|
||||
P4wnP1_cli LED set -b 10
|
||||
# Set LED to solid
|
||||
P4wnP1_cli LED set -b 255
|
||||
# Set LED to off
|
||||
P4wnP1_cli LED set -b 0
|
||||
|
||||
|
||||
|
11
rbuild.sh
11
rbuild.sh
@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
#env GOBIN=$(pwd)/build GOOS=linux GOARCH=arm go install cmd/... # compile all main packages to the build folder
|
||||
env GOOS=linux GOARCH=arm go build -o build/P4wnP1_service cmd/P4wnP1_service/P4wnP1_service.go
|
||||
env GOOS=linux GOARCH=arm go build -o build/P4wnP1_cli cmd/P4wnP1_cli/P4wnP1_cli.go
|
||||
scp build/P4wnP1_service pi@raspberrypi.local:~/P4wnP1_go/build
|
||||
scp build/P4wnP1_cli pi@raspberrypi.local:~/P4wnP1_go/build
|
||||
|
||||
#scp P4wnP1_service pi@raspberrypi.local:~/P4wnP1_go
|
||||
#env GOOS=linux GOARCH=arm go build P4wnP1_cli.go
|
||||
#scp P4wnP1_cli pi@raspberrypi.local:~/P4wnP1_go
|
||||
|
Loading…
x
Reference in New Issue
Block a user