SlideShare a Scribd company logo
DRAWING
DATAFLOW
ON DALVIK
BYTECODES
Takahiro Yoshimura
(@alterakey)
WHO I AM
➤ 吉村 孝広 (@alterakey)
➤ 株式会社モノリスワークス
CTO
➤ Keybase: 

https://keybase.io/alterakey
➤ 講演: 

DEF CON 25 Demo Labs

CODE BLUE 2017 etc.
WHAT I DO
➤ alterakey
➤ Security Researcher
➤ iOS/Android
➤ Network pentesting
FINDING VULNERABILITIES
➤ 静的解析
➤ 対象のバイナリを解析して挙動を推定
➤ データフローの解析が重要
➤ 動的解析
➤ 対象を実際に動作させて挙動を観測→触れない
ANATOMY OF ANDROID APPLICATIONS
➤ Binary XML: Android manifest, layouts, etc.
➤ Dalvik VM executable (DEX)
➤ Dalvik: Register-based virtual machine
➤ 16-bit opcodes, 65536 regs
➤ java classes are fused: 65536 methods max. ← multidex
➤ incompatible opcodes! (isomorphicではあるけど)
REVERSING ANDROID APPLICATIONS
➤ Binary XML: apktool
➤ Dalvik VM executable (DEX)
➤ 逆アセンブル
➤ .dex→baksmali (apktool)→.smali
➤ 逆コンパイル: 一般的
➤ .dex→dex2jar→.jar→JD-GUI, jad, et al.→.java

.dex→dad→.java
PROBLEMS
➤ 難読化
➤ 手法として定着
➤ 逆コンパイラを妨害
WHY IS DECOMPILING HARD?
➤ 逆コンパイラの動作には何が必要なのか…
➤ 正確な逆アセンブル結果
➤ ある種の共通コードパターン

(e.g. function prologue/epilogue)
➤ 難読化ツールはこれらを妨害
RELATED WORKS
➤ 複数の逆コンパイラを併用

(QARK et al.)
➤ 速度の問題: さらに低下
➤ 信頼性の問題

➤ 実のところ、単なる併用では
答にならないと感じている…
GO DIRECT
➤ Trueseeing
➤ 機能
➤ データフロー解析
➤ 定数や型のゆるい推論
➤ マニフェスト分析
➤ 逆コンパイラを使用しない
➤ 速度向上
➤ 頑健性向上
➤ D8にも対応
➤ PyPIからすぐに使える!
DISASSEMBLING
➤ ツールチェイン
➤ apktool
➤ SQLite3 DB
MARKING UP
➤ 解釈
➤ 通常指令 (op)
➤ メタ指令
➤ .class / .method
➤ .implements / .super etc.
➤ アノテーション類
➤ マーク
➤ メソッド
➤ クラス
GO FASTER
➤ コードベースをマップする
➤ 定数
➤ 関数呼び出し
➤ sput (static put)
➤ iput (instance put)
➤ 名前類 (メソッド, クラス)
➤ クラス群の関係性
➤ 今ごろなぜSQL?

— 複雑なクエリを効率良く実行
➤ DBに「考えさせる」設計
DATAFLOW TRACING (1)
➤ Lenient Backtracking
➤ 「関心点」から引数まで
➤ 関心点が何らかの定数に帰
着させられないか追跡

(関心点を「解く」)
➤ 関心点の例
➤ API呼び出しの引数 etc.
➤ レジスタの参照/書込を対応
➤ move*, const*
DATAFLOW TRACING (2)
➤ Call tracing
➤ 引数から呼び出し元へ
➤ Call stackの上位へ波及
➤ p*=パラメータ
➤ 正しくない場合もある
➤ R8/Kotlinがp*を積極的
に再利用するなど
DATAFLOW TRACING (3)
➤ Static trace
➤ sget/sputを対応
➤ sputを解く
DATAFLOW TRACING (4)
➤ Instansic trace
➤ iget/iputを対応
➤ インスタンス同一性は現
在無視 (WIP)
➤ iputを解く
VERSATILE
➤ OWASP Mobile Top 10 (2016)の

