Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ファームウェア解析に触れてみよう!/OWASPKansai_FSTM_230422
Search
OWASP Kansai
April 22, 2023
Technology
1.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ファームウェア解析に触れてみよう!/OWASPKansai_FSTM_230422
https://owasp-kansai.doorkeeper.jp/events/153928
OWASP Kansai
April 22, 2023
More Decks by OWASP Kansai
See All by OWASP Kansai
owaspkansaiday-lt1-260214
owaspkansai
0
55
OWASP KansaiDAY 2025.09_文系OSINTハンズオン
owaspkansai
0
160
OWASP Kansai DAY 2024.09 〜10周年記念セキュリティ・マシマシ全部盛り〜/OWASPKansai_10thanniv_240921
owaspkansai
0
160
孫に買ったプログラミング教材がすごかった話/owaspkansainight-lt3-220727
owaspkansai
0
750
事前準備_ファームウェア解析に触れてみよう!
owaspkansai
0
480
ECサイトの脆弱性診断をいい感じにやりたい/OWASPKansaiNight_LT1_220727
owaspkansai
0
1.1k
デジタル・ディバイドについて/OWASPKansaiNight_LT2_220216
owaspkansai
0
650
OWASP_Kansai_LT3_211124.pdf
owaspkansai
0
280
ITセキュリティにおける社外活動と社内活動の一事例 / Lifehack on cyber security
owaspkansai
0
330
Other Decks in Technology
See All in Technology
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
270
並行性の問題を防げ!実践トランザクション入門
occhi
0
260
[2026 Oracle Technical Deep Dive] OCI AI Resilience -OCIのセキュリティ対策機能をきちんと使いこなす- (2026年9月17日開催)
oracle4engineer
PRO
0
120
DAMOS - The Smart Cruise Control for RAM
ennael
PRO
1
130
AI Made Us Faster at Solving the Wrong Problems
marceloancelmo
0
160
生成AIと進める探索的データ分析(2026.10.03 第122回Tokyo.R勉強会)
tatamiya
2
1.4k
[2026-09-30]ロックンロールは鳴り止まないっ - 信頼性かまってちゃん - 「データ駆動を投げ捨ててまで。」追いかける信頼性改善に向けた取り組みの話
tosite
0
200
全社共通データ基盤をつくる。ソニーのDatabricks活用とデータガバナンス設計の裏側
sony
0
410
Codex概要
ymiya55
0
380
2026-10-01_MagicPod_QAハーネスエンジニアリングとQA組織の未来像
ynisqa1988
1
520
The Maintainer Container - remaining a saner maintainer
ennael
PRO
1
100
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
2
790
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
460
Writing Fast Ruby
sferik
630
63k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Limits of Empathy - UXLibs8
cassininazir
1
700
A Tale of Four Properties
chriscoyier
163
24k
Transcript
オワスプカンサイ ~RE:BORN~ 2023.04 ファームウェア解析に触れてみよう! OWASP Kansai 森田智彦
ファームウェア解析 概要
本日のスケジュール • 10分 会場説明/イベント説明 • 20分 ツールのインストール • 30分 binwalk
ファームウェアの展開 • 30分 firmwalker 機微な情報の探索 • 30分 firmadyne ファームウェアのエミュレート • 30分 自習 • 30分 成果報告・まとめ
IoTのセキュリティ • IoT、組込み機器 – 通信モジュール – サーバ機能 – クライアント機能 –
ファームウェア – 基板、デバッグポート – 初期設定値 • サーバ – Webアプリ – 既知の脆弱性スキャン • アプリ – PCソフト – モバイルアプリ • システム全体 – 独自プロトコル – サービス仕様
なぜファームウェア解析?(by ChatGPT) • セキュリティ上のリスク: – IoTデバイスのファームウェアが解析されると、攻撃者がシステムにアクセスして、機密情報や個人情報を盗むことができます。 • 機能上のリスク: – ファームウェアの解析により、製品の機能やパフォーマンスが悪化する可能性があります。このような問題は、製品の品質を低
下させ、消費者からの不満や苦情を引き起こすことがあります。 • 法的リスク: – IoTデバイスのファームウェアが解析された場合、知的財産権侵害や競合他社の知識の不正取得など、法的問題が発生する可能 性があります。 • ブランドイメージ上のリスク: – ファームウェアの解析によって、IoTデバイスの脆弱性が明らかになり、消費者からの信頼を失う可能性があります。これによ り、企業のブランドイメージに悪影響が出ることがあります。 • コスト上のリスク: – ファームウェアの解析によって、セキュリティの強化や製品の改良に必要なコストが増加することがあります。また、IoTデバ イスを更新するために、消費者に費用がかかることがあるため、市場シェアを失う可能性があります。
なぜファームウェア解析?(補足) • ファームウェアは誰でも手に入る(実機不要) • ファームウェアは全機器共通 • ファームウェアはある種の設計図 • 今回のハンズオンの目的 –
ファームウェアが解析されることによるリスクを体感 – セキュアな製品開発にむけた気付きを得る
OWASPのファームウェア解析プロジェクト FSTM • OWASP Firmware Security Testing Methodology – https://github.com/scriptingxss/owasp-fstm
– https://coky-t.gitbook.io/owasp-fstm-ja/
None
インストール手順
Linux terminalの基本操作 • 入力補完 Tab → • コピー&ペースト Ctrl+Shift+C Ctrl+Shift+V
• 処理の停止 Ctrl+C • ファイル一覧の表示 ls ls -la • ディレクトリの表示 pwd • ディレクトリの移動 cd ./ディレクトリ cd ../ • ファイルの削除 rm ファイル rm -r ディレクトリ • ファイルの出力 cat ファイル • 文字列の検索 grep -inr キーワード ディレクトリ grep -n5 キーワード ファイル
今回使うツール • stage3:ファームウェアの解析 – binwalk:バイナリ展開ツール – sasquatch:ファイルシステムの展開補助プラグイン – openssl:ファームウェアの暗号化 •
stage5: ファイルシステムコンテンツの解析 – firmwalker:コンテンツ探索ツール • stage6:ファームウェアのエミュレート – firmadyne :エミュレータ – firmware-analysis-toolkit(fat):エミュレータの自動化ツール – nmap,sslscan :ポートスキャンツール https://github.com/ReFirmLabs/binwalk/ https://github.com/devttys0/sasquatch/ https://github.com/craigz28/firmwalker/ https://github.com/firmadyne/firmadyne/ https://github.com/attify/firmware-analysis-toolkit/
今回使うファームウェア • FSTMや各種プロジェクトで例示されたファームウェアを利用 – stage3: Damn Vulnerable Router Firmware (DVRF)
v0.3 • Linksys E1550にインストール可能な学習用ファームウェア – stage5: xxx社製 xxx • firmwalker用 sampleファームウェア(展開済み) – stage6: Netgear社製 WNAP320 v2.0.3 • firmadyne用sampleファームウェア • 自習課題 – 企業のサポートサイトから任意のファームウェアをダウンロード
今回のファイル&ディレクトリ構成 /home/kali /tmp ・・・ mkdir tmp でフォルダ作成、ツール置き場 /sasquatch /firmware-analysis-toolkit /firmadyne
/firmwalker /Downloads ・・・ sampleファームウェア格納用(3種類以上) /stage3 /firmware.bin /_firmware.bin.extracted /stage5 /stage6
インストール手順・概要 • binwalkを削除(バグ) • sasquatchのインストール • firmware-analysis-toolkit(fat)のインストール – binwalkの再インストール •
firmadyneのインストール • firmwalkerのインストール
インストール手順 1/5 # binwalkの削除 binwalk -h # binwalkのhelpが出力されることを確認 sudo apt
update sudo apt remove binwalk # Do you want to continue? [Y/n] y binwalk -h # binwalkのhelpが出力さないことを確認 # ツール用のフォルダ作成 cd mkdir tmp
インストール手順 2/5 # sasquatchのインストール(パッチ適用) cd cd tmp git clone https://github.com/devttys0/sasquatch
cd sasquatch wget https://github.com/devttys0/sasquatch/pull/51.patch && patch -p1 <51.patch ls sudo ./build.sh # continue? [Y/n] y 参考:Binwalkエラー時のsasquatchのパッチ適用について https://github.com/ReFirmLabs/binwalk/issues/618
インストール手順 3/5 # fatのインストール cd cd tmp git clone https://github.com/attify/firmware-analysis-toolkit
cd firmware-analysis-toolkit ls sudo ./setup.sh # 数分かかります→ binwalk自動DL cd binwalk ls sudo python3 setup.py install # binwalkが再インストールされる sudo ./deps.sh # Continue [y/N]? y binwalk -h # binwalkのhelpが出力
インストール手順 4/5 # firmadyneのインストール cd cd tmp sudo apt-get install
busybox-static fakeroot git dmsetup kpartx netcat- openbsd nmap python-psycopg2 python3-psycopg2 snmp uml-utilities util- linux vlan git clone --recursive https://github.com/firmadyne/firmadyne.git cd ./firmadyne ./download.sh # ビルド済みバイナリの追加DL
インストール手順 5/5 # firmwalkerのダウンロード cd cd tmp # git clone
https://github.com/craigz28/firmwalker git clone https://github.com/scriptingxss/firmwalker #fork版
ファームウェアのダウンロード 1/3 # stage3用のファームウェア(DVRF_v03.bin)のダウンロード # ブラウザからDL https://github.com/praetorian-inc/DVRF/blob/master/Firmware/DVRF_v03.bin cd cd Downloads
ls mkdir stage3 mv DVRF_v03.bin stage3 # 混同しないように別フォルダに移動
ファームウェアのダウンロード 2/3 # stage5用のファームウェア(squashfs-root.zip)のダウンロード # ブラウザからsquashfs-root.zipをDL https://1drv.ms/f/s!AucQMYXJNefdvGZyeYt16H72VCLv cd cd Downloads
ls mkdir stage5 mv squashfs-root.zip stage5 # 混同しないように別フォルダに移動 cd stage5 unzip squashfs-root.zip # zipを展開しておく ls
ファームウェアのダウンロード 3/3 # stage6用のファームウェアのダウンロード cd cd Downloads wget http://www.downloads.netgear.com/files/GDC/WNAP320/WNAP320%20Firmware%20Version%202 .0.3.zip
ls mkdir stage6 mv WNAP320¥ Firmware¥ Version¥ 2.0.3.zip stage6 # 別フォルダに cd stage6 unzip WNAP320¥ Firmware¥ Version¥ 2.0.3.zip # zipを展開しておく→ WNAP320_V2.0.3_firmware.tar
stage3: ファームウェアの解析
stage3のゴール • binwalkの習得 • ファームウェア暗号化とエントロピーの関係把握 • ファイルシステム、ディレクトリ構造の概要把握
binwalkの前に cd cd Downloads/stage3 file “bin” strings “bin” strings -n10
“bin” strings “bin” | grep key hexdump -C -n 512 “bin” > hexdump.out hexdump -C “bin” | head -n 20 hexdump -C “bin” | tail -n 20 hexdump -vC “bin” | tail -n 20 “bin”:DVRF_v03.bin 展開する前のファームウェア
binwalkの実行 cd cd Downloads/stage3 binwalk -Me DVRF_v03.bin
binwalkの実行結果確認① cd cd Downloads/stage3 cd _DVRF_v03.bin.extracted tree tree -d
binwalkの実行結果確認② cd cd Downloads/stage3 cd _DVRF_v03.bin.extracted pwd file:// + パス
Firefoxを立ち上げる
binwalkによるエントロピー解析 cd cd Downloads/stage3 binwalk -E DVRF_v03.bin
演習課題① binwalkを使いこなす • binwalkのオプションをさわってみる – ヘルプを見ながら、さまざまな機能を試してみよう • 出力結果の確認 – 展開されたファイル群を読んでみる
• ファイルシステム?アーキテクチャ?
演習課題② 暗号化とエントロピー • 暗号化したファームウェアのエントロピー確認 – 出力結果に違いは? cd cd Downloads/stage3 binwalk
-E DVRF_v03.bin openssl enc -aes-256-cbc -e -in DVRF_v03.bin -out enc.bin binwalk -Me enc.bin binwalk -E enc.bin
stage5:ファイルシステムコンテンツの解析
stage5のゴール • firmwalkerの習得 • 可読なファイル、機微なファイルの探索方法の理解
firmwalkerの実行 1/3 cd cd tmp/firmwalker ./firmwalker.sh /home/kali/Downloads/stage5/squashfs-root
firmwalkerの実行 2/3 • Error: Please run "shodan init <api key>"
before using this command
firmwalkerの実行 3/3 (shodan連携機能のオフ) cd cd tmp/firmwalker cat firmwalker.sh | grep
-n5 shodan #shodanのifループを無視 sed s/shodan/Xshodan/ firmwalker.sh > firmwalker_1.sh # 別名保存 cat firmwalker_1.sh | grep -n5 shodan ls -la chmod 700 firmwalker_1.sh # 実行権限 ls -la ./firmwalker_1.sh /home/kali/Downloads/stage5/squashfs-root cat firmwalker.txt # 結果出力
演習課題③ 可読な情報の探索 • firmwalkerは何を検出している? – どのファイルにどんなリスク? • 機微な情報を探してみる – 検出されたファイルを探して読む
– このファームウェアは何の製品? – 会社名、機種名 – 認証情報など・・・
stage6:ファームウェアのエミュレート
stage6のゴール • ファームウェアのエミュレート成功 • ブラウザからアクセスして、認証を突破 – ※パスワードはファームウェア解析で
firmadyneの設定 cd cd tmp/firmadyne ls vim firmadyne.config #!/bin/sh # uncomment
and specliify full path ・・・ FIRMWARE_DIR=/home/kali/tmp/firmadyne i [Esc] :wq
fatの設定 cd cd tmp/firmware-analysis-toolkit ls vim fat.config [DEFAULT] sudo_password=kali firmadyne_path=/home/kali/tmp/firmadyne
i [Esc] :wq
fatの実行 cd cd tmp/firmware-analysis-toolkit ./fat.py /home/kali/Downloads/stage6/WNAP320_V2.0.3_firmware.tar
エミュレート成功 • fatの処理終了後、ポートスキャンを実施 • ブラウザでアクセス – http://192.168.0.100 – https://192.168.0.100 nmap
–p 1-500 192.168.0.100 sslscan 192.168.0.100
演習課題④ 認証情報の解析 • ファームウェアをbinwalk • デフォルトIDとパスワードを探し、認証突破してみよう
演習課題⑤ HTTPSの確認 • なぜブラウザでHTTPS接続できないのだろうか? • ヒント – about:config – tls.ver
自習
演習課題⑥ • これまでの演習内容の深堀り – binwalkの結果をじっくり味わう – エミュレートしたファームウェアで遊んでみる • 他のファームにチャレンジ –
検索 [社名 サポート ファームウェア] – 検索 [製品名 サポート ファームウェア] など – binwalkできないファームウェアであれば、それはなぜか?
まとめ・成果報告