Android静态安全检测 -> logcat可能泄露隐私敏感信息

来源:互联网 发布:overture mac 破解版 编辑:程序博客网 时间:2024/05/30 23:08

logcat可能泄露隐私敏感信息 - Log.v( )& Log.d( )



一、API


1. 继承关系


【1】java.lang.Object

【2】android.util.Log


2. 主要方法


【1】Log.v(String tag, String msg)

         详细(Verbose)信息

         级别最低,输出颜色为黑色


【2】Log.d(String tag, String msg)

         调试(Debug)信息

         输出颜色为蓝色


【3】Log.i(String tag, String msg)

         通告(Info)信息

         输出颜色为绿色


【4】Log.w(String tag, String msg)

         警告(Warn)信息

         输出颜色为橙色


【5】Log.e(String tag, String msg)

         错误(Error)信息

         输出颜色为红色


3. 参考链接


https://developer.android.com/reference/android/util/Log.html


http://my.oschina.net/liuher/blog/293594


二、触发条件


1. 定位Log.v( )和Log.d( )方法的位置

    Landroid/util/Log;->d(

    Landroid/util/Log;->v(


三、漏洞原理


【1】在APP的开发过程中,为了方便调试,通常会使用log函数输出一些信息,这会让攻击者更加容易了解APP内部结构,方便破解和攻击,甚至有可能直接获取到有价值的隐私敏感信息


【2】更多内容


http://wolfeye.baidu.com/blog/logcat-leak-sensitive-information/


http://www.droidsec.cn/android-logcat-security/


四、修复建议

【1】为了APP的错误采集,异常反馈,必要的日志还是要被输出的,建议使用ProGuard等工具在APP的发行版本(release)中自动删除Log.d()和Log.v()对应的代码
0 0