diff --git a/Makefile b/Makefile index 2c485719..659f6f78 100644 --- a/Makefile +++ b/Makefile @@ -14,17 +14,17 @@ install: curl https://releases.hashicorp.com/packer/$(PACKER_VERSION)/packer_$(PACKER_VERSION)_linux_amd64.zip -o /tmp/packer.zip unzip /tmp/packer.zip -d /tmp sudo mv /tmp/packer /usr/bin/packer - git clone https://github.com/solo-io/packer-builder-arm-image /tmp/packer-builder-arm-image - cd /tmp/packer-builder-arm-image && go get -d ./... && go build - sudo cp /tmp/packer-builder-arm-image/packer-builder-arm-image /usr/bin + git clone https://github.com/solo-io/packer-plugin-arm-image /tmp/packer-plugin-arm-image + cd /tmp/packer-plugin-arm-image && go get -d ./... && go build + sudo cp /tmp/packer-plugin-arm-image/packer-plugin-arm-image /usr/bin image: cd builder && sudo /usr/bin/packer build -var "pwn_hostname=$(PWN_HOSTNAME)" -var "pwn_version=$(PWN_VERSION)" pwnagotchi.json - sudo mv builder/output-pwnagotchi/image pwnagotchi-raspbian-lite-$(PWN_VERSION).img - sudo sha256sum pwnagotchi-raspbian-lite-$(PWN_VERSION).img > pwnagotchi-raspbian-lite-$(PWN_VERSION).sha256 - sudo zip pwnagotchi-raspbian-lite-$(PWN_VERSION).zip pwnagotchi-raspbian-lite-$(PWN_VERSION).sha256 pwnagotchi-raspbian-lite-$(PWN_VERSION).img + sudo mv builder/output-pwnagotchi/image pwnagotchi-raspberrypi-os-lite-$(PWN_VERSION).img + sudo sha256sum pwnagotchi-raspberrypi-os-lite-$(PWN_VERSION).img > pwnagotchi-raspberrypi-os-lite-$(PWN_VERSION).sha256 + sudo zip pwnagotchi-raspberrypi-os-lite-$(PWN_VERSION).zip pwnagotchi-raspberrypi-os-lite-$(PWN_VERSION).sha256 pwnagotchi-raspberrypi-os-lite-$(PWN_VERSION).img clean: rm -rf /tmp/packer-builder-arm-image - rm -f pwnagotchi-raspbian-lite-*.zip pwnagotchi-raspbian-lite-*.img pwnagotchi-raspbian-lite-*.sha256 + rm -f pwnagotchi-raspberrypi-os-lite-*.zip pwnagotchi-raspberrypi-os-lite-*.img pwnagotchi-raspberrypi-os-lite-*.sha256 rm -rf builder/output-pwnagotchi builder/packer_cache diff --git a/README.md b/README.md index 9a2f6522..88d92cc3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pwnagotchi -

+

Release Software License Contributors @@ -10,16 +10,16 @@ follow on Twitter

