diff --git a/README-google.md b/README-google.md new file mode 100644 index 00000000..627dce72 --- /dev/null +++ b/README-google.md @@ -0,0 +1,44 @@ +Before you enable the gdrivesync plugin follow these guidelines. + +# Authentication +Drive API requires OAuth2.0 for authentication. PyDrive2 makes your life much easier by handling complex authentication steps for you. + +Go to [APIs Console](https://console.developers.google.com/iam-admin/projects) and make your own project. + +Search for ‘Google Drive API’, select the entry, and click ‘Enable’. + +Select ‘Credentials’ from the left menu, click ‘Create Credentials’, select ‘OAuth client ID’. + +Now, the product name and consent screen need to be set -> click ‘Configure consent screen’ and follow the instructions. Once finished: + +Select ‘Application type’ to be Desktop application. + +Enter an appropriate name. + +Input http://localhost/ for ‘Authorized redirect URIs’. + +Select the correct oauth scope: + + - drive + - drive.install + +Click ‘Create’. + +Click ‘Download JSON’ and copy the contents to /root/client_secrets.json. + +Then copy your client_id and client_secret to /root/settings.yaml + +# Login to google + +When you have done this please run the following command in your ssh shell: + +`sudo pwnagotchi google login` + +And follow the steps, after which you can enable the plugin and let the magic begin. + +# Functionality +Set a backup folder in config file + +It will then upload a zip file there of all your backup files. + +If you have a new device you only need to login with google and enable the plugin, it will then download the previously made backup and reboot. diff --git a/README.md b/README.md index c810b1ec..ecde5b60 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ Default SSH credentials are pi/raspberry Nope I will not help with these 'issues'. Read the manual/readme for your specific device, if that doesn't help -> **[GOOGLE](https://www.google.com)** +- If you want to use the gdrivesync plugin >> [README](README-google.md) # Patreon: [Pwnagotchi-Torch](https://www.patreon.com/pwnagotchi_torch) diff --git a/builder/data/etc/dhcpcd.conf b/builder/data/etc/dhcpcd.conf index deac8212..95c71a3a 100644 --- a/builder/data/etc/dhcpcd.conf +++ b/builder/data/etc/dhcpcd.conf @@ -49,8 +49,15 @@ denyinterfaces wlan0 interface eth0 static domain_name_servers=8.8.8.8 1.1.1.1 +metric=202 interface usb0 static ip_address=10.0.0.2/24 static routers=10.0.0.1 -static domain_name_servers=10.0.0.1 8.8.8.8 1.1.1.1 \ No newline at end of file +static domain_name_servers=10.0.0.1 8.8.8.8 1.1.1.1 +metric=203 + +interface bnep0 +metric=204 + +interface lo \ No newline at end of file diff --git a/builder/data/etc/network/interfaces.d/eth0-cfg b/builder/data/etc/network/interfaces.d/eth0-cfg deleted file mode 100644 index 2166051a..00000000 --- a/builder/data/etc/network/interfaces.d/eth0-cfg +++ /dev/null @@ -1,2 +0,0 @@ -allow-hotplug eth0 -iface eth0 inet dhcp \ No newline at end of file diff --git a/builder/data/etc/network/interfaces.d/lo-cfg b/builder/data/etc/network/interfaces.d/lo-cfg deleted file mode 100644 index 18ff4764..00000000 --- a/builder/data/etc/network/interfaces.d/lo-cfg +++ /dev/null @@ -1,2 +0,0 @@ -auto lo -iface lo inet loopback \ No newline at end of file diff --git a/builder/data/etc/network/interfaces.d/usb0-cfg b/builder/data/etc/network/interfaces.d/usb0-cfg deleted file mode 100644 index c1d9150b..00000000 --- a/builder/data/etc/network/interfaces.d/usb0-cfg +++ /dev/null @@ -1,8 +0,0 @@ -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 - metric 203 \ No newline at end of file diff --git a/builder/data/etc/network/interfaces.d/wlan0-cfg b/builder/data/etc/network/interfaces.d/wlan0-cfg deleted file mode 100644 index f5425694..00000000 --- a/builder/data/etc/network/interfaces.d/wlan0-cfg +++ /dev/null @@ -1,2 +0,0 @@ -allow-hotplug wlan0 -iface wlan0 inet static \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/age.toml b/builder/data/etc/pwnagotchi/conf.d/age.toml deleted file mode 100644 index 4ca7e8ea..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/age.toml +++ /dev/null @@ -1,5 +0,0 @@ -main.plugins.age.enabled = false -main.plugins.age.age_x_coord = 0 -main.plugins.age.age_y_coord = 32 -main.plugins.age.str_x_coord = 67 -main.plugins.age.str_y_coord = 32 \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/auto-update.toml b/builder/data/etc/pwnagotchi/conf.d/auto-update.toml deleted file mode 100644 index e073dbb9..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/auto-update.toml +++ /dev/null @@ -1,3 +0,0 @@ -main.plugins.auto-update.enabled = true -main.plugins.auto-update.install = true -main.plugins.auto-update.interval = 1 \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/bt-tether.toml b/builder/data/etc/pwnagotchi/conf.d/bt-tether.toml deleted file mode 100644 index 64d1691a..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/bt-tether.toml +++ /dev/null @@ -1,23 +0,0 @@ -main.plugins.bt-tether.enabled = false - -main.plugins.bt-tether.devices.android-phone.enabled = false -main.plugins.bt-tether.devices.android-phone.search_order = 1 -main.plugins.bt-tether.devices.android-phone.mac = "" -main.plugins.bt-tether.devices.android-phone.ip = "192.168.44.44" -main.plugins.bt-tether.devices.android-phone.netmask = 24 -main.plugins.bt-tether.devices.android-phone.interval = 1 -main.plugins.bt-tether.devices.android-phone.scantime = 10 -main.plugins.bt-tether.devices.android-phone.max_tries = 10 -main.plugins.bt-tether.devices.android-phone.share_internet = false -main.plugins.bt-tether.devices.android-phone.priority = 1 - -main.plugins.bt-tether.devices.ios-phone.enabled = false -main.plugins.bt-tether.devices.ios-phone.search_order = 2 -main.plugins.bt-tether.devices.ios-phone.mac = "" -main.plugins.bt-tether.devices.ios-phone.ip = "172.20.10.6" -main.plugins.bt-tether.devices.ios-phone.netmask = 24 -main.plugins.bt-tether.devices.ios-phone.interval = 5 -main.plugins.bt-tether.devices.ios-phone.scantime = 20 -main.plugins.bt-tether.devices.ios-phone.max_tries = 0 -main.plugins.bt-tether.devices.ios-phone.share_internet = false -main.plugins.bt-tether.devices.ios-phone.priority = 999 \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/fix_services.toml b/builder/data/etc/pwnagotchi/conf.d/fix_services.toml deleted file mode 100644 index 9af7b6e1..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/fix_services.toml +++ /dev/null @@ -1 +0,0 @@ -main.plugins.fix_services.enabled = true \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/gdrivesync.toml b/builder/data/etc/pwnagotchi/conf.d/gdrivesync.toml deleted file mode 100644 index f5a3b65c..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/gdrivesync.toml +++ /dev/null @@ -1,4 +0,0 @@ -main.plugins.gdrivesync.enabled = false -main.plugins.gdrivesync.backupfiles = [''] -main.plugins.gdrivesync.backup_folder = "PwnagotchiBackups" -main.plugin.gdrivesync.interval = 1 \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/gpio_buttons.toml b/builder/data/etc/pwnagotchi/conf.d/gpio_buttons.toml deleted file mode 100644 index 3567b22b..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/gpio_buttons.toml +++ /dev/null @@ -1 +0,0 @@ -main.plugins.gpio_buttons.enabled = false \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/gps.toml b/builder/data/etc/pwnagotchi/conf.d/gps.toml deleted file mode 100644 index e975b538..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/gps.toml +++ /dev/null @@ -1,3 +0,0 @@ -main.plugins.gps.enabled = false -main.plugins.gps.speed = 19200 -main.plugins.gps.device = "/dev/ttyUSB0" \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/grid.toml b/builder/data/etc/pwnagotchi/conf.d/grid.toml deleted file mode 100644 index 0ec2ab52..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/grid.toml +++ /dev/null @@ -1,5 +0,0 @@ -main.plugins.grid.enabled = true -main.plugins.grid.report = true -main.plugins.grid.exclude = [ - "YourHomeNetworkHere" -] \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/logtail.toml b/builder/data/etc/pwnagotchi/conf.d/logtail.toml deleted file mode 100644 index 55393368..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/logtail.toml +++ /dev/null @@ -1,2 +0,0 @@ -main.plugins.logtail.enabled = false -main.plugins.logtail.max-lines = 10000 \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/memtemp.toml b/builder/data/etc/pwnagotchi/conf.d/memtemp.toml deleted file mode 100644 index d3521d5f..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/memtemp.toml +++ /dev/null @@ -1,3 +0,0 @@ -main.plugins.memtemp.enabled = false -main.plugins.memtemp.scale = "celsius" -main.plugins.memtemp.orientation = "horizontal" \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/net-pos.toml b/builder/data/etc/pwnagotchi/conf.d/net-pos.toml deleted file mode 100644 index bdf22f1c..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/net-pos.toml +++ /dev/null @@ -1,2 +0,0 @@ -main.plugins.net-pos.enabled = false -main.plugins.net-pos.api_key = "test" \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/onlinehascrack.toml b/builder/data/etc/pwnagotchi/conf.d/onlinehascrack.toml deleted file mode 100644 index b1170d0a..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/onlinehascrack.toml +++ /dev/null @@ -1,5 +0,0 @@ -main.plugins.onlinehashcrack.enabled = false -main.plugins.onlinehashcrack.email = "" -main.plugins.onlinehashcrack.dashboard = "" -main.plugins.onlinehashcrack.single_files = false -main.plugins.onlinehashcrack.whitelist = [] \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/paw-gps.toml b/builder/data/etc/pwnagotchi/conf.d/paw-gps.toml deleted file mode 100644 index b5e0cfee..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/paw-gps.toml +++ /dev/null @@ -1,2 +0,0 @@ -main.plugins.paw-gps.enabled = false -main.plugins.paw-gps.ip = "192.168.44.1:8080" \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/pisugar2.toml b/builder/data/etc/pwnagotchi/conf.d/pisugar2.toml deleted file mode 100644 index 424c8873..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/pisugar2.toml +++ /dev/null @@ -1,3 +0,0 @@ -main.plugins.pisugar2.enabled = false -main.plugins.pisugar2.shutdown = 5 -main.plugins.pisugar2.sync_rtc_on_boot = false \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/session-stats.toml b/builder/data/etc/pwnagotchi/conf.d/session-stats.toml deleted file mode 100644 index ef57f4c8..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/session-stats.toml +++ /dev/null @@ -1,2 +0,0 @@ -main.plugins.session-stats.enabled = true -main.plugins.session-stats.save_directory = "/var/tmp/pwnagotchi/sessions/" \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/ups_hat_c.toml b/builder/data/etc/pwnagotchi/conf.d/ups_hat_c.toml deleted file mode 100644 index 5a0e405d..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/ups_hat_c.toml +++ /dev/null @@ -1,5 +0,0 @@ -main.plugins.ups_hat_c.enabled = false -main.plugins.ups_hat_c.label_on = true # show BAT label or just percentage -main.plugins.ups_hat_c.shutdown = 5 # battery percent at which the device will turn off -main.plugins.ups_hat_c.bat_x_coord = 140 -main.plugins.ups_hat_c.bat_y_coord = 0 \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/ups_lite.toml b/builder/data/etc/pwnagotchi/conf.d/ups_lite.toml deleted file mode 100644 index 7b6a43fc..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/ups_lite.toml +++ /dev/null @@ -1,2 +0,0 @@ -main.plugins.ups_lite.enabled = false -main.plugins.ups_lite.shutdown = 2 \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/webcfg.toml b/builder/data/etc/pwnagotchi/conf.d/webcfg.toml deleted file mode 100644 index d57b403e..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/webcfg.toml +++ /dev/null @@ -1 +0,0 @@ -main.plugins.webcfg.enabled = true \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/webgpsmap.toml b/builder/data/etc/pwnagotchi/conf.d/webgpsmap.toml deleted file mode 100644 index 6a22d55c..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/webgpsmap.toml +++ /dev/null @@ -1 +0,0 @@ -main.plugins.webgpsmap.enabled = false \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/wigle.toml b/builder/data/etc/pwnagotchi/conf.d/wigle.toml deleted file mode 100644 index 8f612473..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/wigle.toml +++ /dev/null @@ -1,4 +0,0 @@ -main.plugins.wigle.enabled = false -main.plugins.wigle.api_key = "" -main.plugins.wigle.whitelist = [] -main.plugins.wigle.donate = true \ No newline at end of file diff --git a/builder/data/etc/pwnagotchi/conf.d/wpa-sec.toml b/builder/data/etc/pwnagotchi/conf.d/wpa-sec.toml deleted file mode 100644 index bdd91e4b..00000000 --- a/builder/data/etc/pwnagotchi/conf.d/wpa-sec.toml +++ /dev/null @@ -1,5 +0,0 @@ -main.plugins.wpa-sec.enabled = false -main.plugins.wpa-sec.api_key = "" -main.plugins.wpa-sec.api_url = "https://wpa-sec.stanev.org" -main.plugins.wpa-sec.download_results = false -main.plugins.wpa-sec.whitelist = [] \ No newline at end of file diff --git a/builder/data/etc/update-motd.d/01-motd b/builder/data/etc/update-motd.d/01-motd index f549cd6d..4cb9709a 100755 --- a/builder/data/etc/update-motd.d/01-motd +++ b/builder/data/etc/update-motd.d/01-motd @@ -8,6 +8,8 @@ echo " Hi! I'm a pwnagotchi $_version, please take good care of me!" echo " Here are some basic things you need to know to raise me properly!" echo echo " If you want to change my configuration, use /etc/pwnagotchi/config.toml" +echo " All plugin config files are located in /etc/pwnagotchi/conf.d/" +echo " Read the readme if you want to use gdrivesync plugin!!" echo echo " All the configuration options can be found on /etc/pwnagotchi/default.toml," echo " but don't change this file because I will recreate it every time I'm restarted!" diff --git a/builder/data/root/settings.yaml b/builder/data/root/settings.yaml index e69de29b..5f198bde 100644 --- a/builder/data/root/settings.yaml +++ b/builder/data/root/settings.yaml @@ -0,0 +1,15 @@ +client_config_backend: file +client_config_file: /root/client_secrets.json +client_config: + client_id: + client_secret: + +save_credentials: True +save_credentials_backend: file +save_credentials_file: /root/credentials.json + +get_refresh_token: True + +oauth_scope: + - https://www.googleapis.com/auth/drive + - https://www.googleapis.com/auth/drive.install \ No newline at end of file diff --git a/builder/data/usr/bin/pwnlib b/builder/data/usr/bin/pwnlib index adf1e978..b50fb07a 100755 --- a/builder/data/usr/bin/pwnlib +++ b/builder/data/usr/bin/pwnlib @@ -37,7 +37,6 @@ reload_brcm() { # starts mon0 start_monitor_interface() { - rfkill unblock all ifconfig wlan0 up iw dev wlan0 set power_save off airmon-ng check kill diff --git a/builder/pwnagotchi.json b/builder/pwnagotchi.json index e667d8cc..40707c01 100644 --- a/builder/pwnagotchi.json +++ b/builder/pwnagotchi.json @@ -49,26 +49,6 @@ "source": "../builder/data/usr/bin/hdmioff", "destination": "/usr/bin/hdmioff" }, - { - "type": "file", - "source": "../builder/data/etc/network/interfaces.d/lo-cfg", - "destination": "/etc/network/interfaces.d/lo-cfg" - }, - { - "type": "file", - "source": "../builder/data/etc/network/interfaces.d/wlan0-cfg", - "destination": "/etc/network/interfaces.d/wlan0-cfg" - }, - { - "type": "file", - "source": "../builder/data/etc/network/interfaces.d/usb0-cfg", - "destination": "/etc/network/interfaces.d/usb0-cfg" - }, - { - "type": "file", - "source": "../builder/data/etc/network/interfaces.d/eth0-cfg", - "destination": "/etc/network/interfaces.d/eth0-cfg" - }, { "type": "file", "source": "../builder/data/etc/systemd/system/pwngrid-peer.service", diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index da9b364a..531cccc0 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -204,161 +204,62 @@ executable: /bin/bash chdir: /usr/local/src/nexmon/ - #- name: choose the right kernel version (bcm43455c0) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile - # backup: no - # regexp: "KERNEL_VERSION = .*$" - # replace: "KERNEL_VERSION = {{ kernel.min }}" - - #- name: choose the right kernel release (variable) (bcm43455c0) - # lineinfile: - # dest: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile - # insertafter: "DRIVER_FOLDER_NAME = .*$" - # line: "KERNEL_RELEASE = {{ kernel.full }}" - - #- name: choose the right kernel arch (bcm43455c0) - # lineinfile: - # dest: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile - # insertafter: "KERNEL_RELEASE = .*$" - # line: "KERNEL_ARCH = {{ kernel.arch }}" - - #- name: choose the right kernel arch (replace string) (bcm43455c0) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile - # backup: no - # regexp: "shell uname -m" - # replace: "KERNEL_ARCH" - - #- name: choose the right kernel release (replace string) (bcm43455c0) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/Makefile - # backup: no - # regexp: "shell uname -r" - # replace: "KERNEL_RELEASE" - - name: make firmware patch (bcm43455c0) - shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/ && make && make install-firmware" + shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/ && make" args: executable: /bin/bash chdir: /usr/local/src/nexmon/ - #- name: install new firmware (bcm43455c0) - # copy: - # src: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/brcmfmac43455-sdio.bin - # dest: /usr/lib/firmware/brcm/brcmfmac43455-sdio.bin - # follow: true - - #- name: choose the right kernel version (bcm43436b0) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile - # backup: no - # regexp: "KERNEL_VERSION = .*$" - # replace: "KERNEL_VERSION = {{ kernel.min }}" - - #- name: choose the right kernel release (variable) (bcm43436b0) - # lineinfile: - # dest: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile - # insertafter: "DRIVER_FOLDER_NAME = .*$" - # line: "KERNEL_RELEASE = {{ kernel.full }}" - - #- name: choose the right kernel arch (bcm43436b0) - # lineinfile: - # dest: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile - # insertafter: "KERNEL_RELEASE = .*$" - # line: "KERNEL_ARCH = {{ kernel.arch }}" - - #- name: choose the right kernel arch (bcm43436b0) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile - # backup: no - # regexp: "shell uname -m" - # replace: "KERNEL_ARCH" - - #- name: choose the right kernel release (replace string) (bcm43436b0) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/Makefile - # backup: no - # regexp: "shell uname -r" - # replace: "KERNEL_RELEASE" + - name: install new firmware (bcm43455c0) + copy: + src: /usr/local/src/nexmon/patches/bcm43455c0/7_45_206/nexmon/brcmfmac43455-sdio.bin + dest: /usr/lib/firmware/brcm/brcmfmac43455-sdio.bin + follow: true - name: make firmware patch (bcm43436b0) - shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/ && make && make install-firmware" + shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/ && make" args: executable: /bin/bash chdir: /usr/local/src/nexmon/ - #- name: install new firmware (bcm43436b0) - # copy: - # src: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/brcmfmac43436-sdio.bin - # dest: /usr/lib/firmware/brcm/brcmfmac43436-sdio.bin - # follow: true - - #- name: choose the right kernel version (bcm43430a1) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile - # backup: no - # regexp: "KERNEL_VERSION = .*$" - # replace: "KERNEL_VERSION = {{ kernel.min }}" - - #- name: choose the right kernel release (variable) (bcm43430a1) - # lineinfile: - # dest: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile - # insertafter: "DRIVER_FOLDER_NAME = .*$" - # line: "KERNEL_RELEASE = {{ kernel.full }}" - - #- name: choose the right kernel arch (bcm43430a1) - # lineinfile: - # dest: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile - # insertafter: "KERNEL_RELEASE = .*$" - # line: "KERNEL_ARCH = {{ kernel.arch }}" - - #- name: choose the right kernel arch (bcm43430a1) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile - # backup: no - # regexp: "shell uname -m" - # replace: "KERNEL_ARCH" - - #- name: choose the right kernel release (replace string) (bcm43430a1) - # replace: - # dest: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/Makefile - # backup: no - # regexp: "shell uname -r" - # replace: "KERNEL_RELEASE" + - name: install new firmware (bcm43436b0) + copy: + src: /usr/local/src/nexmon/patches/bcm43436b0/9_88_4_65/nexmon/brcmfmac43436-sdio.bin + dest: /usr/lib/firmware/brcm/brcmfmac43436-sdio.bin + follow: true - name: make firmware patch (bcm43430a1) - shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/ && make && make install-firmware" + shell: "source ./setup_env.sh && cd /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/ && make" args: executable: /bin/bash chdir: /usr/local/src/nexmon/ - #- name: install new firmware (bcm43430a1) - # copy: - # src: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin - # dest: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin - # follow: true + - name: install new firmware (bcm43430a1) + copy: + src: /usr/local/src/nexmon/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin + dest: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin + follow: true - #- name: copy 43430-sdio as 43436s-sdio for the special 43430/1 /2 - # copy: - # src: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin - # dest: /usr/lib/firmware/brcm/brcmfmac43436s-sdio.bin - # follow: true + - name: copy 43430-sdio as 43436s-sdio for the special 43430/1 /2 + copy: + src: /usr/lib/firmware/brcm/brcmfmac43430-sdio.bin + dest: /usr/lib/firmware/brcm/brcmfmac43436s-sdio.bin + follow: true - #- name: Delete the firmware blob to avoid it crashing - # file: - # state: absent - # path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob + - name: Delete the firmware blob to avoid it crashing + file: + state: absent + path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob - #- name: Delete the RPiZW firmware blob to avoid it crashing - # file: - # state: absent - # path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.clm_blob + - name: Delete the RPiZW firmware blob to avoid it crashing + file: + state: absent + path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,model-zero-w.clm_blob - #- name: Delete the RPi3 firmware blob to avoid it crashing - # file: - # state: absent - # path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.clm_blob + - name: Delete the RPi3 firmware blob to avoid it crashing + file: + state: absent + path: /usr/lib/firmware/brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.clm_blob - name: backup original driver command: "mv /usr/lib/modules/{{ kernel.full }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz /usr/lib/modules/{{ kernel.full }}/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko.xz.orig" @@ -415,10 +316,9 @@ path: /usr/local/share/pwnagotchi/ state: directory - # Install go-1.20.6 - name: Install go-1.21 unarchive: - src: https://go.dev/dl/go1.21.1.linux-arm64.tar.gz + src: https://go.dev/dl/go1.21.3.linux-arm64.tar.gz dest: /usr/local remote_src: yes register: golang @@ -495,6 +395,8 @@ if ! /opt/vc/bin/tvservice -s | egrep 'HDMI|DVI'; then /opt/vc/bin/tvservice -o fi + + rfkill unblock all - name: create /etc/pwnagotchi folder file: @@ -561,6 +463,12 @@ regexp: '(.*)$' line: '\1 modules-load=dwc2,g_ether' + - name: rfkill unblock all at boot + lineinfile: + dest: /boot/cmdline.txt + insertafter: EOF + line: "systemd.restore_state=0 rfkill.default_state=1" + - name: Add pwnlog alias lineinfile: dest: /home/pi/.bashrc @@ -628,10 +536,25 @@ when: removed.changed - name: apt clean - shell: "apt clean" + shell: "apt-get clean" args: executable: /bin/bash + - name: remove /root/go folder + file: + state: absent + path: /root/go + + - name: remove /usr/local/go folder + file: + state: absent + path: /usr/local/go + + - name: remove pip cache + file: + state: absent + path: /root/.cache/pip + - name: remove dependencies that are no longer required apt: autoremove: yes diff --git a/pwnagotchi/__init__.py b/pwnagotchi/__init__.py index 4387579b..730c7d93 100644 --- a/pwnagotchi/__init__.py +++ b/pwnagotchi/__init__.py @@ -92,7 +92,8 @@ def cpu_load(tag=None): parts0 = _cpu_stat() time.sleep(0.1) # only need to sleep when no tag parts1 = _cpu_stat() - if tag: _cpu_stats[tag] = parts1 + if tag: + _cpu_stats[tag] = parts1 parts_diff = [p1 - p0 for (p0, p1) in zip(parts0, parts1)] user, nice, sys, idle, iowait, irq, softirq, steal, _guest, _guest_nice = parts_diff diff --git a/pwnagotchi/_version.py b/pwnagotchi/_version.py index e91b5bf4..e59b17b4 100644 --- a/pwnagotchi/_version.py +++ b/pwnagotchi/_version.py @@ -1 +1 @@ -__version__ = '2.4.8' +__version__ = '2.5.0' diff --git a/pwnagotchi/defaults.toml b/pwnagotchi/defaults.toml index 1e2f5caa..3cb3f5d8 100644 --- a/pwnagotchi/defaults.toml +++ b/pwnagotchi/defaults.toml @@ -10,6 +10,103 @@ main.custom_plugin_repos = [ main.custom_plugins = "/usr/local/share/pwnagotchi/custom-plugins/" +main.plugins.auto-update.enabled = true +main.plugins.auto-update.install = true +main.plugins.auto-update.interval = 1 + +main.plugins.bt-tether.enabled = false + +main.plugins.bt-tether.devices.android-phone.enabled = false +main.plugins.bt-tether.devices.android-phone.search_order = 1 +main.plugins.bt-tether.devices.android-phone.mac = "" +main.plugins.bt-tether.devices.android-phone.ip = "192.168.44.44" +main.plugins.bt-tether.devices.android-phone.netmask = 24 +main.plugins.bt-tether.devices.android-phone.interval = 1 +main.plugins.bt-tether.devices.android-phone.scantime = 10 +main.plugins.bt-tether.devices.android-phone.max_tries = 10 +main.plugins.bt-tether.devices.android-phone.share_internet = false +main.plugins.bt-tether.devices.android-phone.priority = 1 + +main.plugins.bt-tether.devices.ios-phone.enabled = false +main.plugins.bt-tether.devices.ios-phone.search_order = 2 +main.plugins.bt-tether.devices.ios-phone.mac = "" +main.plugins.bt-tether.devices.ios-phone.ip = "172.20.10.6" +main.plugins.bt-tether.devices.ios-phone.netmask = 24 +main.plugins.bt-tether.devices.ios-phone.interval = 5 +main.plugins.bt-tether.devices.ios-phone.scantime = 20 +main.plugins.bt-tether.devices.ios-phone.max_tries = 0 +main.plugins.bt-tether.devices.ios-phone.share_internet = false +main.plugins.bt-tether.devices.ios-phone.priority = 999 + +main.plugins.fix_services.enabled = true + +main.plugins.gdrivesync.enabled = false +main.plugins.gdrivesync.backupfiles = [''] +main.plugins.gdrivesync.backup_folder = "PwnagotchiBackups" +main.plugin.gdrivesync.interval = 1 + +main.plugins.gpio_buttons.enabled = false + +main.plugins.gps.enabled = false +main.plugins.gps.speed = 19200 +main.plugins.gps.device = "/dev/ttyUSB0" + +main.plugins.grid.enabled = true +main.plugins.grid.report = true +main.plugins.grid.exclude = [ + "YourHomeNetworkHere" +] + +main.plugins.logtail.enabled = false +main.plugins.logtail.max-lines = 10000 + +main.plugins.memtemp.enabled = false +main.plugins.memtemp.scale = "celsius" +main.plugins.memtemp.orientation = "horizontal" + +main.plugins.net-pos.enabled = false +main.plugins.net-pos.api_key = "test" + +main.plugins.onlinehashcrack.enabled = false +main.plugins.onlinehashcrack.email = "" +main.plugins.onlinehashcrack.dashboard = "" +main.plugins.onlinehashcrack.single_files = false +main.plugins.onlinehashcrack.whitelist = [] + +main.plugins.paw-gps.enabled = false +main.plugins.paw-gps.ip = "192.168.44.1:8080" + +main.plugins.pisugar2.enabled = false +main.plugins.pisugar2.shutdown = 5 +main.plugins.pisugar2.sync_rtc_on_boot = false + +main.plugins.session-stats.enabled = true +main.plugins.session-stats.save_directory = "/var/tmp/pwnagotchi/sessions/" + +main.plugins.ups_hat_c.enabled = false +main.plugins.ups_hat_c.label_on = true # show BAT label or just percentage +main.plugins.ups_hat_c.shutdown = 5 # battery percent at which the device will turn off +main.plugins.ups_hat_c.bat_x_coord = 140 +main.plugins.ups_hat_c.bat_y_coord = 0 + +main.plugins.ups_lite.enabled = false +main.plugins.ups_lite.shutdown = 2 + +main.plugins.webcfg.enabled = true + +main.plugins.webgpsmap.enabled = false + +main.plugins.wigle.enabled = false +main.plugins.wigle.api_key = "" +main.plugins.wigle.whitelist = [] +main.plugins.wigle.donate = true + +main.plugins.wpa-sec.enabled = false +main.plugins.wpa-sec.api_key = "" +main.plugins.wpa-sec.api_url = "https://wpa-sec.stanev.org" +main.plugins.wpa-sec.download_results = false +main.plugins.wpa-sec.whitelist = [] + main.iface = "wlan0mon" main.mon_start_cmd = "/usr/bin/monstart" main.mon_stop_cmd = "/usr/bin/monstop" diff --git a/pwnagotchi/utils.py b/pwnagotchi/utils.py index f8f38677..f9e9d117 100644 --- a/pwnagotchi/utils.py +++ b/pwnagotchi/utils.py @@ -223,13 +223,13 @@ def load_config(args): if user_config: config = merge_config(user_config, config) except Exception as ex: - logging.error("There was an error processing the configuration file:\n%s ",ex) + logging.error("There was an error processing the configuration file:\n%s ", ex) sys.exit(1) # dropins dropin = config['main']['confd'] if dropin and os.path.isdir(dropin): - dropin += '*.toml' if dropin.endswith('/') else '/*.toml' # only toml here; yaml is no more + dropin += '*.toml' if dropin.endswith('/') else '/*.toml' # only toml here; yaml is no more for conf in glob.glob(dropin): with open(conf) as toml_file: additional_config = toml.load(toml_file)