Upgrade to Pro — share decks privately, control downloads, hide ads and more …

pwnagotchi で遊ぼう(AVTOKYO2020)

k0uj1k
October 31, 2020

pwnagotchi で遊ぼう(AVTOKYO2020)

pwnagotchi (ポーナゴッチ)はかわいい顔をしてWi-Fiアタックをする、たまごっちにインスパイアされたオープンソースの電子ペットツールです。Raspberry Pi Zero W と 2.13インチの e-ink display の小さな本体とモバイルバッテリーだけなので、連れて歩くと楽しくなります。
pwnagotchi は Wi-Fi APに話しかけ、WAPハンドシェイクを食べて pcap ファイルを集めます。
そんな、かわいいcool(⌐■_■)な pwnagotchi に魅せられた k0uj1k が pwnagotchi の遊び方と、とてもよくできた世界観を紹介します。

k0uj1k

October 31, 2020
Tweet

Other Decks in Technology

Transcript

  1. Who am I {k0uj1k (twitter: @k0uj1k1)} セキュリティとIoTをちょっとかじっている人 Pwnagotchi が日本語を話せるようにローカライズの ベースを構築しました。

    Pwnagotchi に、はまったので遊ぶ仲間を増やしたいと思っています。 遊び方をQiitaで紹介しています。 https://qiita.com/k0uj1k/items/f91a3b7e3a4b9209774f I’m interested in Cyber Security and IoT. Pwnagotchi can speak Japanese in my work. I’m fascinated Pwnagotchi and make friends to play it. I wrote Qiita how to play Pwnagotchi in Japanese.
  2. Pwnagotchi っておいしいの? Wi-Fi WPA 4Way handshakeを食べる(キャプチャする)と元気に なる楽しいガジェットです。 Pwn + たまごっち(tamagotchi)

    ⇒ Pwnagotchi (ポーナゴッチ) Pwnagotchi は python で書かれています。 2019年10月 v1.0.0 イタリア生まれ @evilsocketさんから発表 2019年秋 v 1.4.3 がブレイク 2020年春 v 1.5.1 から日本語もOK 2020年夏 v 1.5.3 (現在) 4way handshake の詳しいことは、IPUSIRON著 「ハッキング・ラボのつくりかた」p.560 参照のこと What’s Pwnagotchi? Pwnagotchi has cute face gadget to eat WAP handshakes. Pwnagotchi movement spreads worldwide to Japan.
  3. つくろう! お家に Raspberry Pi が暇していませんか? そんなあなたに Pwnagotchi をおすすめします。 https://pwnagotchi.ai/installation/ zipファイルを解凍

    img ファイルを抽出ラズパイのSDカードの作り方と同じ Make Pwnagotchi ! Make Pwnagotchi for Raspberry Pi in your toy box. Download zip file, unzip it and install img file to micro-SD (TF) card.
  4. E-ink ディスプレイがあると楽しい Waveshare 2.13” e-Paper HAT E-Ink display 白黒がおすすめです。 https://www.aliexpress.com/item/32810080308.html?spm=a2g0s.90423

    11.0.0.430a4c4dxl1BFF 秋葉原の千石電商で2220円で購入できます。 https://www.sengoku.co.jp/mod/sgk_cart/detail.php?code=EEHD-58WP Pimoroni Inky pHAT (ePaper/eInk/EPD) – Black/White も対応しています。 E-ink display (recommend) You can get it 2220 Yen at Sengoku-densho in Akihabara.
  5. モバイルバッテリー 皆さんお持ちのモバイルバッテリーでOKです。 省電力で電池長持ち:1000mAh で1時間以上活動します。 UPS-Lite https://www.aliexpress.com/item/32954180664.html Raspberry Pi Zero Wと一体にできます。

    1000mhAなのでちょっと容量がほしいです。 はんだ付けがイマイチだと接触が心配になります。 Mobile Battery Low power over an hour per 1000mAh. No mobile Battery. Need more capacity. Need soldering skill for stability.
  6. 日本語設定しよう。(よかったら) SDカードに書き込んだ直後にSDカードのFAT領域に config.toml ファイ ルを新規作成し下記を設定して起動します。 または、 英語で起動した後に /etc/pwnagotchi/config.toml を変更してもOKです。 “config.toml”

    main.lang = "jp" ui.font.name = "fonts-japanese-gothic" # for japanese: fonts-japanese-gothic ui.font.size_offset = 1 # will be added to the font size Configure Japanese. Configure config.toml file as above.
  7. 日本語のローカライズ Pwnagotchi は DejaVuSansMono のフォントで表示しています。 DejaVuSansMono に日本語の font set がないため、

    日本語は全て 豆腐に化けてしまいました。 中身を解析して、セリフの表示部に日本語フォント追加して 強引に日本語表示をさせました。 これを見た @dadav さんが、UIフレームワークを改良し (v. 1.5.1から)設定で日本語が表示できるようになりました。 あわせて、日本語のセリフを作り直しました。 こんなことをして日本語を話す Pwnagotchi が誕生しました。 DejaVuSansMono does not have Japanese font set. I modified ui.py to status area to show Japanese correctly. @dadav refactored ui framework to show Japanese. I also updated message to Natural Japanese. Localize to Japanese.
  8. Pwnagotchi の動き #1 [AP名] APを見つけると、話しかけます。 APから拒否されると coolな表情になります。 /root/handshakes に pcap

    ファイルを保存します。 WPA/WPA2 のハンドシェイクを 見つけるとパケットデータを /root/handshakes に pcap ファイルを保存します。 ① ② ②’ AP名 AP名 Store Deauth pcap files. Store Handshakes pcap files. Talk to AP “Let’s be friends”. Pwnagotchi activities #1
  9. Pwnagotchi の動き #2 Channel scan しながらAPを探します。 暇になると寝ます。 さらに暇になると スネます。 ch1

    ch2 ch14 sleep wake up 退屈 ・・・ Search AP in channel scan. Sleep in boring. Angry in too boring. Pwnagotchi activities #2 boring
  10. Pwnagotchi の動き #3 Wi-Fi チャンネル (2.4GHz帯) を効率よく 探すため、最初の30分程度で、 チャンネルごとのAPの状況を学習します。 学習が終わると

    AIモードになります。 channel scan の効率化と 省電力になります。 Pwnagotchi is training AI for Wi-Fi channel in first 30min. AI mode effects power saving. Pwnagotchi activities #3
  11. ブラウザで観察 (UI Web) PC とつないだ場合 10.0.0.2:8080 Android とBTテザリングした場合 192.168.44.44:8080 iPhone

    とBTテザリングした場合 172.20.10.6:8080 いずれも changeme/changeme(初期設定) このボタンを押して 活動開始! AUTO モードへ UI Web in browser For PC For Android For iPhone (default) push / tap to Auto mode
  12. E-inkなし単体起動 (非推奨?) E-inkなし(ラズパイ単体)で 起動しない場合は、 ラズパイの pin24 を ジャンパー線でGNDに 落としましょう。 E-ink

    の busy が解除されて 起動するようになるはずです。 default.toml の設定が waveshare_v2 なので、 /usr/local/lib/python3.7/dist- packages/Pwnagotchi/ui/hw/libs/waves hare/v2/waveshare.py から self.wait_until_idle() で pin24 の Low 待ちをしています。 Headless (not recommended?) Pin24 expects Low.(maybe) Needs pin24 to GND to leave busy state. (maybe)
  13. お友達発見機能 #1 お友達の Pwnagotchi が近くにあると、お友達発見機能で お友達の Pwnagotchi が画面に現れます。 お友達の Pwnagotchi

    の表情と どのくらい近くにいるか、 今いくつ pwn したか、今までいくつ pwn したかを表示します。 Friend detection #1 Pwnagotchi detects friend’s one nearby. Show friend’s status, near level and how may pwned.
  14. お友達発見機能 #2 Wi-Fi の Beacon Frame を使って、お友達を見つけます。 見つけたお友達の情報を交換して /root/peer にお友達のIDの

    json ファイルを残します。 お友達が去ると、さみしくなります。 Friend detection uses Wi-Fi Beacon Frame, gets friend’s info and stores json file in /root/peer. Friend detection #2 Sad face when friend left.
  15. Pwnagotchi の中の人 Bettercap Bettercap caplet Web UI MITM (Man In

    The Middle) 中間者攻撃をします。 Pwnagotchi と Bettercap が連携して動きます。 https://www.bettercap.org/ Pwnagotchi-auto.cap Pwnagotchi-manu.cap AUTO モード MANU モード Pwnagotchi E-ink Bettercap is core module in Pwnagotchi Bettecap attacks MITM. Pwnagotchi talk to Bettercap each other.
  16. Pwnagotchi のさらなる楽しみ #1 Plug-in の世界 Pwnagotchi の plug-inは python script

    です。 公式 plug-in /usr/local/lib/python3.7/dist-packages/Pwnagotchi/plugins 非公式 plug-in /usr/local/share/Pwnagotchi/installed-plugins Fun of Pwnagotchi #1 Plug-in world (Official) (Unofficial)
  17. GPS連携 USB GPS レシーバーで ハンドシェイクをした時のGPS情報を 取得します。 GPSは VK-172 GMOUSE USB

    GPS Receiver が実績 があります。700円程度でした。 https://www.aliexpress.com/item/328663 15335.html?spm=a2g0s.9042311.0.0.799 f4c4dL8a2gy /root/handshake に JSON形式で保存します。 GPSなので、かなり正確に位置が特定できます。 GPS plug-in Pwnagotchi stores geo location when handshake VK-172 is recommend as 700 Yen. Location data stores json format in /root/handshakes. GPS location data is accurate to point your house if you pwned your home.
  18. Bluetooth テザリング スマホの Bluetoothテザリングに、Pwnagotchi がつながると Wi-Fi AP を探しながら、スマホ経由でネットにつながります。 ネットにつながると -

    時刻が正確になります。 - auto-update で最新の状態に更新されます。 - PwnMAIL で Pwnagotchi ユーザだけのメッセージ交換ができます。 Bluetooth テザリングは、スマホの機種によってはかなり苦戦します。 BT tethering Pwnagotchi connect to internet by BT tethering. When BT tethered System time adjusts. Auto-update enables. PwnMail is available. BT tethering needs skill depending on smart phone type.
  19. 非公式 plug-in root@pwnagotchi:/home/pi# pwnagotchi plugins list ------------------------------------------------- | Plugin |

    Version | Active | Status | ------------------------------------------------- | aircrackonly | 1.0.1 | - | available | | auto_backup | 1.0.0 | - | available | | buttonshim | 0.0.2x | - | available | | christmas | 1.2.0 | - | available | | clock | 1.0.2 | - | available | |gpio_shutdown | 1.0.0 | - | available | |handshakes-dl | 0.1.0 | - | available | | hashie | 1.0.0 | - | available | | mastodon | 1.0.0 | - | available | | quickdic | 1.0.0 | - | available | |screen_refresh| 1.0.0 | - | available | | telegram | 1.0.0 | - | available | | twitter | 1.0.0 | - | available | ------------------------------------------------- コマンドラインでインストール コマンドラインで有効化すると あとはWeb UIで enable /disable が 設定できます。 ネットにつなげて auto-update で さらにplug--in が増えます。 Unofficial plug-in Install new plug-in by command. Enable in Web UI after install Increase plug-in after auto-update
  20. discord (非公式) #pwnfeed webhook は Czechballさんに発行をお願いしました。 1.discord plug-in を右の How

    to install に従ってインストールします。 2.webhookを介して user botに接続します。 3.活動状況を自動投稿できます。 (Unofficial) See How to install
  21. Aircrack-ng ごにょごにょ 弱いとばれる! IPUSIRON著 「ハッキング・ラボのつくりかた」p.567 参照のこと quickdic plug-inでは Pwnagotchi 本体でハンドシェイク

    がみつかると Aircrack-ng を起動して解析します。 しかし、 Top4800-WPA-probable-v2.txtでも 6分もかかるので、 おすすめしません。 Weak key exposes quickly. quickdic plug-in calls Aircrack-ng. But a pcap file takes 6 min per 4,800 keys. It’s tough for Rp Zero Pwnagotchi.
  22. hashcat hashcat –m 2500 で解析します。 辞書アタックが現実的です。 ブルートフォースアタックは、10文字超えると計算時間が年単位になります。 Google Colaboratory でも何十年もかかり非現実的です。

    がんばっても、今のところ無駄なので、やめましょう。 Session..........: hashcat Status...........: Running Hash.Name........: WPA-EAPOL-PBKDF2 Hash.Target......: damedame_xxxxxxxxxxxx.hccapx Time.Started.....: Sat Aug 1 13:14:02 2020 (11 secs) Time.Estimated...: Sun Nov 14 05:37:24 2038 (18 years, 104 days) Guess.Mask.......: ?l?l?l?l?l?l?l?l?d?d?d [11] Guess.Queue......: 1/1 (100.00%) Speed.#1.........: 361.9 kH/s (54.92ms) @ Accel:8 Loops:256 Thr:1024 Vec:1 Recovered........: 0/6 (0.00%) Digests Progress.........: 3932160/208827064576000 (0.00%) Rejected.........: 0/3932160 (0.00%) Restore.Point....: 0/8031810176000 (0.00%) Restore.Sub.#1...: Salt:0 Amplifier:12-13 Iteration:1792-2048 Candidates.#1....: harierin123 -> hoapjane123 Hardware.Mon.#1..: Temp: 49c Util:100% Core:1290MHz Mem:5000MHz Bus:16 wpa-sec plug-inでは https://wpa-sec.stanev.org/に pcapを upload することで分散解析をします。 ここでは有志によるGPUリソースの提供で成り 立っているので、GPUリソースの提供に協力して あげないと成り立ちません。 Dictionary attack is reasonable time. Brute-force attack wastes CPU, GPU and time. wpa-sec plug-in based on give and take.
  23. Pwnagotchi のさらなる楽しみ #4 基板むき出しに抵抗感がある。 謎のリセットが気になる。 thingiverse.com から Pwnagotchi の 3Dプリントケースの

    プリントデータが freeでダウンロードできます。 E-ink display の種類に合わせてケースを造形しましょう。 手作り感満載ですが、いい感じに収まります。 3D プリントケース そんなあなたに Fun of Pwnagotchi #4 3D printing case If you need case for Pwnagotchi. Thingverse site can download many case data for Pwnagotchi Good shape in handmade.
  24. 一緒にお出かけしよう! ハンドシェイクを捕まえよう! 駅ビルのカフェ ショッピングモール 団地 ホテル 新幹線 人の集まるところにハンドシェイクあり! (マスクも忘れずに) Go

    out with Pwnagotchi. Capture the handshakes Café, shopping mail, apartment, hotel and Shinkansen are good place for capturing handshakes. Crowd place is the chance for handshakes. Don’t forget MASK!