Docsity

Mobile Security for Android, Study notes of Computer Security

Partial preview of the text

Download Mobile Security for Android and more Study notes Computer Security in PDF only on Docsity!

3i/io/as classmate. Android Basics Ovesview 0) Aystem Apps Built on Eop of the ( Dialex, €moail Calendar, Camena, etc.) \ ) Jova API Framework i Content Providers Managers View Ay stem (Ackvity Location fackage Notification Reounce, Telephony Window) @__ Native c/ctt Libraries @_Andvoid Runtime (webkit YpenMAX AL, Libe, eke.) ART Cone Libraries © Hordwone Absaction Layer (Audio, Bluelooth. Camesa tensors, ele.) © Linux Kernel Daiverd [ display keypad use, Wf, ele.) Q) Power Management Applications ) Thind-panty - from. Google Play, Amazon, F-droid 2) Aystern Applications ~ “pannol be uninstalled provide pant ok the APL against which we J prognam owy “cughow appl lication’ - apedal flag in the package manager classmate Date | — fi Api Packages + (AP Ks) _ How ane pacha ages Japplications shipped from shones by end user device |_APK is simply a packaging format Like JAR, ZIP 0% TAR | + Components of Applications | Activity weer inter face Aavice » background service Content Provider © gql-like database || Broadcast Receiver : Mailbox for broadcast maag ' J dex files + | APK L Clasges.dex NABY® Resouncey META META-INF conafals of app” certificate & package manifest | Appl" mani teat ik dif berent Application Manikest = dedaset appl” “meta data & all components ~ tells the An dnoid aystem at installation & runtime how to deal with he app Grodle Build Confi guhati on ~ instnuct the boolchain how to build the app = add” properties get here | package hame , yonston et) / Be |, 2 & I HT); ms ——~ | Bound Senvice | ft is the serves in a client-server int exbave ft lets components such ad_activities bind fp the service, 4end yg | peceive nedponder, and perform IPC. _ | E typical lives only whi le it setves another appl componen + ft pica pane not aun tn the background, _ alujas | Security Architectune + General Accunity Principles Confidentiality Y fotegaily. "Wvailabi Likye Authentic Aubhorization | Noh- Repuaiation Accountabi ili | Anonymity + ] | Uniinkabilihy- Be | | | * Privayy { Confidentiality & {ategnity of personal data) All majon mobile platforms ude igned appl” packages for eg.: central authority youches fon developer denbiby inci SS +H classmate. S2=0 Date Page _2|u}aoas Andaotd Security Architecture ( Sandboxing) __Apecities which avatem nesounces the appl” 12 allowed to access ~ sealised though, appl" isolation a enfored by Sue fay app had wnigue UID (w4er TD) duning installakon & runs tn sepanat e process gach app ‘has m private data folder Native code can be explic Hy induded via fit (fave Native atenka) Andyoid enko ne tgobation. at the phocesd level dandbox of Andnoid apps ik enforced by the Linuy kernel at the | process boundany. _ i)ja]2028 Andnoid Sec Architecture Need for Defense th Depth Date___ ~~ \t page C) \ Focus: faster updates & patches defense tn depth ~ | Modularization of Andaoid: Treble | Android 3+ fPeewous Android), (Updated Android. | 05 framework) (__'05 framework / /endon —— tS Origin ‘al_vendgy implementation interface HAL intentace definition language (wpb) peti ies the interface between HAL and its WAS/9 Now : neplace the Android framework wlo rebuilding WAL Andnoid 40 modulonizes some Android aystem components & enables them tp be updated via Google Play outs: dg of the normal Andnotd nelease cucle. 7d Genwic Kernel fnoges (GK) | addgress ex kennel fragmentation by _untfyin ode kere vin SoC _& bound support “out of the nies kennel into loadable modules ~ moduler & kernels can be updated independently ~ Keel Module {otenface (Kh) for kennel system, modules i, ————__, classmate. >) Date Discrebionor Poge Aues Control * — teare|| SELINUX = — ~ a, 3]2025 | {Linux DAC i a (se Linux Mac_| ener) = MAC - Mandatory Accesg (ontaob _t centre security poly On Windows Pedal fly. Ck Lg) | Liahel- based: ~ Sewwnity Enhanced Linux (S€ Linux) Fath-name based , om Oyo ~ | SELinux on Andnoid Security policter & enforcemen on type enforceme RBAC hot in Andnord Domain -bype enforement (DIE) Model aces conbol dectéions based on domain @. egl| domatng wot & user : (nook user) 9 ltreate ki allow processes in the root domain to create & kill pioceiges in uger domain. Policy Con SElinws Policy Comet ples types cecunity Level . 4 e im akan QA tribute | wed for domain-lype enforcemest) classmate Date Page ———————_\_/ a | 2/\2)as | Thiad-panhy Libranes a = | porn o central directory on Wer end devices all Libsanies must be included (hard- linked) by app developera tn every {package that wants to use the libs. —__ || cil AdMob Mediation: =| connect, developer to multiple advertisement netwonks fat runtime —|{4elecking the mast beneficial o tone bbe included _in the appl” package —Libnany code_- inhenits the hostapp privileges bor the code js executed within the application process (same UID) (no s ecwhihy houndany) + App Ops ~used fon access conthol ¢ backing. - additional hooks ates penmigsion checks as PEP XebH_( Gon Liprary Dakn Hloavesting) = SDK within the Dies pp shaje sandbox : Malicious Sox's can atback other spk's cf steal data of other Snx's £| SDK funtime tn Andaoid 44 Compatble Spx's openate in a sepap ote , isolated proces with ditt. ULD. =| Comm” with SDK Runtime like q bound Service || SDK developers could upload thei veasioned Spks fo the app stores, separate ham the apps _ Third: pan Libraries on Andypid ane cenhally updated L False) _ ( Hy) ey ane bundled with each app) ’ | Vulnerable Libnaries ca increase attack suabace of host app. App code (class) Dalvik "a | Brtecode Library code (dex) (adlass) So Library code cannot be coaily distinguished from app code! +1 Challenges for library detection tn appa code- only. changes don't make difference dead code elimination: (} too much code is missing connect detection. becomes unreliable Package fattening & lars hepackaging change the package bree bhw* liiary é published App»? ( bravy detection ‘pased. oh pacloge bree itselh | tnils. { [Reasons to update apps libraries 2 bug fixing ——— heason, for not updating 2 Library was x atifl working Prevent incompabsbiitie be Version bormat: XYZ Semantic Versoning H | | | | Majon Minor Patel, ’ - backwiands backwards bug fixes [ cleony anges Na mpatible APL. compabhle APE then tf / changa changes - ~thenth then Basic Security Concepts —_ Permissions & IPC Network Security QO _1g]2)2026 | = Z. : Zon bs | hada Baste Security Ar Architectuye { og 93 04 06} Thrad-Panty Libs ur Devon Attacks ssfis webViews) ceplinke Apal” Lior bol” Hardwase- bade platlorm security Futian classmate Date Page. Pfs udually- contain bytecode (Dalvik/ ART bytecode) waitten in Towa oy Kotlin “4, compiled into classes, dex SMain app Logic} Afative (ode code that x co compiled diyecty tnto machine inghuitions foe the device's cpy. { high performance, low-Kevel kaka} lib/.../*, so Y Ark = { cloner dex _fative (bs nat, wil. inf #6 manifat l | | omponenis we eat A CO Appl” ety oe Mewaiibeat mela -daty Jenice pe wel 7" -€ alliconnpore Content Provider SS tHhte —— Broadcast Receives: marlhox for broad casted maga — Antent Messages + data obj thot Yepregents the intent ty do somethin ye can be sent & received canbe Jent to components of same app or different app trandmitted bew* processes via Bindey- Leved IPC ie hop} sported hue’ components iin be called by another app | Zac vity anidvotd name =" Haina chivity android: exported « “bue’> AL exported =’ ‘False’ it can be launched by componenls of same app os privi i eg td ple compon ents Trac is "false! BUT if f add an_éintent - filter> Andvond —— | ysumes implicitly exported andwtd: exported = true’ — ee t— cians > Key 6 J J oY J = 14 adds shreaming~ compatible Jigning Scheme, used fs-venity verificaion happery a dalais head, not akter full fle ia downloadel iby depanately creates provesdes : Aernel 7 jsolater them - _ = LAM wit rund the code inde the provers. J z > = _ . a _ os _— pet Zimperlich: _2ygoke_drd_not check rebwrn value of; et vip call. — _ “allowed apps to gain root_by exploiting setup ancl GNP -TWK- EWA aa 4n idea capable oyster, sub), mua <6/3}2026 jcitl \ ai oe He pp) Fe “casa oc delega tn in ney a) its FAL. pevOUtyy hand ) lab Page _ Leeann) _———,app_te'd can also ays ign. Custom pen missions “Amvyibp> SC. permission only | Permissions granted vig Jntents & Context— [vel bens: J sents an intent obj Pree classmate, of meh esi 2 tp whith ath we the frend or Or Spendighietsnat) A EME (ponisin idly) Rd cer must decane any potentially used permiszion in the reap Rat pedmission need 'b 0 be dedlaned gwell) | Once jmanted aped can wie pehmidton wlo further heguedts unk | Sevphed | —_#y ra caf permission be dele ated ty another app © via vpl permissions Pending 4ntents Lng do not change VIDS { 4 Th. conhaut SetUip on Linux) Pf (RI Permission: ACL lke (mé re AKC bosed on_atbributes fL- Capublity-Ie ecarity Architectune -5 £nforting Por midsions esol in the _middlewane oR enforced by Linux kesnel \Stmnphy chings~Uihs) ( mapped by GID) gomitive reounces encapsulated in_Android apps] senvice, These ack ay reference monitors. Pormisslory define if Android “alelsgps do_some op onion on behelt of the calling app. (hae Antic 4 apps [cowice provide APls fp apps toall ow conballed ac act as ‘intenhoneld uti" General_pattern for aciest contol in appl’ framework clas Sevicet void piotecked function ( yf [efine well- hagwn pedmigsion needed for thie functton, Shing rey pormigson = PERM. - Afehieve vipa calle frorn Binder ic ___— << int uid Rindey get(aliingVid() , : en I Check if calling dandbox_hay the Le pomisgion. _ Hf edtanison (uid, reg.fodvmission) | GRANTED . 7 — How Seckxcephionl) } \ oe