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

BadUSBを作ろう / how to make your own BadUSB and Ke...

mu2in
June 29, 2019

BadUSBを作ろう / how to make your own BadUSB and Keyboard

BadUSBを作ってみた話です。

「オープンセミナー2019@岡山 懇親会」でのLT資料です。 https://oso.connpass.com/event/129843/

mu2in

June 29, 2019
Tweet

More Decks by mu2in

Other Decks in Technology

Transcript

  1. ‣ @mu2in ‣ JavaΤϯδχΞ6೥໨ ‣ ޷͖ͳϓϩάϥϛϯάݴޠɿJavaScript ‣ ࢀՃίϛϡχςΟ ▹ ͍͢͝޿ౡ

    (ਫ༵΋͘΋͘ձ) ओ࠵ ▹ PyCon mini Hiroshima 2019 ▹ Φʔϓϯηϛφʔ2020@޿ౡ ࣗݾ঺հ
  2. BadUSBͱ͸ ‣ 2014೥8݄ʹ։ൃऀձٞ Black Hat 2014 USAͰ ൃද͞Εͨ߈ܸख๏ ▹ USBͷϑΝʔϜ΢ΣΞΛॻ͖׵͑Δ͜ͱʹΑͬͯɺෆਖ਼ͳ

    ϓϩάϥϜΛ࣮ߦ͢Δ͜ͱ͕Ͱ͖Δɻ ▹ Өڹ͕େ͖͍ͨΊɺ࣮ূίʔυΛެ։͞Ε͍ͯͳ͔ͬͨɻ ‣ ཌ݄ͷ9݄ʹߦΘΕͨηΩϡϦςΟձٞͷ DerbyCon 4.0 Ͱผͷݚڀऀ͕GitHubʹެ։ ▹ USBΩʔϘʔυͷϑΝʔϜ΢ΣΞΛॻ͖׵͑ͯɺ
 উखʹΩʔΛೖྗͤ͞ΔσϞ͕ߦΘΕͨɻ
  3. ༻ҙ͢Δ΋ͷ • CJMCU Beetle ▹ Arduino Leonardoޓ׵ͷϚΠίϯ • HID(ώϡʔϚϯΠϯλʔϑΣʔεσ όΠε)ͱͯ͠ৼ෣͏͜ͱ͕Ͱ͖Δ

    • USBΦε͕෇͍ͯΔͨΊ௚ૠ͠Մೳ • ී௨ͷUSBϝϞϦΑΓ΋খ͍͞ • AmazonͰ¥1,000 தࠃ௚༌ೖ¥300
  4. • Ruby Kaigi 2017Ͱ໯ͬͨण࢘ΩʔΩϟοϓ
 ( Misoca͞ΜϒʔεΑΓ ) • CJMCU Beetle

    • Cherry MXΩʔεΠον • Cherry MX Switch Breakout • μΠΦʔυɺ఍߅ • ϐϯϔομ • LED • δϟϯύʔϫΠϠʔ • ϒϨουϘʔυ ༻ҙ͢Δ΋ͷ
  5. #include <Keyboard.h> #define PIN_KEYSW (0) int preState; int currentState; void

    setup() { pinMode(PIN_KEYSW, INPUT); preState = HIGH; Keyboard.begin(); } void loop() { currentState = digitalRead(PIN_KEYSW); if((currentState != preState) && (currentState == HIGH)) { Keyboard.press(KEY_LEFT_ALT); Keyboard.print("d83c"); Keyboard.print("df63"); delay(10); Keyboard.releaseAll(); } preState = currentState; delay(10); } ण࢘ΩʔϘʔυͷίʔυΛॻ͖͜Ή Ωʔ͕ԡ͞ΕͨΒ 6OJDPEFೖྗͰ ͷαϩήʔτϖΞΛೖྗ