ほぼ全域をカバー
➤ M1: Improper Platform Usage
➤ M2: Insecure Data Storage
➤ M3: Insecure Communication
➤ M4: Insecure Authentication
➤ M5: Insufficient Cryptography
➤ M6: Insecure Authorization
➤ M7: Client Code Quality Issues
➤ M8: Code Tampering
➤ M9: Reverse Engineering
➤ M10: Extraneous Functionality
INTUITIVE
➤ CVSS 3.0 Temporal
➤ 分かりやすく詳細なレポート
➤ HTML: 人間向け
➤ Text: CI向け
➤ Continuous security

(継続的セキュリティ)
BINARY PATCHING
➤ Removing (in smali)
➤ insnの削除
➤ DBのパッチ
AS AN EXPLOITATION TOOL
➤ Package grabber
➤ Package resigner
➤ デバッグ有効化
➤ フルバックアップ有効化
➤ TLS un-pinning (WIP)
➤ etc.
FREE AS FREEDOM
➤ GPL-3
➤ https://github.com/
monolithworks/trueseeing
➤ 永久に自由
➤ 改修やシグニチャを今後拡充
➤ 便利なだけでなく不可欠な存
在を目指して
Freedom by Mochamad Arief on flickr, CC-BY-NC-ND 2.0
QUESTIONS?
FIN.
10.2.2018 Monolith Works Inc.

More Related Content

Similar to Drawing Dataflow On Dalvik Bytecodes

