3. WebView and APP Security - Henry

   資工三乙

       楊廷禹 王俞禮 羅柏智 徐航清

 

另一篇 http://sls.weco.net/node/27888

 

什麼是MDM:

Mobile Device Manangement 通稱手機管理系統,常用於大公司及重要機關,通過將程式部署在員工的行動設備中以管控員工資訊,限制員工行動的系統

 

MDM的作用:

公司部署MDM即管理者有最高權限,可以不經由你同意就修改手機設定,如限制攝錄影功能 有線無線傳輸阜 GPS定位等等

例如GOOGLE GMAIL的信箱遠端鎖定功能,當員工手機遺失時,便可用GOOGLE提供給企業的信箱功能,對員工的手機進行遠端鎖定,以防止資料外洩,此時公司擁有你手機的ROOT權限

當手機持續連線時 , 大部分如 ANDROID , IPHONE 系統都提供 FIND MY IPHONE / ANDROID 功能 ,此功能即是供給個人使用的MDM,可線上追蹤個人手機位址,而企業端的通常是可以同時追蹤上千人設備的位址

若有人脫離管制,MEM可立即通知公司管理人員自行處理

 

MDM設計概念:default false or default true

如果使用者不小心或是蓄意刪除管制設定

原廠解決方案都是手機就會解除各種設定管制,然後使用者就會變回有系統的完整權限。

 

 

目前企業對於設備管控的三種態度 :完全禁止、完全開放、部分限制

 

MDM系統提供來源 :原廠解決方案、第三方軟體

 

移動設備的權限管理:

Android不同於iphone ,android可用任何第三方工具軟體來取得root , 但iphone必須使用原廠提供工具方能取得root .android用戶必須注意任何權限dialog警告視窗的細節。

例如whoscall 的iphone版本比android版晚推出,便是因為無法取得iphone root權限,變成給whoscall「被動」接收系統資料庫提供的資料,不像在android中whoscall可以「隨意取得」android的資料,此為相同軟體在不同系統的權限限制下的不同模式

iOS:apple configuatior 2 可以寫入描述檔方式來控制 iphone.

 

程式開發:不要信任使用者

開發者的APP只要是使用事先寫好、未加密的CONFIG,使用者便可自行修改,通過APP確認即可,故最好在APP中使用具憑證的CONFIG,若使用者自行修改的CONFIG便無法通過憑證,視同無效

不得已需要依賴使用者的資料時,千萬不可使用離線驗證,隱私資料或是驗證數值要加密

 

網頁憑證檢查

檢查憑證時要看清楚,你原本認為A網站是你可以信任的,但事實上其憑證連B、C、D等網站都可信任,這些網站極有可能不安全,原本你電腦不信任,但因其憑證而信任,易造成資安問題,甚至引發中間人攻擊

 

OWASP Mobile Top 10評估問題

 

M1 - Improper Platform Usage

This category covers misuse of a platform feature or failure to use platform security controls. It might include Android intents, platform permissions, misuse of TouchID, the Keychain, or some other security control that is part of the mobile operating system. There are several ways that mobile apps can experience this risk.

 

M2 - Insecure Data Storage

This new category is a combination of M2 + M4 from Mobile Top Ten 2014. This covers insecure data storage and unintended data leakage.

用來查詢驗證GPS的檔案竟然是純文字而沒有加密。這除了可能導致

 

M3 - Insecure Communication

This covers poor handshaking, incorrect SSL versions, weak negotiation, cleartext communication of sensitive assets, etc.

 

M4 - Insecure Authentication

This category captures notions of authenticating the end user or bad session management. This can include:

 

Failing to identify the user at all when that should be required

Failure to maintain the user's identity when it is required

Weaknesses in session management

M5 - Insufficient Cryptography

The code applies cryptography to a sensitive information asset. However, the cryptography is insufficient in some way. Note that anything and everything related to TLS or SSL goes in M3. Also, if the app fails to use cryptography at all when it should, that probably belongs in M2. This category is for issues where cryptography was attempted, but it wasn't done correctly.

 

M6 - Insecure Authorization

This is a category to capture any failures in authorization (e.g., authorization decisions in the client side, forced browsing, etc.). It is distinct from authentication issues (e.g., device enrolment, user identification, etc.).

 

If the app does not authenticate users at all in a situation where it should (e.g., granting anonymous access to some resource or service when authenticated and authorized access is required), then that is an authentication failure not an authorization failure.

 

M7 - Client Code Quality

This was the "Security Decisions Via Untrusted Inputs", one of our lesser-used categories. This would be the catch-all for code-level implementation problems in the mobile client. That's distinct from server-side coding mistakes. This would capture things like buffer overflows, format string vulnerabilities, and various other code-level mistakes where the solution is to rewrite some code that's running on the mobile device.

 

M8 - Code Tampering

This category covers binary patching, local resource modification, method hooking, method swizzling, and dynamic memory modification.

 

Once the application is delivered to the mobile device, the code and data resources are resident there. An attacker can either directly modify the code, change the contents of memory dynamically, change or replace the system APIs that the application uses, or modify the application's data and resources. This can provide the attacker a direct method of subverting the intended use of the software for personal or monetary gain.

 

M9 - Reverse Engineering

This category includes analysis of the final core binary to determine its source code, libraries, algorithms, and other assets. Software such as IDA Pro, Hopper, otool, and other binary inspection tools give the attacker insight into the inner workings of the application. This may be used to exploit other nascent vulnerabilities in the application, as well as revealing information about back end servers, cryptographic constants and ciphers, and intellectual property.

 

M10 - Extraneous Functionality

Often, developers include hidden backdoor functionality or other internal development security controls that are not intended to be released into a production environment. For example, a developer may accidentally include a password as a comment in a hybrid app. Another example includes disabling of 2-factor authentication during testing.

資料來源:https://www.owasp.org/index.php/Mobile_Top_10_2016-Top_10