Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android開発でmitmproxyを使った話
Search
bigbackboom
December 18, 2018
2
1.2k
Android開発でmitmproxyを使った話
bigbackboom
December 18, 2018
Tweet
Share
More Decks by bigbackboom
See All by bigbackboom
Proto Datastoreを使う前の心構え
bigbackboom
0
71
Extended A Study in Bitmap: Is NDK the fast Processing method by CPU?
bigbackboom
0
1
Have A Dog in CircleCI
bigbackboom
0
8
Androidエンジニアのお仕事でのショボーン
bigbackboom
0
42
解明!楽しいプレゼンする話すスキル
bigbackboom
0
37
Pay for Businessのgradle.ktsへの移行の小噺
bigbackboom
0
24
A Study in Bitmap: Is NDK the fast Processing method by CPU?
bigbackboom
0
210
Shallow Dip into Kotlin Coroutine
bigbackboom
0
150
Android Architecture Componentの Navigationで少しはまった話
bigbackboom
0
600
Featured
See All Featured
Being A Developer After 40
akosma
86
590k
Designing Experiences People Love
moore
138
23k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Designing for humans not robots
tammielis
250
25k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Side Projects
sachag
452
42k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
GraphQLとの向き合い方2022年版
quramy
43
13k
Embracing the Ebb and Flow
colly
84
4.5k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Transcript
Android։ൃͰ mitmproxyΛͬͨ
Who am I? — ٠/bigbackboom — גࣜձࣾΞΠελΠϧɹ ϝσΟΞ։ൃ౷ׅ෦ ΞϓϦάϧʔϓ —
ͳΜͪΌͬͯAndroid։ൃऀ — ࠷ۙαʔόʔαΠυ Golangʹුؾத — ҟ໊ɿ͓٠ɺ٠ɺ٠͞Μ
ܦҢ — responseͷΛॻ͖͑ͯɺຊ൪ڥͰΞϓϦͷڧ੍Ξο ϓσʔτͷςετ͕͍ͨ͠ɻ — iOSCharlesΛ͑Ͱ͖Δ͕ɺAndroidʁ — CharlesͰ͍͚Δ͚ͣͩͲɺͳΜ͔httpsΩϟονͰ͖ͳ ͍Αɾɾɾ(´ŋωŋ`) —
Charles͕ͩΊͳΒଞͷΞϓϦέʔγϣϯ୳ͯ͠ΈΑ͏ʂ
mitmproxy — Charlesͱ΄΅ಉͷػೳΛఏڙ͢ΔOSS — UIίϚϯυϕʔε — WebUIʢβʣ·Ͱ͋Δʂ
ݒ೦ — ਖ਼ίϚϯυϥΠϯϕʔε͕ɾɾɾͬͨΔ͍
ͱ͍͑ɾɾɾଞʹํ๏ͳ͍
ͱΓ͋͑ͣͬͯݟΔ͖
Πϯετʔϧ $ brew install mitmproxy
ىಈ $ mitmproxy -p ϙʔτ൪߸
ΞϓϦͷ४උ 1. pcͷipΞυϨεΛϝϞ 2. AndroidΛ༻ҙͯ͠ɺઃఆʼWi-Fiͱը໘ΛભҠ 3. ଓࡁΈͷwifiΛԡ͢͠Δͱɺ"ωοτϫʔΫΛมߋ"ͷ߲͕ग़ΔͷͰλοϓ͢Δ 4. දࣔ͞ΕͨΟϯυͷ”ৄࡉઃఆ߲"ͷϓϩΩγ߲Λखಈʹมߋ͢Δ 5.
Ճදࣔ͞Ε߲ͨͷ”ϓϩΩγͷϗετ໊”ʹᶃͷipΞυϨεΛೖྗ͢Δ 6. ”ϓϩΩγϙʔτʹ”mitmproxyىಈ࣌ʹ༻ͨ͠ϙʔτ൪߸Λೖྗ 7. อଘϘλϯΛλοϓ͢Δ(*1) 8. ϒϥβΛ։͖ɺ"mitm.it"ΛΞυϨεʹೖྗ͢Δ(࣍ϖʔδը૾ࢀর) 9. ։͍ͨϖʔδͷAndroidϩΰͷϘλϯΛԡͯ͠ɺূ໌ॻΛμϯϩʔυɾΠϯετʔϧ͢Δ
None
ͦͯ͠ɾɾɾಈ͔ͯ͠ΈΔ
Https͕औΕ͍ͯͳ͍ͩͱʁ
ͦͯ͜͠ͷ ใ Λݟ͚ͭΔ "ࣗͷΞϓϦͰड͚͚ΔΑ͏ʹ͢ΔʹωοτϫʔΫɾη ΩϡϦςΟͷઃఆΛΞϓϦʹՃ͢Δඞཁ͕͋ΔΑ͏Ͱ͢ɻ"
None
ͬͯΈΑ͏ — app/src/main/res/xmlʹnetwork_security_config.xml Λ࡞ɻҎԼͷ༰Λهड़ɻ <network-security-config> <!-- ͜͜ΛೖΕͯͳ͍ͱɺຊ൪ͷڥͰڐՄΛग़ͤͪΌ͏ͷͰҙ͕ඞཁΒ͍͠ --> <debug-overrides> <trust-anchors>
<!-- Additionally trust user added CAs --> <certificates src="user" /> </trust-anchors> </debug-overrides> </network-security-config>
— AndroidManifest.xmlʹҎԼΛه <application android:networkSecurityConfig="@xml/network_security_config" > ... </application>
τϥΠΞήΠϯ
None
࣮ɾɾɾcharlesͰ͍͚ͨ Android7͔ΒcharlesͰssl௨৴͕ݟΕͳ͘ͳͬͨ݅
·ͱΊ — charlesͷଞʹແྉͷmitmproxy͕͋Δ — ͍উखݴ͏΄Ͳѱ͘ͳ͍ — Android 7Ҏ্͔Β໌ࣔతʹূ໌ॻͷڐՄΛϓϩδΣΫτ ʹઃఆ͢Δඞཁ͕͋Δ