android安全基礎:http://blog.csdn.net/u011069813/article/details/9237631
http://source.android.com/devices/tech/security/
http://siis.cse.psu.edu/android_sec_tutorial.html
學習經驗:把這個輸出的文獻看一遍,然後重點關注一些blog即可。
android的教程:有些還沒出版,大家快速讀幾遍即可。
Android Hacker's Handbook
Android Malware Author: Xuxian Jiang, Yajin Zhou
Android Application Security Essentials
Hacking Exposed Mobile Security Secrets & Solutions
Android Security: Attacks and Defenses
Mobile Phone Security and Forensics: A Practical Approach
Android Apps Security
Android Forensics: Investigation, Analysis and Mobile Security for Google Android
Application Security for the Android Platform: Processes, Permissions, and Other Safeguards
Decompiling Android
從iOS學習開始:
iOS設計理念很簡單,就是一些看似比較邪惡的API都不支持,比如直接程序直接發短信,悄悄的讀取通信錄等。再加上審覈及其嚴格的app-store和對屌絲來說昂貴的99$門檻。當然iOS自身還有很多安全機制。iOS安全基礎可以參考:http://blog.csdn.net/u011069813/article/details/9256233
這地方着重強調apple的審覈機制。語錄:蒼蠅不叮無縫的蛋,打蒼蠅只是下策。多好的男人也經不起美女的誘惑,封閉和門檻真的很重要。
總體來說,不越獄的iOS還是比較安全的,但是從應用安全角度考慮,還是存在一些問題,這個後續再表。
看iOS,對一些非常敏感的API,都不提供直接操作的API,而是讓開發者調用系統任務,比如:
調用打電話功能
[[UIApplicationsharedApplication] openURL:[NSURL URLWithString:@"tel://10086"]];
調用發短信功能
[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"sms://10000"]];
這樣的好處就是需要用戶參與,點擊確認才能進行相應的操作。
Google也鼓勵開發者採用類似的機制:
Permissions aren't required if you launch an activity that has the permission 系統已有task了,就別再申請權限了,直接調用這些應用即可!
- Getting a picture from the camera
// create Intent to take a picture and return control to the calling application沒權限照樣幹!!
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// create a file to save the image
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
// set the image file name
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
// start the image capture Intent
startActivityForResult(intent, MY_REQUEST_CO
- Sending an SMS through the SMS app 沒權照樣發!!
Uri smsNumber = Uri.parse("sms:5551212");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(smsNumber);
intent.putExtra(Intent.EXTRA_TEXT, "hey there!");
startActivity(intent);
Permissions can be temporarily granted to apps by content providers
- Letting the user pick a contact to share with your app 無需申請READ_CONTACTS啊!!
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType(Phone.CONTENT_ITEM_TYPE);
startActivityForResult(intent, MY_REQUEST_CODE);
void onActivityResult(int requestCode, int resultCode, Intent data) {
if (data != null) {
Uri uri = data.getData();
if (uri != null) {
try {
Cursor c = getContentResolver().query(uri, new String[] {
Contacts.DISPLAY_NAME, Phone.NUMBER}, null, null, null);
4.2以後程序直接發短信會有提示,我認爲就是多此一舉,直接幹掉。我預測未來的某個版本這個功能會消失。
剛纔提到iOS對敏感API的管理,對一些重要的API,必須提供程序讀取的,就提供動態機制,運行時提示,讓用戶確認。但這部分也是用戶設置和運行時控制相結合的機制。
看下圖,用戶可以直接關閉,或者設置哪些應用可以訪問這些權限。
Android對大部分API目前還是直接讀取,悄悄的幹活。下一步也會學iOS.
關於最新android安全的進展,大家可以先看看http://blog.csdn.net/u011069813/article/details/14223337 android 4.4的安全機制。
Android的安全演進思路很明晰,就是學iOS。我們先看看android體系都有哪幾類風險:
不用多想,先看看360手機衛士有哪些功能,他們肯定做了大量的調研。
爲了給大家展示展示這些功能,我做了一個大膽的決定,安裝一個360手機衛士。
具體功能大家去體驗,根據360的產品功能我們可以把android面臨的風險抽象爲這樣幾類,當然不可能cover所有風險。
1)防騷擾
垃圾短信、騷擾電話、惡意廣告
過濾垃圾短信、防騷擾電話挺好的!但
安卓官方從4.1版本開始在系統中直接加入了通知欄信息屏蔽功能。
2)保護隱私
隱私行爲監控等
研究每個能力很關鍵啊!
3)錢款類
安全支付、上網保鏢、流量監控
4)系統安全類
手機清理、手機殺毒、手機備份、
5)手機防盜
6)另類的互聯網功能
上述只是功能性分類,我們再分一下類,把系統安全和應用安全區分一下。操作系統就是一個黑洞,尤其是系統安全的功能如權限管理都會被系統吞噬。
比如4.3以後android自帶權限管理。
Android存在的一些問題:
Android系統升級涉及多角色,因而升級週期長。很多漏洞自始至終沒辦法得到升級。