-[Pwnagotchi](https://pwnagotchi.ai/) is an [A2C](https://hackernoon.com/intuitive-rl-intro-to-advantage-actor-critic-a2c-4ff545978752)-based "AI" leveraging [bettercap](https://www.bettercap.org/) that learns from its surrounding WiFi environment to maximize the crackable WPA key material it captures (either passively, or by performing authentication and association attacks). This material is collected as PCAP files containing any form of handshake supported by [hashcat](https://hashcat.net/hashcat/), including [PMKIDs](https://www.evilsocket.net/2019/02/13/Pwning-WiFi-networks-with-bettercap-and-the-PMKID-client-less-attack/), +[Pwnagotchi](https://pwnagotchi.ai/) is an [A2C](https://hackernoon.com/intuitive-rl-intro-to-advantage-actor-critic-a2c-4ff545978752)-based "AI" leveraging [bettercap](https://www.bettercap.org/) that learns from its surrounding Wi-Fi environment to maximize the crackable WPA key material it captures (either passively, or by performing authentication and association attacks). This material is collected as PCAP files containing any form of handshake supported by [hashcat](https://hashcat.net/hashcat/), including [PMKIDs](https://www.evilsocket.net/2019/02/13/Pwning-WiFi-networks-with-bettercap-and-the-PMKID-client-less-attack/), full and half WPA handshakes. ![ui](https://i.imgur.com/X68GXrn.png) -Instead of merely playing [Super Mario or Atari games](https://becominghuman.ai/getting-mario-back-into-the-gym-setting-up-super-mario-bros-in-openais-gym-8e39a96c1e41?gi=c4b66c3d5ced) like most reinforcement learning-based "AI" *(yawn)*, Pwnagotchi tunes [its parameters](https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/defaults.toml) over time to **get better at pwning WiFi things to** in the environments you expose it to. +Instead of merely playing [Super Mario or Atari games](https://becominghuman.ai/getting-mario-back-into-the-gym-setting-up-super-mario-bros-in-openais-gym-8e39a96c1e41?gi=c4b66c3d5ced) like most reinforcement learning-based "AI" *(yawn)*, Pwnagotchi tunes [its parameters](https://github.com/evilsocket/pwnagotchi/blob/master/pwnagotchi/defaults.toml) over time to **get better at pwning Wi-Fi things to** in the environments you expose it to. More specifically, Pwnagotchi is using an [LSTM with MLP feature extractor](https://stable-baselines.readthedocs.io/en/master/modules/policies.html#stable_baselines.common.policies.MlpLstmPolicy) as its policy network for the [A2C agent](https://stable-baselines.readthedocs.io/en/master/modules/a2c.html). If you're unfamiliar with A2C, here is [a very good introductory explanation](https://hackernoon.com/intuitive-rl-intro-to-advantage-actor-critic-a2c-4ff545978752) (in comic form!) of the basic principles behind how Pwnagotchi learns. (You can read more about how Pwnagotchi learns in the [Usage](https://www.pwnagotchi.ai/usage/#training-the-ai) doc.) -**Keep in mind:** Unlike the usual RL simulations, Pwnagotchi learns over time. Time for a Pwnagotchi is measured in epochs; a single epoch can last from a few seconds to minutes, depending on how many access points and client stations are visible. Do not expect your Pwnagotchi to perform amazingly well at the very beginning, as it will be [exploring](https://hackernoon.com/intuitive-rl-intro-to-advantage-actor-critic-a2c-4ff545978752) several combinations of [key parameters](https://www.pwnagotchi.ai/usage/#training-the-ai) to determine ideal adjustments for pwning the particular environment you are exposing it to during its beginning epochs ... but ** listen to your Pwnagotchi when it tells you it's boring!** Bring it into novel WiFi environments with you and have it observe new networks and capture new handshakes—and you'll see. :) +**Keep in mind:** Unlike the usual RL simulations, Pwnagotchi learns over time. Time for a Pwnagotchi is measured in epochs; a single epoch can last from a few seconds to minutes, depending on how many access points and client stations are visible. Do not expect your Pwnagotchi to perform amazingly well at the very beginning, as it will be [exploring](https://hackernoon.com/intuitive-rl-intro-to-advantage-actor-critic-a2c-4ff545978752) several combinations of [key parameters](https://www.pwnagotchi.ai/usage/#training-the-ai) to determine ideal adjustments for pwning the particular environment you are exposing it to during its beginning epochs ... but ** listen to your Pwnagotchi when it tells you it's boring!** Bring it into novel Wi-Fi environments with you and have it observe new networks and capture new handshakes—and you'll see. :) Multiple units within close physical proximity can "talk" to each other, advertising their presence to each other by broadcasting custom information elements using a parasite protocol I've built on top of the existing dot11 standard. Over time, two or more units trained together will learn to cooperate upon detecting each other's presence by dividing the available channels among them for optimal pwnage. @@ -29,13 +29,13 @@ https://www.pwnagotchi.ai ## Links -  | Official Links ----------|------- -Website | [pwnagotchi.ai](https://pwnagotchi.ai/) -Forum | [community.pwnagotchi.ai](https://community.pwnagotchi.ai/) -Slack | [pwnagotchi.slack.com](https://invite.pwnagotchi.ai/) -Subreddit | [r/pwnagotchi](https://www.reddit.com/r/pwnagotchi/) -Twitter | [@pwnagotchi](https://twitter.com/pwnagotchi) +|   | Official Links | +|-----------|-------------------------------------------------------------| +| Website | [pwnagotchi.ai](https://pwnagotchi.ai/) | +| Forum | [community.pwnagotchi.ai](https://community.pwnagotchi.ai/) | +| Slack | [pwnagotchi.slack.com](https://invite.pwnagotchi.ai/) | +| Subreddit | [r/pwnagotchi](https://www.reddit.com/r/pwnagotchi/) | +| Twitter | [@pwnagotchi](https://twitter.com/pwnagotchi) | ## License diff --git a/builder/data/etc/systemd/system/pwngrid-peer.service b/builder/data/etc/systemd/system/pwngrid-peer.service index 76ad4b6e..9cbc43dd 100644 --- a/builder/data/etc/systemd/system/pwngrid-peer.service +++ b/builder/data/etc/systemd/system/pwngrid-peer.service @@ -7,9 +7,9 @@ After=bettercap.service [Service] Type=simple PermissionsStartOnly=true -ExecStart=/usr/bin/pwngrid -keys /etc/pwnagotchi -address 127.0.0.1:8666 -client-token /root/.api-enrollment.json -wait -log /var/log/pwngrid-peer.log -iface mon0 +ExecStart=/usr/local/bin/pwngrid -keys /etc/pwnagotchi -address 127.0.0.1:8666 -client-token /root/.api-enrollment.json -wait -log /var/log/pwngrid-peer.log -iface mon0 Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/builder/data/usr/bin/bettercap-launcher b/builder/data/usr/bin/bettercap-launcher index 3bc21855..d42f85b4 100755 --- a/builder/data/usr/bin/bettercap-launcher +++ b/builder/data/usr/bin/bettercap-launcher @@ -22,7 +22,7 @@ fi start_monitor_interface if is_auto_mode_no_delete; then - /usr/bin/bettercap -no-colors -caplet pwnagotchi-auto -iface mon0 + /usr/local/bin/bettercap -no-colors -caplet pwnagotchi-auto -iface mon0 else - /usr/bin/bettercap -no-colors -caplet pwnagotchi-manual -iface mon0 + /usr/local/bin/bettercap -no-colors -caplet pwnagotchi-manual -iface mon0 fi diff --git a/builder/data/usr/bin/pwnlib b/builder/data/usr/bin/pwnlib index 0e45d259..58b93677 100755 --- a/builder/data/usr/bin/pwnlib +++ b/builder/data/usr/bin/pwnlib @@ -33,7 +33,8 @@ reload_brcm() { # starts mon0 start_monitor_interface() { - iw phy "$(iw phy | head -1 | cut -d" " -f2)" interface add mon0 type monitor && ifconfig mon0 up + rfkill unblock all + ifconfig wlan0 up && iw phy "$(iw phy | head -1 | cut -d" " -f2)" interface add mon0 type monitor && ifconfig mon0 up } # stops mon0 diff --git a/builder/pwnagotchi.json b/builder/pwnagotchi.json index 8f1a0958..1438779e 100644 --- a/builder/pwnagotchi.json +++ b/builder/pwnagotchi.json @@ -3,8 +3,8 @@ { "name": "pwnagotchi", "type": "arm-image", - "iso_url": "https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-07-12/2019-07-10-raspbian-buster-lite.zip", - "iso_checksum": "9e5cf24ce483bb96e7736ea75ca422e3560e7b455eee63dd28f66fa1825db70e", + "iso_url": "https://downloads.raspberrypi.org/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2022-04-07/2022-04-04-raspios-buster-armhf-lite.img.xz", + "iso_checksum": "42fd907a0da36b8a8ce9db9cd1cb77746b6a10c4b77f8d0ae0b8065a3b358a37", "last_partition_extra_size": 3221225472 } ], diff --git a/builder/pwnagotchi.yml b/builder/pwnagotchi.yml index 0ee66708..741b6999 100644 --- a/builder/pwnagotchi.yml +++ b/builder/pwnagotchi.yml @@ -53,6 +53,10 @@ - triggerhappy - wpa_supplicant - nfs-common + - libraspberrypi0 + - libraspberrypi-dev + - libraspberrypi-doc + - libraspberrypi-bin install: - rsync - vim diff --git a/requirements.txt b/requirements.txt index df47e7fb..e54f6ef0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,10 +3,10 @@ requests==2.21.0 PyYAML==5.3.1 scapy==2.4.3 gym==0.14.0 -scipy==1.3.1 +scipy stable-baselines==2.7.0 -tensorflow==1.13.1 -tensorflow-estimator==1.14.0 +tensorflow==1.15.0 +tensorflow-estimator==1.15.1 tweepy==3.7.0 file-read-backwards==2.0.0 numpy==1.20.2 @@ -15,6 +15,9 @@ smbus2==0.3.0 Pillow==5.4.1 spidev==3.4 gast==0.2.2 +itsdangerous==1.1.0 +markupsafe==1.1.1 +Werkzeug==0.14.1 flask==1.0.2 flask-cors==3.0.7 flask-wtf==0.14.3 @@ -22,3 +25,4 @@ dbus-python==1.2.12 toml==0.10.0 python-dateutil==2.8.1 websockets==8.1 +RPi.GPIO