在动态分析过程中,可能由于恶意行为的时间限制,或者模拟器的功能限制(比如蓝牙、Wifi),导致病毒的一些恶意行为无法触发。此时,我们通过检测Android软件调用的API函数可弥补这里的不足,比如发送扣费短信通常会调用sendTextMessage()函数,执行外部命令可能会调用java.lang.Runtime.exec()。下面是笔者收集整理的一些敏感API函数列表,欢迎各位读者补充和改进:

  my %apis = (

  "IActivityManager$Stub$Proxy;->shutdown" => '关机',

  "ActivityManager;->killBackgroundProcesses" => '中断进程,可用于关闭杀软',

  'ActivityManagerNative;->killBackgroundProcesses' => '中断进程,可用于关闭杀软',

  'ActivityManagerNative;->restartPackage' => ' 中断进程,可用于关闭杀软',

  'ActivityManager;->restartPackage' => ' 中断进程,可用于关闭杀软',

  #"BluetoothAdapter;->enable" => '开启蓝牙',

  #"BluetoothSocket;->connect" => '连接蓝牙',

  #"IBluetoothPbap$Stub$Proxy;->connect" => '连接蓝牙',

  "ContentResolver;->query" => '读取联系人、短信等数据库',

  "ContentService;->dump" => '转储联系人、短信等信息',

  "PackageManager;->installPackage" => '安装apk包',

  "Camera;->open" => '开启相机',

  "MediaRecorder;->setAudioSource" => '开启录音功能',

  "MediaRecorder;->setVideoSource" => '开启视频录制',

  "LocationManager;->getLastKnownLocation" => '获取地址位置',

  "Downloads$ByUri;->startDownloadByUri" => '下载文件',

  "Downloads$DownloadBase;->startDownloadByUri" => '下载文件',

  "PowerManager;->reboot" => '重启手机',

  "Settings$Bookmarks;->add" => '添加浏览器书签',

  "TelephonyManager;->getDeviceId" => '搜集用户手机IMEI码、电话号码、系统版本号等信息',

  "TelephonyManager;->getSimSerialNumber()" => '获取SIM序列号',

  "Telephony$Mms;->query" => '读取短信',

  "TelephonyManager;->getLine1Number" => '获取手机号',

  "SpeechRecognizer;->startListening" => '开启麦克风',

  "WifiManager;->setWifiEnabled" => '开启WIFI',

  "SmsManager;->getAllMessagesFromSim" => '获取sim卡上的短信',

  "SmsManager;->sendDataMessage" => '发送二进制消息',

  "SmsManager;->sendMultipartTextMessage" => '发送彩信',

  "SmsManager;->sendTextMessage" => '发送普通短信',

  #"http/multipart/FilePart;->sendData" => '发送http请求',

  #"http/multipart/Part;->send" => '发送http请求',

  #"http/multipart/Part;->sendParts" => '发送http请求',

  #"http/multipart/StringPart;->sendData" => '发送http请求',

  "internal/telephony/ISms$Stub$Proxy;->sendData" => '发送短信',

  "internal/telephony/ISms$Stub$Proxy;->sendMultipartText" => '发送短信',

  "internal/telephony/ISms$Stub$Proxy;->sendText" => '发送短信',

  "internal/telephony/ITelephony$Stub$Proxy;->call" => '拔打电话',

  "java/lang/Runtime;->exec" => '执行字符串命令',

  "java/net/HttpURLConnection;->connect" => '连接URL',

  #"java/net/URL;->getContent" => '获取网页内容',

  "java/net/URL;->openConnection" => '连接URL',

  "java/net/URLConnection;->connect" => '连接URL',

  "DefaultHttpClient;->execute" => '发送HTTP请求',

  "HttpClient;->execute" => '请求远程服务器',

  'android/app/NotificationManager;->notify' => '信息通知栏',

  "SmsReceiver;->abortBroadcast" => '拦截短信接收',

  "ContentResolver;->delete" => '删除短信、联系人',

  "chmod " => '更改文件权限',

  "getRuntime" => '获取命令行环境',

  #'content://telephony/carriers' => '获取所有的APN(网络接入点)配置信息',

  'content://telephony/carriers/preferapn' => '可能用于篡改APN(网络接入点)以调用应用市场M-Market扣费接口并验证',

  'content://sms' => '获取短信数据库',

  'content://browser/bookmarks' => '获取浏览器书签',

  'mount -o remount' => '重新挂载档案系统',

  '/system/bin/sh' => '执行shell',

  '/proc/mounts' => '加载文件系统',

  '/system/bin/cp' => '复制文件',

  '/root/su' => '切换用户',

  '/system/bin/rm ' => '删除文件',

  );