[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes [CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes CODE BLUE
 
Dalvikバイトコードリファレンスの読み方 改訂版
Dalvikバイトコードリファレンスの読み方 改訂版Dalvikバイトコードリファレンスの読み方 改訂版
Dalvikバイトコードリファレンスの読み方 改訂版Takuya Matsunaga
 
Programming camp 2008, Codereading
Programming camp 2008, CodereadingProgramming camp 2008, Codereading
Programming camp 2008, CodereadingHiro Yoshioka
 
Programming camp code reading
Programming camp code readingProgramming camp code reading
Programming camp code readingHiro Yoshioka
 
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。hiyohiyo
 
Groovyで楽にSQLを実行してみよう
Groovyで楽にSQLを実行してみようGroovyで楽にSQLを実行してみよう
Groovyで楽にSQLを実行してみようAkira Shimosako
 
EmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤とEmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤とToru Takahashi
 
EmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤とEmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤とToru Takahashi
 
LineairDB: Fast and Embedded Transactional Key-Value Storage
LineairDB: Fast and Embedded Transactional Key-Value StorageLineairDB: Fast and Embedded Transactional Key-Value Storage
LineairDB: Fast and Embedded Transactional Key-Value StorageSho Nakazono
 
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?Masamitsu Maehara
 
Road to success System.IO.Compression.ZipArchive Feedback
Road to success System.IO.Compression.ZipArchive FeedbackRoad to success System.IO.Compression.ZipArchive Feedback
Road to success System.IO.Compression.ZipArchive FeedbackKazushi Kamegawa
 
Code Reading at Security and Programming camp 2011
Code Reading at Security and Programming camp 2011 Code Reading at Security and Programming camp 2011
Code Reading at Security and Programming camp 2011 Hiro Yoshioka
 
安全なプログラムの作り方
安全なプログラムの作り方安全なプログラムの作り方
安全なプログラムの作り方Kazuhiro Nishiyama
 
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】DeNA
 
jjugccc2018 app review postmortem
jjugccc2018 app review postmortemjjugccc2018 app review postmortem
jjugccc2018 app review postmortemtamtam180
 
Node予備校 vol.1 名古屋
Node予備校 vol.1 名古屋Node予備校 vol.1 名古屋
Node予備校 vol.1 名古屋Mori Shingo
 

Similar to Drawing Dataflow On Dalvik Bytecodes (20)

[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes [CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
[CB17] Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
 
Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2
 
Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2Outsmarting Smartphone Apps 2
Outsmarting Smartphone Apps 2
 
Dalvikバイトコードリファレンスの読み方 改訂版
Dalvikバイトコードリファレンスの読み方 改訂版Dalvikバイトコードリファレンスの読み方 改訂版
Dalvikバイトコードリファレンスの読み方 改訂版
 
Programming camp 2008, Codereading
Programming camp 2008, CodereadingProgramming camp 2008, Codereading
Programming camp 2008, Codereading
 
Programming camp code reading
Programming camp code readingProgramming camp code reading
Programming camp code reading
 
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
 
Groovyで楽にSQLを実行してみよう
Groovyで楽にSQLを実行してみようGroovyで楽にSQLを実行してみよう
Groovyで楽にSQLを実行してみよう
 
EmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤とEmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤と
 
EmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤とEmbulkとDigdagとデータ分析基盤と
EmbulkとDigdagとデータ分析基盤と
 
LineairDB: Fast and Embedded Transactional Key-Value Storage
LineairDB: Fast and Embedded Transactional Key-Value StorageLineairDB: Fast and Embedded Transactional Key-Value Storage
LineairDB: Fast and Embedded Transactional Key-Value Storage
 
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
 
Gorinphp0729
Gorinphp0729Gorinphp0729
Gorinphp0729
 
Gorinphp0729
Gorinphp0729Gorinphp0729
Gorinphp0729
 
Road to success System.IO.Compression.ZipArchive Feedback
Road to success System.IO.Compression.ZipArchive FeedbackRoad to success System.IO.Compression.ZipArchive Feedback
Road to success System.IO.Compression.ZipArchive Feedback
 
Code Reading at Security and Programming camp 2011
Code Reading at Security and Programming camp 2011 Code Reading at Security and Programming camp 2011
Code Reading at Security and Programming camp 2011
 
安全なプログラムの作り方
安全なプログラムの作り方安全なプログラムの作り方
安全なプログラムの作り方
 
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
 
jjugccc2018 app review postmortem
jjugccc2018 app review postmortemjjugccc2018 app review postmortem
jjugccc2018 app review postmortem
 
Node予備校 vol.1 名古屋
Node予備校 vol.1 名古屋Node予備校 vol.1 名古屋
Node予備校 vol.1 名古屋
 

More from Takahiro Yoshimura

Looking Back: CIS on Managed K8S
Looking Back: CIS on Managed K8SLooking Back: CIS on Managed K8S
Looking Back: CIS on Managed K8STakahiro Yoshimura
 
Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Trueseeing: Effective Dataflow Analysis over Dalvik OpcodesTrueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Trueseeing: Effective Dataflow Analysis over Dalvik OpcodesTakahiro Yoshimura
 
10 (about make 10 with 4 numbers challenge)
10 (about make 10 with 4 numbers challenge)10 (about make 10 with 4 numbers challenge)
10 (about make 10 with 4 numbers challenge)Takahiro Yoshimura
 
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and GomobileGo goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and GomobileTakahiro Yoshimura
 
伝授の巻について #スクエアフリーセミナー #yochiand
伝授の巻について #スクエアフリーセミナー #yochiand伝授の巻について #スクエアフリーセミナー #yochiand
伝授の巻について #スクエアフリーセミナー #yochiandTakahiro Yoshimura
 
GroovyなAndroidテスト #atest_hack
GroovyなAndroidテスト #atest_hackGroovyなAndroidテスト #atest_hack
GroovyなAndroidテスト #atest_hackTakahiro Yoshimura
 
あげフォト開発ノート #antama_ws
あげフォト開発ノート #antama_wsあげフォト開発ノート #antama_ws
あげフォト開発ノート #antama_wsTakahiro Yoshimura
 
おいしいFragment #antama_ws
おいしいFragment #antama_wsおいしいFragment #antama_ws
おいしいFragment #antama_wsTakahiro Yoshimura
 

More from Takahiro Yoshimura (20)

Looking Back 2023
Looking Back 2023Looking Back 2023
Looking Back 2023
 
Fill In The Blank
Fill In The BlankFill In The Blank
Fill In The Blank
 
Ticket To The Dark World
Ticket To The Dark WorldTicket To The Dark World
Ticket To The Dark World
 
Looking back 2022
Looking back 2022Looking back 2022
Looking back 2022
 
Hazy Datagrams
Hazy DatagramsHazy Datagrams
Hazy Datagrams
 
Wartime Pigeons
Wartime PigeonsWartime Pigeons
Wartime Pigeons
 
Securing Supply Chains
Securing Supply ChainsSecuring Supply Chains
Securing Supply Chains
 
Looking Back: CIS on Managed K8S
Looking Back: CIS on Managed K8SLooking Back: CIS on Managed K8S
Looking Back: CIS on Managed K8S
 
Beijing Report 2022
Beijing Report 2022Beijing Report 2022
Beijing Report 2022
 
Asynchronicity
AsynchronicityAsynchronicity
Asynchronicity
 
Outsmarting Smartphone Apps
Outsmarting Smartphone AppsOutsmarting Smartphone Apps
Outsmarting Smartphone Apps
 
Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Trueseeing: Effective Dataflow Analysis over Dalvik OpcodesTrueseeing: Effective Dataflow Analysis over Dalvik Opcodes
Trueseeing: Effective Dataflow Analysis over Dalvik Opcodes
 
10 (about make 10 with 4 numbers challenge)
10 (about make 10 with 4 numbers challenge)10 (about make 10 with 4 numbers challenge)
10 (about make 10 with 4 numbers challenge)
 
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and GomobileGo goes Mobile: Quick Exploration on Go 1.5 and Gomobile
Go goes Mobile: Quick Exploration on Go 1.5 and Gomobile
 
Android Wear: Good Parts
Android Wear: Good PartsAndroid Wear: Good Parts
Android Wear: Good Parts
 
DEFCON21×S2 REPORT
DEFCON21×S2 REPORTDEFCON21×S2 REPORT
DEFCON21×S2 REPORT
 
伝授の巻について #スクエアフリーセミナー #yochiand
伝授の巻について #スクエアフリーセミナー #yochiand伝授の巻について #スクエアフリーセミナー #yochiand
伝授の巻について #スクエアフリーセミナー #yochiand
 
GroovyなAndroidテスト #atest_hack
GroovyなAndroidテスト #atest_hackGroovyなAndroidテスト #atest_hack
GroovyなAndroidテスト #atest_hack
 
あげフォト開発ノート #antama_ws
あげフォト開発ノート #antama_wsあげフォト開発ノート #antama_ws
あげフォト開発ノート #antama_ws
 
おいしいFragment #antama_ws
おいしいFragment #antama_wsおいしいFragment #antama_ws
おいしいFragment #antama_ws
 

Recently uploaded

論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizesatsushi061452
 
20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdfAyachika Kitazaki
 
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose EstimationToru Tamaki
 
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptxssuserbefd24
 
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一瑛一 西口
 
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑Akihiro Kadohata
 
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...atsushi061452
 
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)keikoitakurag
 
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayersToru Tamaki
 
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員Sadaomi Nishi
 
Intranet Development v1.0 (TSG LIVE! 12 LT )
Intranet Development v1.0 (TSG LIVE! 12 LT )Intranet Development v1.0 (TSG LIVE! 12 LT )
Intranet Development v1.0 (TSG LIVE! 12 LT )iwashiira2ctf
 
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521Satoshi Makita
 

Recently uploaded (12)

論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
 
20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf
 
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
 
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
 
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
 
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
 
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
 
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
 
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
 
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
 
Intranet Development v1.0 (TSG LIVE! 12 LT )
Intranet Development v1.0 (TSG LIVE! 12 LT )Intranet Development v1.0 (TSG LIVE! 12 LT )
Intranet Development v1.0 (TSG LIVE! 12 LT )
 
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
 

Drawing Dataflow On Dalvik Bytecodes

  • 2. WHO I AM ➤ 吉村 孝広 (@alterakey) ➤ 株式会社モノリスワークス CTO ➤ Keybase: 
 https://keybase.io/alterakey ➤ 講演: 
 DEF CON 25 Demo Labs
 CODE BLUE 2017 etc.
  • 3. WHAT I DO ➤ alterakey ➤ Security Researcher ➤ iOS/Android ➤ Network pentesting
  • 4. FINDING VULNERABILITIES ➤ 静的解析 ➤ 対象のバイナリを解析して挙動を推定 ➤ データフローの解析が重要 ➤ 動的解析 ➤ 対象を実際に動作させて挙動を観測→触れない
  • 5. ANATOMY OF ANDROID APPLICATIONS ➤ Binary XML: Android manifest, layouts, etc. ➤ Dalvik VM executable (DEX) ➤ Dalvik: Register-based virtual machine ➤ 16-bit opcodes, 65536 regs ➤ java classes are fused: 65536 methods max. ← multidex ➤ incompatible opcodes! (isomorphicではあるけど)
  • 6. REVERSING ANDROID APPLICATIONS ➤ Binary XML: apktool ➤ Dalvik VM executable (DEX) ➤ 逆アセンブル ➤ .dex→baksmali (apktool)→.smali ➤ 逆コンパイル: 一般的 ➤ .dex→dex2jar→.jar→JD-GUI, jad, et al.→.java
 .dex→dad→.java
  • 8. WHY IS DECOMPILING HARD? ➤ 逆コンパイラの動作には何が必要なのか… ➤ 正確な逆アセンブル結果 ➤ ある種の共通コードパターン
 (e.g. function prologue/epilogue) ➤ 難読化ツールはこれらを妨害
  • 9. RELATED WORKS ➤ 複数の逆コンパイラを併用
 (QARK et al.) ➤ 速度の問題: さらに低下 ➤ 信頼性の問題
 ➤ 実のところ、単なる併用では 答にならないと感じている…
  • 10. GO DIRECT ➤ Trueseeing ➤ 機能 ➤ データフロー解析 ➤ 定数や型のゆるい推論 ➤ マニフェスト分析 ➤ 逆コンパイラを使用しない ➤ 速度向上 ➤ 頑健性向上 ➤ D8にも対応 ➤ PyPIからすぐに使える!
  • 12. MARKING UP ➤ 解釈 ➤ 通常指令 (op) ➤ メタ指令 ➤ .class / .method ➤ .implements / .super etc. ➤ アノテーション類 ➤ マーク ➤ メソッド ➤ クラス
  • 13. GO FASTER ➤ コードベースをマップする ➤ 定数 ➤ 関数呼び出し ➤ sput (static put) ➤ iput (instance put) ➤ 名前類 (メソッド, クラス) ➤ クラス群の関係性 ➤ 今ごろなぜSQL?
 — 複雑なクエリを効率良く実行 ➤ DBに「考えさせる」設計
  • 14. DATAFLOW TRACING (1) ➤ Lenient Backtracking ➤ 「関心点」から引数まで ➤ 関心点が何らかの定数に帰 着させられないか追跡
 (関心点を「解く」) ➤ 関心点の例 ➤ API呼び出しの引数 etc. ➤ レジスタの参照/書込を対応 ➤ move*, const*
  • 15. DATAFLOW TRACING (2) ➤ Call tracing ➤ 引数から呼び出し元へ ➤ Call stackの上位へ波及 ➤ p*=パラメータ ➤ 正しくない場合もある ➤ R8/Kotlinがp*を積極的 に再利用するなど
  • 16. DATAFLOW TRACING (3) ➤ Static trace ➤ sget/sputを対応 ➤ sputを解く
  • 17. DATAFLOW TRACING (4) ➤ Instansic trace ➤ iget/iputを対応 ➤ インスタンス同一性は現 在無視 (WIP) ➤ iputを解く
  • 18. VERSATILE ➤ OWASP Mobile Top 10 (2016)の
 ほぼ全域をカバー ➤ M1: Improper Platform Usage ➤ M2: Insecure Data Storage ➤ M3: Insecure Communication ➤ M4: Insecure Authentication ➤ M5: Insufficient Cryptography ➤ M6: Insecure Authorization ➤ M7: Client Code Quality Issues ➤ M8: Code Tampering ➤ M9: Reverse Engineering ➤ M10: Extraneous Functionality
  • 19. INTUITIVE ➤ CVSS 3.0 Temporal ➤ 分かりやすく詳細なレポート ➤ HTML: 人間向け ➤ Text: CI向け ➤ Continuous security
 (継続的セキュリティ)
  • 20. BINARY PATCHING ➤ Removing (in smali) ➤ insnの削除 ➤ DBのパッチ
  • 21. AS AN EXPLOITATION TOOL ➤ Package grabber ➤ Package resigner ➤ デバッグ有効化 ➤ フルバックアップ有効化 ➤ TLS un-pinning (WIP) ➤ etc.
  • 22. FREE AS FREEDOM ➤ GPL-3 ➤ https://github.com/ monolithworks/trueseeing ➤ 永久に自由 ➤ 改修やシグニチャを今後拡充 ➤ 便利なだけでなく不可欠な存 在を目指して Freedom by Mochamad Arief on flickr, CC-BY-NC-ND 2.0