[go: up one dir, main page]

CN111625823A - Security detection method and device for VPN application of Andriod platform - Google Patents

Security detection method and device for VPN application of Andriod platform Download PDF

Info

Publication number
CN111625823A
CN111625823A CN202010286040.2A CN202010286040A CN111625823A CN 111625823 A CN111625823 A CN 111625823A CN 202010286040 A CN202010286040 A CN 202010286040A CN 111625823 A CN111625823 A CN 111625823A
Authority
CN
China
Prior art keywords
vpn
detection
dns
detection result
test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010286040.2A
Other languages
Chinese (zh)
Inventor
徐国爱
张淼
姜惠颖
徐国胜
郭燕慧
王浩宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202010286040.2A priority Critical patent/CN111625823A/en
Publication of CN111625823A publication Critical patent/CN111625823A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
    • H04L63/0272Virtual private networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明提供一种Andriod平台VPN应用的安全性检测方法,包括:构建敏感权限规则库,反编译VPN应用安装包,得到敏感权限检测结果;检测VPN应用的第三方库,得到第三方库列表;获取VPN应用的扫描报告,提取扫描结果,得到恶意行为检测结果;安装VPN应用至测试终端运行,建立线路连接,监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果,同时发送API请求,判断是否成功建立通信,得到IPV6泄露检测结果;断开VPN连接,访问测试IP地址,判断是否成功访问,得到kill‑switch检测结果;获取并分析VPN线路的加密协议,得到隧道配置检测结果。能够自动化,全面准确检测VPN应用的安全性。

Figure 202010286040

The invention provides a security detection method for VPN applications on the Andriod platform, comprising: constructing a sensitive authority rule base, decompiling a VPN application installation package, and obtaining a sensitive authority detection result; detecting a third-party library of the VPN application, and obtaining a third-party library list; Obtain the scan report of the VPN application, extract the scan result, and obtain the detection result of malicious behavior; install the VPN application to run on the test terminal, establish a line connection, monitor whether there is any DNS data that does not pass through the VPN tunnel, get the DNS leak detection result, and send API requests at the same time. Determine whether the communication is successfully established, and obtain the IPV6 leak detection result; disconnect the VPN connection, access the test IP address, determine whether the access is successful, and obtain the kill-switch detection result; acquire and analyze the encryption protocol of the VPN line, and obtain the tunnel configuration detection result. It can automatically, comprehensively and accurately detect the security of VPN applications.

Figure 202010286040

Description

Andriod平台VPN应用的安全性检测方法及装置Security detection method and device for VPN application on Android platform

技术领域technical field

本发明涉及技术领域,尤其涉及一种Andriod平台VPN应用的安全性检测方法及装置。The invention relates to the technical field, and in particular, to a security detection method and device for a VPN application on an Andriod platform.

背景技术Background technique

近年来,随着黑客攻击、监控和审查等资讯不断登上新闻头条,人们开始越来越注重网络隐私,网络安全正在迎来爆发期,而能够保护网络隐私的虚拟私人网络(VPN),也获得了越来越多的关注。使用VPN,所有的互联网流量都会通过第三方服务器进行加密和隧道传输,因此无法追溯到使用者的踪迹。目前,VPN应用已成为Google Play、APP Store等应用商店下载量最高的几类应用之一。In recent years, as information such as hacking attacks, surveillance and censorship continue to make headlines, people have begun to pay more and more attention to online privacy. Network security is ushering in an explosive period, and virtual private networks (VPNs), which can protect online privacy, also gained more and more attention. With a VPN, all internet traffic is encrypted and tunneled through a third-party server, so it cannot be traced back to the user. At present, VPN applications have become one of the most downloaded applications in Google Play, APP Store and other application stores.

鉴于VPN应用的特殊性,这些应用在用户使用过程中也带来很多安全和隐私问题。一方面,用户一旦使用VPN服务,所有的网络流量都将会通过VPN服务器传输,然而很多VPN应用在实现的过程中不能提供完整的安全匿名服务,存在各种安全漏洞,导致存在用户敏感信息泄露的风险。另一方面,VPN应用具有较高的权限,而很多恶意应用会伪装成VPN应用获取用户隐私信息甚至存在传播恶意代码和推送恶意广告等行为,给用户带来严重的安全威胁。Given the particularity of VPN applications, these applications also bring a lot of security and privacy issues to users. On the one hand, once a user uses a VPN service, all network traffic will be transmitted through the VPN server. However, many VPN applications cannot provide complete security and anonymity services during the implementation process, and there are various security loopholes, resulting in the leakage of user sensitive information. risks of. On the other hand, VPN applications have high permissions, and many malicious applications will disguise themselves as VPN applications to obtain users' private information and even spread malicious codes and push malicious advertisements, which brings serious security threats to users.

现有的Android应用检测方法,无法很好的评估VPN应用提供服务的安全性。因此,亟需一种针对VPN应用的全面完善的安全隐私检测方案。The existing Android application detection methods cannot well evaluate the security of the services provided by VPN applications. Therefore, a comprehensive and complete security and privacy detection scheme for VPN applications is urgently needed.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明的目的在于提出一种Andriod平台VPN应用的安全性检测方法及装置,以解决现有的Android应用检测方法,无法很好的评估VPN应用提供服务的安全性的问题。In view of this, the purpose of the present invention is to propose a security detection method and device for a VPN application on an Andriod platform, so as to solve the problem that the existing Android application detection method cannot well evaluate the security of a VPN application service.

基于上述目的,本发明提供了一种Andriod平台VPN应用的安全性检测方法,包括:Based on the above purpose, the present invention provides a security detection method for an Andriod platform VPN application, including:

分析Andriod权限文档,构建敏感权限规则库,反编译VPN应用安装包,获取权限文档,匹配标签,提取权限列表并匹配敏感权限规则库,得到敏感权限检测结果;Analyze Andriod permission documents, build sensitive permission rule base, decompile VPN application installation package, obtain permission documents, match tags, extract permission list and match sensitive permission rule base, and get sensitive permission detection results;

使用检测命令检测VPN应用的第三方库,得到列表第三方库列表,所述第三方库包括广告库、游戏引擎库、地图定位服务库以及移动分析库等中的至少一种的;Use the detection command to detect the third-party library of the VPN application, and obtain a list of third-party libraries, where the third-party library includes at least one of an advertisement library, a game engine library, a map location service library, and a mobile analysis library;

获取VPN应用的virustotal扫描报告,提取并分析扫描报告中AV引擎扫描被测应用恶意行为的结果,得到恶意行为检测结果;Obtain the virustotal scan report of the VPN application, extract and analyze the result of the AV engine scanning the malicious behavior of the tested application in the scan report, and obtain the malicious behavior detection result;

安装VPN应用至测试终端运行,定位线路列表,解析线路列表的名称,循环遍历线路列表,建立线路连接,并分别进行DNS和IPV6泄露检测、kill-switch检测以及隧道配置检测;Install the VPN application to the test terminal to run, locate the line list, resolve the name of the line list, loop through the line list, establish line connections, and perform DNS and IPV6 leak detection, kill-switch detection, and tunnel configuration detection respectively;

其中,DNS和IPV6泄露检测包括,向测试机的默认DNS服务器发送DNS请求,监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果;同时发送API请求,判断是否成功建立通信,得到IPV6泄露检测结果;Among them, DNS and IPV6 leak detection includes sending a DNS request to the default DNS server of the test machine, monitoring whether any DNS data does not pass through the VPN tunnel, and obtaining the DNS leak detection result; at the same time, sending an API request to determine whether the communication is successfully established, and obtaining the IPV6 leak Test results;

kill-switch检测包括,阻塞VPN连接,制造VPN掉线,访问测试IP地址,判断是否若成功访问,得到kill-switch检测结果;Kill-switch detection includes blocking VPN connections, creating VPN disconnects, accessing test IP addresses, and judging whether the access is successful, and obtaining the kill-switch detection results;

隧道配置检测包括,获取通过VPN线路的流量数据,分析所述流量数据,提取VPN线路的加密协议分析所述加密协议,得到隧道配置的检测结果。The tunnel configuration detection includes: acquiring traffic data passing through the VPN line, analyzing the traffic data, extracting the encryption protocol of the VPN line, analyzing the encryption protocol, and obtaining the detection result of the tunnel configuration.

在其中一个实施例中,所述监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果包括,In one embodiment, the monitoring whether there is DNS data that does not pass through the VPN tunnel, and obtaining a DNS leak detection result includes:

使用tcpdump命令抓取经过VPN隧道的数据包,将数据包生成pcap文件,并将pcap文件传输至测试终端,解析pcap文件数据,当存在端口号为DNS协议默认端口号的UDP流量时,判断为检测到DNS请求,存在DNS泄露。Use the tcpdump command to capture the data packets passing through the VPN tunnel, generate pcap files from the data packets, transfer the pcap files to the test terminal, and parse the pcap file data. When there is UDP traffic whose port number is the default port number of the DNS protocol, it is judged as DNS request detected, there is a DNS leak.

在其中一个实施例中,所述判断是否成功建立通信,得到IPV6泄露检测结果包括:In one embodiment, the judging whether the communication is successfully established, and obtaining the IPV6 leak detection result includes:

使用curl命令向网络协议ipv6-tes提供的测试API发送通信请求,当获取到正确的请求响应码时,判断为产生IPV6泄露,得到IPV6泄露的检测结果。Use the curl command to send a communication request to the test API provided by the network protocol ipv6-tes. When the correct request response code is obtained, it is determined that an IPV6 leak has occurred, and the detection result of the IPV6 leak is obtained.

在其中一个实施例中,所述判断是否若成功访问,得到kill-switch检测结果包括:In one of the embodiments, if the judgment is successful, the kill-switch detection result obtained includes:

在PF防火墙的配置文件中添加阻塞所有出站连接,放行测试IP连接的规则;Add a rule to block all outbound connections and release the test IP connection in the configuration file of the PF firewall;

导入添加规则后的PF防火墙的配置文件;Import the configuration file of the PF firewall after adding the rules;

开启添加规则后的PF防火墙;Open the PF firewall after adding rules;

向测试IP发送连接请求,当连接成功时,得到未设置kill-switch的检测结果。Send a connection request to the test IP, and when the connection is successful, the test result that kill-switch is not set is obtained.

在其中一个实施例中,所述分析Andriod权限文档,构建敏感权限规则库包括:In one embodiment, the analysis of the Andriod permission document and the construction of the sensitive permission rule base include:

提取Android权限文档中的所有权限;Extract all permissions in the Android permissions document;

将权限映射为资费,联网,短信,电话,隐私相关的类别,选取隐私相关类别的权限;Map permissions to tariff, networking, SMS, phone, privacy-related categories, and select permissions for privacy-related categories;

将隐私相关类别的权限中的权限类别、权限个数、权限名称和权限说明一一对应为列表,得到敏感权限规则库。The permission categories, the number of permissions, the permission names, and the permission descriptions in the permissions of the privacy-related categories are mapped one-to-one as a list to obtain a sensitive permission rule base.

在其中一个实施例中,所述获取VPN应用的VirusTotal扫描报告包括:In one embodiment, obtaining the VirusTotal scan report of the VPN application includes:

计算VPN应用程序安装包的哈希值,以哈希值为参数调用VirusTotal数据库第一接口,获取数据库中的扫描报告;或调用第二接口,扫描VPN应用程序安装包,得到扫描报告,其中,所述扫描报告包括,被测应用是否被AV引擎标记为恶意软件的扫描结果。Calculate the hash value of the VPN application installation package, call the first interface of the VirusTotal database with the hash value as a parameter, and obtain the scan report in the database; or call the second interface, scan the VPN application installation package, and obtain the scan report, wherein, The scan report includes the scan result of whether the application under test is marked as malware by the AV engine.

在其中一个实施例中,所述获取通过VPN线路的流量数据包括:In one of the embodiments, the acquiring traffic data passing through the VPN circuit includes:

使用curl命令构造网络流量;Use the curl command to construct network traffic;

使用tcpdump命令抓取数据包;Use the tcpdump command to capture packets;

将数据包生成pcap文件,得到流量数据;Generate a pcap file from the data packet to get the traffic data;

所述获取API端口数据,包括使用curl命令构造请求IPIP.net提供的API端口的数据。The acquiring API port data includes using the curl command to construct data requesting the API port provided by IPIP.net.

在其中一个实施例中,所述分析所述加密协议,得到隧道配置的检测结果包括:In one embodiment, the analysis of the encryption protocol to obtain a detection result of the tunnel configuration includes:

分析所述加密协议是否为不安全的协议,当协议不属于IPSec、Open VPN或SSLVPN协议中时,得到隧道配置不安全的检测结果。It is analyzed whether the encryption protocol is an insecure protocol, and when the protocol does not belong to the IPSec, Open VPN or SSLVPN protocols, a detection result that the tunnel configuration is insecure is obtained.

在其中一个实施例中,使用检测命令检测VPN应用的第三方库包括:使用pythonLibRadar/libradar.py someapp.apk检测命令检测VPN应用中的第三方库。In one embodiment, using the detection command to detect the third-party library of the VPN application includes: using the pythonLibRadar/libradar.py someapp.apk detection command to detect the third-party library in the VPN application.

本发明实施例还提供一种Andriod平台VPN应用的安全性检测装置,包括:An embodiment of the present invention also provides a security detection device for a VPN application on an Andriod platform, including:

敏感权限检测模块,用于分析Andriod权限文档,构建敏感权限规则库,反编译VPN应用安装包,获取权限文档,匹配标签,提取权限列表并匹配敏感权限规则库,得到敏感权限检测结果;Sensitive permission detection module, used to analyze Andriod permission documents, build sensitive permission rule base, decompile VPN application installation package, obtain permission documents, match tags, extract permission list and match sensitive permission rule base, and get sensitive permission detection results;

第三方库检测模块,使用检测命令检测VPN应用的第三方库,得到列表第三方库列表,所述第三方库包括广告库、游戏引擎库、地图定位服务库以及移动分析库等中的至少一种的;The third-party library detection module uses the detection command to detect the third-party library of the VPN application, and obtains a list of third-party libraries, where the third-party library includes at least one of an advertisement library, a game engine library, a map location service library, and a mobile analysis library. species;

恶意行为检测模块,获取VPN应用的扫描报告,提取并分析扫描报告中对恶意广告弹出、强制修改设备设置和自动安装特定应用的扫描结果,得到恶意行为检测结果;The malicious behavior detection module obtains the scan report of the VPN application, extracts and analyzes the scan results of the pop-up of malicious advertisements, forced modification of device settings and automatic installation of specific applications in the scan report, and obtains the detection result of malicious behavior;

线路连接模块,用于安装VPN应用至测试终端运行,定位线路列表,解析线路列表的名称,循环遍历线路列表,建立线路连接;The line connection module is used to install the VPN application to the test terminal to run, locate the line list, parse the name of the line list, loop through the line list, and establish the line connection;

DNS和IPV6泄露检测模块,用于向测试机的默认DNS服务器发送DNS请求,监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果;同时发送API请求,判断是否成功建立通信,得到IPV6泄露检测结果;The DNS and IPV6 leak detection module is used to send DNS requests to the default DNS server of the test machine to monitor whether there is any DNS data that does not pass through the VPN tunnel, and obtain the DNS leak detection result; at the same time, it sends an API request to determine whether the communication is successfully established, and the IPV6 leak is obtained. Test results;

kill-switch检测模块,用于阻塞VPN连接,制造VPN掉线,访问测试IP地址,判断是否若成功访问,得到kill-switch检测结果;The kill-switch detection module is used to block the VPN connection, make the VPN disconnect, access the test IP address, and determine whether the access is successful, and get the kill-switch detection result;

隧道配置检测模块,用于获取通过VPN线路的流量数据,分析所述流量数据,提取VPN线路的加密协议,分析所述加密协议,得到隧道配置的检测结果。The tunnel configuration detection module is used for acquiring traffic data passing through the VPN line, analyzing the traffic data, extracting the encryption protocol of the VPN line, analyzing the encryption protocol, and obtaining the detection result of the tunnel configuration.

从上面所述可以看出,本发明提供的Andriod平台VPN应用的安全性检测方法和装置,通过构建敏感权限规则库,反编译VPN应用安装包,提取权限列表并匹配敏感权限规则库,对VPN应用进行敏感权限检测;通过检测命令对VPN应用的第三方库进行检测;通过获取分析Virustotal扫描报告的恶意行为扫描结果,对恶意行为进行检测;通过监控是否有DNS数据不通过VPN隧道和判断是否成功建立ipv6通信,对DNS泄露和IPV6泄露进行检测;通过制造VPN掉线后,判断是否成功访问测试IP地址,对kill-switch进行检测;通过获取并分析通过VPN隧道的加密协议,对隧道的加密协议的安全性进行检测;从而实现了及时有效的全面自动检测具有安全风险的VPN应用,能够规避可能的用户隐私泄露风险以及恶意行为造成的危害。As can be seen from the above, the security detection method and device for VPN applications on the Andriod platform provided by the present invention, by constructing a sensitive authority rule base, decompiling the VPN application installation package, extracting the authority list and matching the sensitive authority rule base, to the VPN Sensitive permission detection for applications; detection of third-party libraries of VPN applications through detection commands; detection of malicious behaviors by obtaining and analyzing malicious behavior scan results of Virustotal scan reports; by monitoring whether DNS data does not pass through the VPN tunnel and determining whether IPv6 communication is successfully established, and DNS leaks and IPV6 leaks are detected; after the VPN is disconnected, it is judged whether the test IP address is successfully accessed, and the kill-switch is detected; by obtaining and analyzing the encryption protocol passing through the VPN tunnel, the The security of the encryption protocol is detected; thus, the timely and effective comprehensive automatic detection of VPN applications with security risks can be realized, and the possible risks of user privacy leakage and the harm caused by malicious behavior can be avoided.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明实施例的Andriod平台VPN应用的安全性检测方法的流程示意图;1 is a schematic flowchart of a security detection method for an Andriod platform VPN application according to an embodiment of the present invention;

图2为本发明实施例的分析Andriod权限文档,构建敏感权限规则库的流程示意图;2 is a schematic flowchart of analyzing an Andriod permission document and constructing a sensitive permission rule base according to an embodiment of the present invention;

图3为本发明实施例的建立线路连接的流程示意图;FIG. 3 is a schematic flowchart of establishing a line connection according to an embodiment of the present invention;

图4为本发明实施例的线路解析过程示意图;4 is a schematic diagram of a line analysis process according to an embodiment of the present invention;

图5为本发明实施例的判断是否若成功访问,得到kill-switch检测结果的流程示意图;5 is a schematic flowchart of a kill-switch detection result obtained by judging whether the access is successful according to an embodiment of the present invention;

图6为本发明实施例的获取通过VPN线路的流量数据的流程示意图;6 is a schematic flowchart of obtaining traffic data passing through a VPN line according to an embodiment of the present invention;

图7为本发明实施例的隧道配置检测过程的流程示意图;7 is a schematic flowchart of a tunnel configuration detection process according to an embodiment of the present invention;

图8为本发明实施例的面向Android平台VPN应用的安全隐私分析系统架构图。FIG. 8 is an architecture diagram of a security and privacy analysis system for a VPN application on an Android platform according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明进一步详细说明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.

需要说明的是,除非另外定义,本发明实施例使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。本公开中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。“上”、“下”、“左”、“右”等仅用于表示相对位置关系,当被描述对象的绝对位置改变后,则该相对位置关系也可能相应地改变。It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of the present invention shall have the usual meanings understood by those with ordinary skill in the art to which the present disclosure belongs. As used in this disclosure, "first," "second," and similar terms do not denote any order, quantity, or importance, but are merely used to distinguish the various components. "Comprises" or "comprising" and similar words mean that the elements or things appearing before the word encompass the elements or things recited after the word and their equivalents, but do not exclude other elements or things. Words like "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "Down", "Left", "Right", etc. are only used to represent the relative positional relationship, and when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

本发明的发明人注意到VPN是一类下载量大,应用权限高且声称提供在线安全隐私增强服务的应用,对比其他Android应用,对安全隐私的要求更高。发明人在长期的Android应用的安全性研究工作中分析,目前面向Android应用的分析方法,只能检测普遍的Android应用存在的安全问题,无法解决VPN中可能会出现的安全隐私问题,例如1)请求敏感权限:提供访问无关的用户信息的权限,比如读取短信内容、读取联系人、读取相册等,导致的隐私泄露。2)第三方追踪库即广告:存在第三方追踪库监视用户的线上行为及广告泛滥,导致的隐私泄露。3)DNS请求、IPv6流量泄露:VPN设置不当使Android终端在连接VPN应用后,继续使用终端所在网络默认的DNS服务器,而不是由匿名网络分配的计算机的匿名DNS服务器,导致的DNS请求被泄露;同时建立VPN连接时,插入IPv4默认路由,不支持IPv6协议,或者完全忽略了IPv6,使得发往IPv6地址的所有数据包使用本地IPv6路由器以纯文本形式发送,无法保护IPv6流量安全,共同导致用户访问网站的活动被记录和监控。4)不安全的隧道配置:未对私人网络进行加密,同时没有使用安全的协议对流量进行正确加密,使得用户的数据能够被中间人监视或者攻击。5)Kill Switch设置不正确,无法在VPN连接意外断开后,立即停止用户的设备或终止指定应用程序连接互联网,导致用户身份及流量暴露。6)恶意软件行为:存在例如恶意广告不断弹出、强制修改设备某些设置、自动安装特定应用等恶意行为。The inventor of the present invention has noticed that VPN is a type of application that has a large download volume, high application authority and claims to provide online security and privacy enhancement services. Compared with other Android applications, the VPN has higher requirements for security and privacy. The inventor has analyzed in the long-term security research work of Android applications. The current analysis method for Android applications can only detect the security problems existing in common Android applications, and cannot solve the security and privacy problems that may occur in VPNs, such as 1) Requesting sensitive permissions: Provide permission to access irrelevant user information, such as reading text messages, reading contacts, reading albums, etc., resulting in privacy leakage. 2) Third-party tracking libraries are advertisements: There are third-party tracking libraries to monitor users' online behaviors and the proliferation of advertisements, resulting in privacy leakage. 3) DNS request and IPv6 traffic leakage: Improper VPN settings make the Android terminal continue to use the default DNS server of the network where the terminal is located after connecting to the VPN application, instead of the anonymous DNS server of the computer assigned by the anonymous network, resulting in the leakage of DNS requests ;At the same time, when establishing a VPN connection, insert the IPv4 default route, do not support the IPv6 protocol, or completely ignore IPv6, so that all data packets sent to the IPv6 address are sent in plain text using the local IPv6 router, which cannot protect the security of IPv6 traffic, which will cause users The activity of visiting the website is recorded and monitored. 4) Insecure tunnel configuration: The private network is not encrypted, and the traffic is not properly encrypted using a secure protocol, so that the user's data can be monitored or attacked by the middleman. 5) The Kill Switch setting is incorrect, and it is impossible to immediately stop the user's device or terminate the specified application from connecting to the Internet after the VPN connection is accidentally disconnected, resulting in exposure of the user's identity and traffic. 6) Malware behavior: there are malicious behaviors such as malicious advertisements constantly popping up, forcibly modifying certain settings of the device, and automatically installing specific applications.

请参阅图8,发明人提出一种基于程序分析和自动化测试的对Andriod平台的VPN应用安全的隐私分析方法、装置及电子设备,通过构建敏感权限规则库,检测VPN应用的敏感权限;通过检测命令得到第三方库的列表;分析扫描报告得到恶意行为检测结果;触发应用的VPN连接,在动态检测环境下检测DNS和IPV6的泄露、检测kill-switch是否正确配置和检测隧道的加密协议是否安全。形成了一套静态分析动态分析相结合的完整的安全隐私分析方法,从而对VPN应用中存在的安全和隐私问题进行了全面的自动化检测分析,不仅能检测Android应用普遍的安全问题,也可以评估VPN应用提供的安全隐私服务,极大地提高了对VPN应用的安全性的检测结果的可靠性。Please refer to FIG. 8 , the inventor proposes a privacy analysis method, device and electronic device for VPN application security on the Andriod platform based on program analysis and automated testing. By building a sensitive permission rule base, the sensitive permissions of the VPN application are detected; Command to get the list of third-party libraries; analyze the scan report to get the detection results of malicious behavior; trigger the VPN connection of the application, detect DNS and IPV6 leaks in the dynamic detection environment, detect whether the kill-switch is configured correctly, and detect whether the encryption protocol of the tunnel is secure . A complete set of security and privacy analysis methods combined with static analysis and dynamic analysis are formed, so as to conduct a comprehensive automatic detection and analysis of security and privacy problems existing in VPN applications, which can not only detect common security problems in Android applications, but also evaluate The security privacy service provided by the VPN application greatly improves the reliability of the detection result of the security of the VPN application.

请参阅图1,为本发明提供的一种Andriod平台VPN应用的安全性检测方法,包括:Please refer to FIG. 1, which is a security detection method for an Andriod platform VPN application provided by the present invention, including:

S100,分析Andriod权限文档,构建敏感权限规则库,反编译VPN应用安装包,获取权限文档,匹配标签,提取权限列表并匹配敏感权限规则库,得到敏感权限检测结果;S100, analyze the Andriod permission document, build the sensitive permission rule base, decompile the VPN application installation package, obtain the permission document, match the label, extract the permission list and match the sensitive permission rule base, and obtain the sensitive permission detection result;

S200,使用检测命令检测VPN应用的第三方库,得到第三方库的列表;S200, use the detection command to detect the third-party library of the VPN application, and obtain a list of the third-party library;

S300,获取VPN应用的virustotal扫描报告,分析扫描报告中搜索引擎的恶意行为扫描结果,得到恶意行为检测结果;S300, obtain the virustotal scanning report of the VPN application, analyze the malicious behavior scanning result of the search engine in the scanning report, and obtain the malicious behavior detection result;

S400,向测试机的默认DNS服务器发送DNS请求,监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果;同时发送API请求,判断是否成功建立IPV6通信,得到IPV6泄露检测结果;S400, send a DNS request to the default DNS server of the test machine, monitor whether any DNS data does not pass through the VPN tunnel, and obtain the DNS leak detection result; at the same time, send an API request to determine whether IPV6 communication is successfully established, and obtain the IPV6 leak detection result;

S500,制造VPN掉线,访问测试IP地址,判断是否成功访问,得到kill-switch检测结果;S500, make the VPN disconnected, access the test IP address, determine whether the access is successful, and obtain the kill-switch detection result;

S600,获取通过VPN线路的流量数据,分析所述流量数据,提取VPN线路的加密协议,分析所述加密协议,得到隧道配置的检测结果。S600: Acquire traffic data passing through the VPN line, analyze the traffic data, extract an encryption protocol of the VPN line, analyze the encryption protocol, and obtain a tunnel configuration detection result.

本发明提供的Andriod平台VPN应用的安全性检测方法,通过构建敏感权限规则库,反编译VPN应用安装包,提取权限列表并匹配敏感权限规则库,对VPN应用进行敏感权限检测;通过检测命令对VPN应用的第三方库进行检测;通过获取分析virustotal扫描报告中恶意行为扫描结果,对恶意行为进行检测;通过监控是否有DNS数据不通过VPN隧道和判断是否成功建立ipv6通信,对DNS泄露和IPV6泄露进行检测;通过制造VPN掉线,判断是否成功访问测试IP地址,对kill-switch进行检测;通过获取并分析通过VPN隧道的流量数据的IP和加密协议,对隧道的IP及协议的安全性进行检测;从而实现了及时有效的全面自动检测具有安全风险的VPN应用,能够规避可能的用户隐私泄露风险以及恶意行为造成的危害。The security detection method of the VPN application on the Andriod platform provided by the present invention, by constructing a sensitive authority rule base, decompiling the VPN application installation package, extracting the authority list and matching the sensitive authority rule base, to perform sensitive authority detection on the VPN application; The third-party library of the VPN application is used for detection; by obtaining and analyzing the malicious behavior scanning results in the virustotal scan report, the malicious behavior is detected; by monitoring whether there is DNS data that does not pass through the VPN tunnel and judging whether the ipv6 communication is successfully established, the DNS leak and IPV6 Leak detection; determine whether the test IP address is successfully accessed by creating a VPN disconnection, and detect the kill-switch; by obtaining and analyzing the IP and encryption protocol of the traffic data passing through the VPN tunnel, the security of the tunnel IP and protocol Therefore, the timely and effective comprehensive automatic detection of VPN applications with security risks can be realized, and the possible risks of user privacy leakage and the harm caused by malicious behavior can be avoided.

请参阅图2,步骤S100中,所述分析Andriod权限文档,构建敏感权限规则库包括:Please refer to FIG. 2. In step S100, the analysis of the Andriod permission document and the construction of the sensitive permission rule base include:

S110,提取Android权限文档中的所有权限;S110, extract all permissions in the Android permissions document;

S120,将权限映射为资费,联网,短信,电话,隐私的类别,选取隐私类别的权限;S120, map the permissions to tariff, networking, SMS, phone, and privacy categories, and select the permissions of the privacy category;

S130,将隐私类别的权限中的权限类别、权限个数、权限名称和权限说明一一对应为列表,得到敏感权限规则库。S130 , one-to-one correspondence among the permission categories, the number of permissions, the permission names, and the permission descriptions in the permissions of the privacy category is made into a list to obtain a sensitive permission rule base.

具体地,S110中,Android权限文档可以获取自Android官方网站。对权限文档进行分析后,提取其中的所有权限,权限包括多种类别和多种级别。Specifically, in the S110, the Android permission document can be obtained from the Android official website. After analyzing the permission document, extract all the permissions in it, and the permissions include various categories and levels.

S120中,通过对所有权限一一进行映射,得到资费,联网,短信,电话,隐私相关等多种类别,选取其中的隐私相关类别的权限。In S120, by mapping all the permissions one by one, various categories such as tariffs, networking, text messages, phone calls, and privacy-related categories are obtained, and the permissions of the privacy-related categories are selected.

S130中,权限类别可以包括隐私权限和其它权限。在一个具体的实施例中,可从Android权限列表中提取40个隐私相关权限,其中包括19个和用户隐私数据关系紧密的隐私权限,和21个隐私程度较低的其他权限,对应的敏感权限规则库的示例如下表1。In S130, the permission category may include privacy permission and other permissions. In a specific embodiment, 40 privacy-related permissions can be extracted from the Android permission list, including 19 privacy permissions that are closely related to user privacy data, and 21 other permissions with a lower degree of privacy, corresponding to sensitive permissions An example of the rule base is shown in Table 1 below.

表1Android部分隐私相关权限Table 1 Some privacy-related permissions of Android

Figure BDA0002448554370000081
Figure BDA0002448554370000081

可以通过APKTool工具进行反编译VPN应用APK文件(安装包),获取AndroidManifest.xml文件(权限文档)。Apktool是google提供的反编译工具,能够反编译及回编译apk,同时安装反编译系统apk所需要的framework-res框架。在本实施例中,可以通过decode命令执行,例如“apktool d<file.apk><dir>,进行反编译apk文件。其中,<file.apk>为待反编译的apk文件的路径,<dir>为反编译所得文件的存储位置。You can use the APKTool tool to decompile the VPN application APK file (installation package) and obtain the AndroidManifest.xml file (permission document). Apktool is a decompilation tool provided by google, which can decompile and recompile apk, and install the framework-res framework required by the decompile system apk. In this embodiment, the decode command can be executed, such as "apktool d<file.apk><dir>, to decompile the apk file. Wherein, <file.apk> is the path of the apk file to be decompiled, and <dir > is the storage location of the decompiled files.

标签可以为AndroidManifest.xml<permission>,对Android Manifest.xml匹配该标签后,可以获得APK声明的权限列表。The tag can be AndroidManifest.xml<permission>. After matching this tag to Android Manifest.xml, you can get the list of permissions declared by the APK.

通过构建敏感权限规则库,将隐私相关权限的权限类别、权限个数、权限名称和权限说明一一对应,可以快速准确地识别反编译VPN应用APK文件后所得权限列表中的隐私权限,提高Andriod平台VPN应用的检测效率。By building a sensitive permission rule base, the permission categories, number of permissions, permission names and permission descriptions of privacy-related permissions can be mapped one-to-one, which can quickly and accurately identify the privacy permissions in the permission list obtained after decompiling the VPN application APK file, and improve Andriod Detection efficiency of platform VPN applications.

步骤S200中,第三方库为一种在应用开发中的可复用软件资源,第三方库可以包括。使用检测命令检测VPN应用的第三方库包括:使用python LibRadar/libradar.pysomeapp.apk检测命令检测VPN应用中的第三方库。In step S200, the third-party library is a reusable software resource in application development, and the third-party library may be included. The third-party libraries that use the detection command to detect VPN applications include: use the python LibRadar/libradar.pysomeapp.apk detection command to detect third-party libraries in VPN applications.

检测所得第三方库列表中,可以包括广告库、游戏引擎库、社交网络库、地图定位服务库以及移动分析库等中的至少一种。广告库可以例如Admob,Inmobi;游戏引擎库可以例如Unity3D,Badlogic;地图定位服务库可以例如Baidu Location,AmapLocation;移动分析库可以例如Umeng,Flurry和Analytics。The detected third-party library list may include at least one of an advertisement library, a game engine library, a social network library, a map location service library, and a mobile analysis library. The advertisement library may be, for example, Admob, Inmobi; the game engine library may be, for example, Unity3D, Badlogic; the map location service library may be, for example, Baidu Location, AmapLocation; the mobile analysis library may be, for example, Umeng, Flurry and Analytics.

通过使用python LibRadar/libradar.py someapp.apk检测命令检测第三方库,可以有效识别与主应用程序界限模糊的,由Dalvik字节码编译的第三方库,从而高效快速地检测出VPN应用中存在的第三方库。By using the python LibRadar/libradar.py someapp.apk detection command to detect third-party libraries, it can effectively identify the third-party libraries that are blurred with the main application and compiled by Dalvik bytecode, so as to efficiently and quickly detect the existence of VPN applications. third-party library.

步骤S300中,所述获取VPN应用的扫描报告包括:In step S300, the obtaining of the scan report of the VPN application includes:

构建脚本访问VirusTotal服务网站;计算VPN应用程序安装包的哈希值,以哈希值为参数调用数据库第一接口,获取数据库中的扫描报告;或调用第二接口,扫描VPN应用程序安装包,得到扫描报告。Build the script to access the VirusTotal service website; calculate the hash value of the VPN application installation package, call the first interface of the database with the hash value as a parameter, and obtain the scan report in the database; or call the second interface to scan the VPN application installation package, Get a scan report.

数据库可以为VirusTotal服务网站中的数据库。该网站可以针对可疑文件和网址进行扫描,得到扫描报告。VirusTotal的数据库中存储有哈希值和对应的扫描报告。The database may be a database in the VirusTotal service website. The website can scan for suspicious files and URLs and get scan reports. Hash values and corresponding scan reports are stored in VirusTotal's database.

第一接口可以为“https://www.virustotal.com/vtapi/v2/file/report”接口。通过该第一接口,能够访问到数据库中,在数据库中查找是否存在与VPN应用程序安装包的哈希值相同的哈希值。当查找到相同的哈希值时,提取与该哈希值对应的扫描报告。当查找不到对应的哈希值时,调用第二接口。The first interface may be the "https://www.virustotal.com/vtapi/v2/file/report" interface. Through the first interface, it is possible to access the database to find out whether there is a hash value that is the same as the hash value of the VPN application installation package. When the same hash value is found, the scan report corresponding to the hash value is extracted. When the corresponding hash value cannot be found, the second interface is called.

具体地,第二接口可以为“https://www.virustotal.com/vtapi/v2/file/scan”接口。通过该第二接口,可以将VPN应用程序的APK文件(安装包)发送至VirusTotal,通过VirusTotal的AV(Anti Virus)引擎进行扫描,得到扫描报告。AV引擎可扫描文件是否存在病毒及恶意行为。Specifically, the second interface may be the "https://www.virustotal.com/vtapi/v2/file/scan" interface. Through the second interface, the APK file (installation package) of the VPN application can be sent to VirusTotal, and scanned by the AV (Anti Virus) engine of VirusTotal to obtain a scan report. The AV engine scans files for viruses and malicious behavior.

其中,扫描报告的格式可以为JSON。所述扫描报告的内容可以包括,扫描的ID、APK的各种常用哈希值以及若干AV引擎的扫描结果。只要扫描结果中,被测应用(即VPN应用或者与VPN应用安装包哈希值相同的应用)被AV引擎中的任意一个搜索引擎标记为恶意文件,则恶意行为检测结果为存在恶意行为。The format of the scan report can be JSON. The content of the scan report may include the scanned ID, various common hash values of the APK, and the scan results of several AV engines. As long as the application under test (that is, the VPN application or the application with the same hash value as the VPN application installation package) in the scan result is marked as a malicious file by any search engine in the AV engine, the malicious behavior detection result is malicious behavior.

通过计算VPN应用安装包的哈希值,调用第一接口“https://www.virustotal.com/vtapi/v2/file/report”直接获取VirusTotal数据库中与哈希值对应的扫描报告或通过调用第二接口“https://www.virustotal.com/vtapi/v2/file/scan”,对VPN应用安装包进行扫描获取扫描报告,并提取分析扫描报告中的扫描结果的恶意文件标志,能够快速有效地自动检测是否存在恶意行为。By calculating the hash value of the VPN application installation package, call the first interface "https://www.virustotal.com/vtapi/v2/file/report" to directly obtain the scan report corresponding to the hash value in the VirusTotal database, or by calling The second interface "https://www.virustotal.com/vtapi/v2/file/scan" scans the VPN application installation package to obtain a scan report, and extracts and analyzes the malicious file flag of the scan result in the scan report, which can quickly Effective automatic detection of malicious behavior.

步骤S300之后,S400至S600之前,还包括S700,安装VPN应用至测试终端运行,定位线路列表,解析线路列表的名称,循环遍历线路列表,建立线路连接。After step S300, and before step S400 to S600, it also includes S700, installing the VPN application to run the test terminal, locating the line list, parsing the name of the line list, looping through the line list, and establishing a line connection.

如图3,该步骤S700,具体可以包括:As shown in Figure 3, this step S700 may specifically include:

S710,将VPN应用的安装包推送到测试机上,自动安装VPN应用;S710, push the VPN application installation package to the test machine, and automatically install the VPN application;

S720,根据编写的脚本,使用Appium提供的API(Application ProgrammingInterface)应用程序编程接口,打开测试应用,并定位到线路列表页面。其中,Appium为开源测试自动化框架,在本实施例中可以通过Node.js接口实现与测试应用的连接。The S720, according to the script written, uses the API (Application Programming Interface) application programming interface provided by Appium, opens the test application, and locates the line list page. Among them, Appium is an open source test automation framework, and in this embodiment, the connection with the test application can be realized through the Node.js interface.

S730,使用Appium提供的page source API获取线路列表页面的UI层级结构,并根据线路列表控件的resource-id将线路列表名称解析出来。其解析过程如图4所示。S730, use the page source API provided by Appium to obtain the UI hierarchy structure of the line list page, and parse out the line list name according to the resource-id of the line list control. Its analysis process is shown in Figure 4.

S740,循环遍历线路列表,建立VPN线路连接并执行测试。S740, loop through the line list, establish a VPN line connection and execute the test.

通过定位线路列表,解析线路列表的名称,循环遍历线路列表,建立线路连接,能够提供动态的检测环境,便于进行DNS和IPV6泄露检测、kill-switch检测和隧道配置检测。By locating the line list, resolving the name of the line list, looping through the line list, and establishing line connections, it can provide a dynamic detection environment, which is convenient for DNS and IPV6 leak detection, kill-switch detection and tunnel configuration detection.

步骤S400中,所述监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果可以包括,In step S400, the monitoring whether there is DNS data that does not pass through the VPN tunnel, and obtaining a DNS leak detection result may include:

抓取经过VPN隧道的数据包,将数据包生成pcap文件,并将pcap文件传输至测试终端,解析pcap文件数据,当存在端口号为DNS协议默认端口号53的UDP流量时,判断为检测到DNS请求,存在DNS泄露。Capture the data packets passing through the VPN tunnel, generate pcap files from the data packets, transmit the pcap files to the test terminal, and parse the pcap file data. When there is UDP traffic whose port number is the default port number 53 of the DNS protocol, it is judged as detected. DNS request, there is DNS leak.

具体地,可以通过“tcpdump-i ens33”命令抓取经过VPN隧道的数据包。pcap文件为数据报存储格式,总体结构为文件头-数据包头1-数据包1-数据包头2-数据包2等的形式。通过解析pcap文件中的数据包,能够得到传输数据端口号。将解析流量的端口号为53时,则判断为检测到DNS请求,存在DNS泄露。Specifically, you can use the "tcpdump-i ens33" command to capture the data packets passing through the VPN tunnel. The pcap file is a datagram storage format, and the overall structure is in the form of file header - data packet header 1 - data packet 1 - data packet header 2 - data packet 2 and so on. By parsing the data packets in the pcap file, the port number of the transmission data can be obtained. When the port number of the parsed traffic is 53, it is determined that a DNS request is detected and there is a DNS leak.

通过抓取经过VPN隧道的数据包,将数据包生成pcap文件并传输,在测试终端解析数据包中DNS流量,能够快速有效的判断是否存在DNS泄露。By capturing the data packets passing through the VPN tunnel, generating the data packets into pcap files and transmitting them, and analyzing the DNS traffic in the data packets at the test terminal, it is possible to quickly and effectively determine whether there is DNS leakage.

所述判断是否成功建立通信,得到IPV6泄露检测结果包括:Described judging whether the communication is successfully established, the obtained IPV6 leak detection result includes:

使用curl命令向网络协议ipv6-test提供的测试API发送通信请求,当获取到正确的请求响应码时,判断为存在IPV6泄露,得到网络协议IPV6泄露的检测结果。Use the curl command to send a communication request to the test API provided by the network protocol ipv6-test. When the correct request response code is obtained, it is determined that there is an IPV6 leak, and the detection result of the IPV6 leak of the network protocol is obtained.

具体地,curl命令可以为“adb shell curl--connect-timeout 20http://v6.ipv6-test.com/json/addrinfo.php?PHPSESSID=5tb5jfujicv8n6araprstm52n5”。正确的请求响应码可以为200。Specifically, the curl command may be "adb shell curl --connect-timeout 20http://v6.ipv6-test.com/json/addrinfo.php?PHPSESSID=5tb5jfujicv8n6araprstm52n5". The correct request response code can be 200.

通过“adb shell curl--connect-timeout 20http://v6.ipv6-test.com/json/addrinfo.php?PHPSESSID=5tb5jfujicv8n6araprstm52n5”命令和“200”响应码,能够准确的判断是否存在网络协议IPV6泄露。Through the "adb shell curl--connect-timeout 20http://v6.ipv6-test.com/json/addrinfo.php?PHPSESSID=5tb5jfujicv8n6araprstm52n5" command and the "200" response code, we can accurately determine whether there is a network protocol IPV6 leak .

步骤S500中,Kill Switch是指在线流量未通过VPN转发时阻止用户访问不受保护的互联网连接的功能。In step S500, Kill Switch refers to the function of preventing users from accessing unprotected Internet connections when online traffic is not forwarded through the VPN.

如图5所示,所述判断是否若成功访问,得到kill-switch检测结果包括:As shown in Figure 5, if the judgment is successful, the kill-switch detection result obtained includes:

S510,在PF防火墙的配置文件中添加阻塞所有出站连接,放行测试IP连接的规则;S510, add a rule to block all outbound connections and release the test IP connection in the configuration file of the PF firewall;

S520,导入添加规则后的PF防火墙的配置文件;S520, import the configuration file of the PF firewall after adding the rule;

S530,开启添加规则后的PF防火墙;S530, enable the PF firewall after adding the rule;

S540,向测试IP发送连接请求,当连接成功时,得到未设置kill-switch的检测结果。S540: Send a connection request to the test IP, and when the connection is successful, obtain a detection result that the kill-switch is not set.

PF防火墙(Packet Filter)为UNIX LIKE系统上进行TCP/IP流量过滤和网络地址转换的软件系统。PF防火墙的配置命令为pfctl。PF firewall (Packet Filter) is a software system that performs TCP/IP traffic filtering and network address translation on UNIX LIKE systems. The PF firewall configuration command is pfctl.

其中,步骤S510中,pfctl命令的配置文件为/etc/pf.conf,阻塞所有出站连接的规则可以为block out all;放行目的ip的规则可以为pass out any to{*ip}。也即,步骤S510具体为,在ptftcl的配置文件/etc/pf.conf中添加规则如下:block out all#阻塞所有出站连接;pass out any to{*ip}#放行目的ip为*ip的连接。Wherein, in step S510, the configuration file of the pfctl command is /etc/pf.conf, the rule for blocking all outbound connections may be block out all; the rule for releasing the destination ip may be pass out any to{*ip}. That is, step S510 is specifically, adding the following rules to the configuration file /etc/pf.conf of ptftcl: block out all#blocks all outbound connections; pass out any to{*ip}#releases the destination ip as *ip connect.

步骤S520中,可以通过执行命令“sudo pfctl-ef/etc/pf.conf,”导入添加规则后的PF防火墙的配置文件。In step S520, the configuration file of the PF firewall after adding the rule can be imported by executing the command "sudo pfctl-ef/etc/pf.conf,".

步骤S530中,可以通过执行命令“sudo pfctl–e”开启添加规则后的PF防火墙的配置文件。In step S530, the configuration file of the PF firewall after adding the rule can be opened by executing the command "sudo pfctl-e".

步骤S540中,如果能够连接成功IP地址,则可以成功访问测试IP地址。即在VPN连接意外断开的情况下,仍然能够访问测试IP地址。因此,连接意外断开时,无法停止或终止连接互联网,判断为未设置kill-switch。In step S540, if the IP address can be successfully connected, the test IP address can be successfully accessed. That is, in the event of an unexpected disconnection of the VPN connection, the test IP address can still be accessed. Therefore, when the connection is unexpectedly disconnected, the connection to the Internet cannot be stopped or terminated, and it is judged that the kill-switch is not set.

具体地,当测试终端收到SYN(Synchronize Sequence Numbers)同步序列编号和ACK(Acknowledge character)确认字符的数据包后,向测试IP发送确认数据包ACK(ack=k+1),进入ESTABLISHED状态后,即成功连接IP地址。Specifically, when the test terminal receives the data packet with the SYN (Synchronize Sequence Numbers) synchronization sequence number and the ACK (Acknowledge character) confirmation character, it sends the confirmation data packet ACK (ack=k+1) to the test IP, and enters the ESTABLISHED state. , that is, the IP address is successfully connected.

步骤S540之后,还包括步骤S550,关闭PF防火墙,完成测试。具体地,可以通过执行“sudo pfctl–d”命令关闭PF防火墙。After step S540, step S550 is also included to close the PF firewall to complete the test. Specifically, you can close the PF firewall by executing the "sudo pfctl -d" command.

通过使用pfctl控制PF防火墙阻塞除测试IP之外所有的出站连接来人为的制造VPN隧道故障,并访问测试IP地址。当检测到成功连接测试IP地址时,可以判断为在VPN服务器连接掉线情况下,无法停止用户的设备或终止指定应用程序连接互联网,终止与互联网的连接。也即,无法实现保护用户的在线活动和IP地址,在VPN服务器连接掉线情况下不能防止其突然暴露。因此,判断为未设置Kill Switch。Artificially fault the VPN tunnel by using pfctl to control the PF firewall to block all outbound connections except the test IP address and access the test IP address. When a successful connection to the test IP address is detected, it can be judged that in the case of the VPN server connection being dropped, it is impossible to stop the user's device or terminate the connection of the specified application to the Internet, and terminate the connection to the Internet. That is, protection of the user's online activity and IP address cannot be achieved, and it cannot be prevented from being suddenly exposed in the event of a VPN server connection being dropped. Therefore, it is determined that the Kill Switch is not set.

步骤S600中,如图6和图7,所述获取通过VPN线路的流量数据可以包括:In step S600, as shown in FIG. 6 and FIG. 7 , the acquiring traffic data passing through the VPN line may include:

S610,使用curl命令构造网络流量;S610, use the curl command to construct network traffic;

S620,使用tcpdump命令抓取数据包;S620, use the tcpdump command to capture data packets;

S630,将数据包生成pcap文件,得到流量数据。S630, generate a pcap file from the data packet to obtain flow data.

步骤S610中,使用curl命令构造大量的网络流量,能够尽快生成足够的网路流量以供分析,提高检测效率。In step S610, the curl command is used to construct a large amount of network traffic, which can generate enough network traffic for analysis as soon as possible and improve the detection efficiency.

步骤S630中,pcap文件的结构和形式与前文所述相同,此处不再赘述。步骤S630之后还包括,将pcap文件传输至测试终端,在测试终端解析pcap文件中的数据包,提取其中的IP地址和加密协议,得到VPN线路直接连接的目标网址的IP地址及加密协议。In step S630, the structure and form of the pcap file are the same as those described above, which will not be repeated here. After step S630, it also includes: transferring the pcap file to the test terminal, parsing the data packets in the pcap file at the test terminal, extracting the IP address and encryption protocol therein, and obtaining the IP address and encryption protocol of the target website directly connected by the VPN line.

还可以包括获取API端口数据,分析API端口返回的数据。具体地,获取API端口数据可以包括:使用curl命令构造请求IPIP.net提供的API端口的数据。API端口又称为应用编程接口,是一组定义、程序及协议的集合。因此,通过分析API端口返回的数据可以得到VPN实际访问目标网站的IP。It can also include acquiring API port data and analyzing the data returned by the API port. Specifically, acquiring the API port data may include: using a curl command to construct data requesting the API port provided by IPIP.net. An API port, also known as an application programming interface, is a collection of definitions, procedures, and protocols. Therefore, by analyzing the data returned by the API port, the IP of the target website actually accessed by the VPN can be obtained.

所述分析所述加密协议,得到隧道配置的检测结果包括:The analysis of the encryption protocol to obtain the detection result of the tunnel configuration includes:

分析所述加密协议是否为不安全的协议,当存在至少一个不安全的协议时,得到隧道配置不安全的检测结果。Analyze whether the encryption protocol is an insecure protocol, and obtain a detection result that the tunnel configuration is insecure when there is at least one insecure protocol.

应当说明的是,加密协议可能包括多个加密协议,只要判断为存在不安全的协议时,就判断为隧道配置不安全;当判断为不存在不安全的协议时,就判断为隧道配置不安全。判断时,可通过协议的名称判断是否为不安全的协议。例如当存在TCP、UDP、PPTP或L2TP协议中的至少一种时,判断为不安全的协议;当仅存在IPSec、IKEv2以及Open VPN协议中的至少一种时,判断为比较安全的协议。It should be noted that the encryption protocol may include multiple encryption protocols. As long as it is determined that there is an insecure protocol, the tunnel configuration is determined to be insecure; when it is determined that there is no insecure protocol, the tunnel configuration is determined to be insecure. . When judging, it can be judged by the name of the protocol whether it is an insecure protocol. For example, when there is at least one of the TCP, UDP, PPTP or L2TP protocols, it is determined as an insecure protocol; when there is only at least one of the IPSec, IKEv2 and Open VPN protocols, it is determined as a relatively secure protocol.

本发明提供的检测方法,对VPN应用中存在的安全和隐私问题进行了全面的总结分类,且能够进行自动化的检测。不仅能检测Android应用普遍的安全问题,也可以评估VPN应用提供的安全隐私服务。本发明所得检测结果可以为用户提供VPN应用的潜在风险,可能存在的隐私泄露和恶意行为,进而规避可能的隐私泄露风险和恶意行为;还可以为VPN开发者提供VPN应用中存在的安全漏洞,可能存在的被恶意攻击者利用的具体风险;还可以为市场管理者提供VPN应用中存在的恶意应用,需下架的应用。因此,本发明提供的检测方法,能够自动化且快速准确全面检测VPN应用可能存在的风险。The detection method provided by the present invention comprehensively summarizes and categorizes the security and privacy problems existing in the VPN application, and can perform automatic detection. Not only can it detect common security issues in Android applications, but it can also evaluate the security and privacy services provided by VPN applications. The detection results obtained by the present invention can provide users with potential risks of VPN applications, possible privacy leaks and malicious behaviors, thereby evading possible privacy leakage risks and malicious behaviors; and can also provide VPN developers with security loopholes existing in VPN applications, Possible specific risks of being exploited by malicious attackers; it can also provide market managers with malicious applications in VPN applications and applications that need to be removed. Therefore, the detection method provided by the present invention can automatically, rapidly, accurately and comprehensively detect the possible risks of VPN applications.

需要说明的是,本发明实施例的方法可以由单个设备执行,例如一台计算机或服务器等。本实施例的方法也可以应用于分布式场景下,由多台设备相互配合来完成。在这种分布式场景的情况下,这多台设备中的一台设备可以只执行本发明实施例的方法中的某一个或多个步骤,这多台设备相互之间会进行交互以完成所述的方法。It should be noted that, the method in this embodiment of the present invention may be executed by a single device, such as a computer or a server. The method in this embodiment can also be applied in a distributed scenario, and is completed by the cooperation of multiple devices. In the case of such a distributed scenario, one device among the multiple devices may only perform one or more steps in the method of the embodiment of the present invention, and the multiple devices will interact with each other to complete all the steps. method described.

上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

本发明实施例还提供一种Andriod平台VPN应用的安全性检测装置,包括:An embodiment of the present invention also provides a security detection device for a VPN application on an Andriod platform, including:

敏感权限检测模块,用于分析Andriod权限文档,构建敏感权限规则库,反编译VPN应用安装包,获取权限文档,匹配标签,提取权限列表并匹配敏感权限规则库,得到敏感权限检测结果;Sensitive permission detection module, used to analyze Andriod permission documents, build sensitive permission rule base, decompile VPN application installation package, obtain permission documents, match tags, extract permission list and match sensitive permission rule base, and get sensitive permission detection results;

第三方库检测模块,使用检测命令检测VPN应用的第三方库,得到第三方库列表,所述第三方库包括广告库、游戏引擎库、地图定位服务库以及移动分析库等中的至少一种;The third-party library detection module uses the detection command to detect the third-party library of the VPN application, and obtains a list of third-party libraries, where the third-party library includes at least one of an advertisement library, a game engine library, a map location service library, and a mobile analysis library. ;

恶意行为检测模块,获取VPN应用的扫描报告,提取并分析扫描报告中AV引擎扫描被测应用恶意行为的结果,得到恶意行为检测结果;The malicious behavior detection module obtains the scan report of the VPN application, extracts and analyzes the result of the AV engine scanning the malicious behavior of the tested application in the scan report, and obtains the malicious behavior detection result;

线路连接模块,用于安装VPN应用至测试终端运行,定位线路列表,解析线路列表的名称,循环遍历线路列表,建立线路连接;The line connection module is used to install the VPN application to the test terminal to run, locate the line list, parse the name of the line list, loop through the line list, and establish the line connection;

DNS和IPV6泄露检测模块,用于向Andriod平台的默认DNS服务器发送DNS请求,监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果;同时发送API请求,判断是否成功建立通信,得到IPV6泄露检测结果;The DNS and IPV6 leak detection module is used to send DNS requests to the default DNS server of the Andriod platform to monitor whether there is any DNS data that does not pass through the VPN tunnel, and obtain DNS leak detection results; at the same time, send API requests to determine whether the communication is successfully established and obtain IPV6 leaks Test results;

kill-switch检测模块,用于阻塞VPN连接,制造VPN掉线,访问测试IP地址,判断是否若成功访问,得到kill-switch检测结果;The kill-switch detection module is used to block the VPN connection, make the VPN disconnect, access the test IP address, and determine whether the access is successful, and get the kill-switch detection result;

隧道配置检测模块,用于获取通过VPN线路的流量数据,分析所述流量数据,提取VPN线路的加密协议,分析所述加密协议,得到隧道配置的检测结果。The tunnel configuration detection module is used for acquiring traffic data passing through the VPN line, analyzing the traffic data, extracting the encryption protocol of the VPN line, analyzing the encryption protocol, and obtaining the detection result of the tunnel configuration.

其中,所述DNS和IPV6泄露检测模块包括DNS泄露检测子模块,用于通过使用tcpdump命令抓取经过VPN隧道的数据包,将数据包生成pcap文件,并将pcap文件传输至测试终端,解析pcap文件数据,当存在端口号为DNS协议默认端口号的UDP流量时,判断为检测到DNS请求,存在DNS泄露,得到DNS泄露检测结果。The DNS and IPV6 leak detection module includes a DNS leak detection sub-module, which is used to capture the data packets passing through the VPN tunnel by using the tcpdump command, generate the pcap files from the data packets, transmit the pcap files to the test terminal, and parse the pcap files. For file data, when there is UDP traffic whose port number is the default port number of the DNS protocol, it is determined that a DNS request is detected and there is a DNS leak, and a DNS leak detection result is obtained.

其中,所述DNS和IPV6泄露检测模块还包括IPV6泄露检测子模块,用于使用curl命令向网络协议ipv6-test提供的测试API发送通信请求,当获取到正确的请求响应码时,得到IPV6泄露的检测结果。Wherein, the DNS and IPV6 leak detection module also includes an IPV6 leak detection sub-module, which is used to send a communication request to the test API provided by the network protocol ipv6-test using the curl command. When the correct request response code is obtained, the IPV6 leak is obtained. test results.

其中,所述kill-switch检测模块用于:在PF防火墙的配置文件中添加阻塞所有出站连接,放行测试IP连接的规则;Wherein, the kill-switch detection module is used for: adding blocking all outbound connections in the configuration file of the PF firewall, and releasing the rules for testing IP connections;

导入添加规则后的PF防火墙的配置文件;Import the configuration file of the PF firewall after adding the rules;

开启添加规则后的PF防火墙;Open the PF firewall after adding rules;

向测试IP发送连接请求,当连接成功时,得到未设置kill-switch的检测结果。Send a connection request to the test IP, and when the connection is successful, the test result that kill-switch is not set is obtained.

其中,所述敏感权限检测模块包括,敏感权限规则库构建子模块,用于:Wherein, the sensitive permission detection module includes a sensitive permission rule base construction sub-module, which is used for:

提取Android权限文档中的所有权限;Extract all permissions in the Android permissions document;

将权限映射为资费,联网,短信,电话,隐私相关的类别,选取隐私相关类别的权限;Map permissions to tariff, networking, SMS, phone, privacy-related categories, and select permissions for privacy-related categories;

将隐私相关类别的权限中的权限类别、权限个数、权限名称和权限说明一一对应为列表,得到敏感权限规则库。The permission categories, the number of permissions, the permission names, and the permission descriptions in the permissions of the privacy-related categories are mapped one-to-one as a list to obtain a sensitive permission rule base.

所述恶意行为检测模块包括扫描报告获取子模块,用于:The malicious behavior detection module includes a scan report acquisition sub-module for:

计算VPN应用程序安装包的哈希值,以哈希值为参数调用数据库第一接口,获取数据库中的扫描报告;或调用第二接口,扫描VPN应用程序安装包,得到扫描报告,其中,所述扫描报告包括,AV引擎对恶意广告弹出、强制修改设备设置和自动安装特定应用的扫描结果。Calculate the hash value of the VPN application installation package, call the first interface of the database with the hash value as a parameter, and obtain the scan report in the database; or call the second interface, scan the VPN application installation package, and obtain the scan report, wherein all the The scan report includes the AV engine's scan results for pop-up of malicious advertisements, forced modification of device settings, and automatic installation of specific applications.

所述隧道配置检测模块包括流量数据获取子模块和端口数据获取子模块。其中,所述流量数据获取子模块用于:The tunnel configuration detection module includes a traffic data acquisition sub-module and a port data acquisition sub-module. Wherein, the traffic data acquisition sub-module is used for:

使用curl命令构造网络流量;Use the curl command to construct network traffic;

使用tcpdump命令抓取数据包;Use the tcpdump command to capture packets;

将数据包生成pcap文件,得到流量数据。Generate a pcap file from the data packet to get the traffic data.

所述端口数据获取子模块,用于使用curl命令构造请求IPIP.net提供的API端口的数据,得到端口数据。The port data acquisition sub-module is used to construct the data requesting the API port provided by IPIP.net by using the curl command to obtain the port data.

隧道配置检测模块包括分析子模块,用于:The tunnel configuration detection module includes an analysis sub-module for:

分析所述加密协议是否为不安全的协议,当所述加密协议不属于IPSec、OpenVPN或SSL VPN协议时,得到隧道配置不安全的检测结果。It is analyzed whether the encryption protocol is an insecure protocol, and when the encryption protocol does not belong to IPSec, OpenVPN or SSL VPN protocol, a detection result that the tunnel configuration is insecure is obtained.

第三方库检测模块用于使用python LibRadar/libradar.py someapp.apk检测命令检测VPN应用中的第三方库。The third-party library detection module is used to detect third-party libraries in VPN applications using the python LibRadar/libradar.py someapp.apk detection command.

上述实施例的装置用于实现前述实施例中相应的方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The apparatuses in the foregoing embodiments are used to implement the corresponding methods in the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本公开的范围(包括权利要求)被限于这些例子;在本发明的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本发明的不同方面的许多其它变化,为了简明它们没有在细节中提供。Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the spirit of the present invention, the above embodiments or There may also be combinations between technical features in different embodiments, steps may be carried out in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity.

另外,为简化说明和讨论,并且为了不会使本发明难以理解,在所提供的附图中可以示出或可以不示出与集成电路(IC)芯片和其它部件的公知的电源/接地连接。此外,可以以框图的形式示出装置,以便避免使本发明难以理解,并且这也考虑了以下事实,即关于这些框图装置的实施方式的细节是高度取决于将要实施本发明的平台的(即,这些细节应当完全处于本领域技术人员的理解范围内)。在阐述了具体细节(例如,电路)以描述本发明的示例性实施例的情况下,对本领域技术人员来说显而易见的是,可以在没有这些具体细节的情况下或者这些具体细节有变化的情况下实施本发明。因此,这些描述应被认为是说明性的而不是限制性的。Additionally, well known power/ground connections to integrated circuit (IC) chips and other components may or may not be shown in the figures provided in order to simplify illustration and discussion, and in order not to obscure the present invention. . Furthermore, devices may be shown in block diagram form in order to avoid obscuring the present invention, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the invention will be implemented (i.e. , these details should be fully within the understanding of those skilled in the art). Where specific details (eg, circuits) are set forth to describe exemplary embodiments of the invention, it will be apparent to those skilled in the art that these specific details may be made without or with changes The present invention is carried out below. Accordingly, these descriptions are to be regarded as illustrative rather than restrictive.

尽管已经结合了本发明的具体实施例对本发明进行了描述,但是根据前面的描述,这些实施例的很多替换、修改和变型对本领域普通技术人员来说将是显而易见的。例如,其它存储器架构(例如,动态RAM(DRAM))可以使用所讨论的实施例。Although the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations to these embodiments will be apparent to those of ordinary skill in the art from the foregoing description. For example, other memory architectures (eg, dynamic RAM (DRAM)) may use the discussed embodiments.

本发明的实施例旨在涵盖落入所附权利要求的宽泛范围之内的所有这样的替换、修改和变型。因此,凡在本发明的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明的保护范围之内。Embodiments of the present invention are intended to cover all such alternatives, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims (10)

1.一种Andriod平台VPN应用的安全性检测方法,其特征在于,包括:1. a security detection method of Andriod platform VPN application, is characterized in that, comprises: 分析Andriod权限文档,构建敏感权限规则库,反编译VPN应用安装包,获取权限文档,匹配标签,提取权限列表并匹配敏感权限规则库,得到敏感权限检测结果;Analyze Andriod permission documents, build sensitive permission rule base, decompile VPN application installation package, obtain permission documents, match tags, extract permission list and match sensitive permission rule base, and get sensitive permission detection results; 使用检测命令检测VPN应用的第三方库,得到第三方库列表,所述第三方库包括广告库、游戏引擎库、地图定位服务库以及移动分析库等中的至少一种;Use the detection command to detect the third-party library of the VPN application, and obtain a list of third-party libraries, where the third-party library includes at least one of an advertisement library, a game engine library, a map location service library, a mobile analysis library, and the like; 获取VPN应用的VirusTotal扫描报告,提取并分析扫描报告中AV引擎扫描被测应用恶意行为的扫描结果,得到恶意行为检测结果;Obtain the VirusTotal scan report of the VPN application, extract and analyze the scan results of the AV engine scanning the malicious behavior of the application under test in the scan report, and obtain the malicious behavior detection result; 安装VPN应用至测试终端运行,定位线路列表,解析线路列表的名称,循环遍历线路列表,建立线路连接,并分别进行DNS和IPV6泄露检测、kill-switch检测以及隧道配置检测;Install the VPN application to the test terminal to run, locate the line list, resolve the name of the line list, loop through the line list, establish line connections, and perform DNS and IPV6 leak detection, kill-switch detection, and tunnel configuration detection respectively; 其中,DNS和IPV6泄露检测包括,向测试机的默认DNS服务器发送DNS请求,监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果;同时发送API请求,判断是否成功建立通信,得到IPV6泄露检测结果;Among them, DNS and IPV6 leak detection includes sending a DNS request to the default DNS server of the test machine, monitoring whether any DNS data does not pass through the VPN tunnel, and obtaining the DNS leak detection result; at the same time, sending an API request to determine whether the communication is successfully established, and obtaining the IPV6 leak Test results; kill-switch检测包括,阻塞VPN连接,制造VPN掉线,访问测试IP地址,判断是否成功访问,得到kill-switch检测结果;The kill-switch detection includes blocking the VPN connection, making the VPN disconnect, accessing the test IP address, judging whether the access is successful, and obtaining the kill-switch detection result; 隧道配置检测包括,获取通过VPN线路的流量数据,分析所述流量数据,提取VPN线路的加密协议,分析所述加密协议,得到隧道配置的检测结果。The tunnel configuration detection includes: acquiring traffic data passing through the VPN line, analyzing the traffic data, extracting the encryption protocol of the VPN line, analyzing the encryption protocol, and obtaining the detection result of the tunnel configuration. 2.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,所述监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果包括,2. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, whether described monitoring has DNS data and does not pass through VPN tunnel, obtains DNS leak detection result and comprises, 使用tcpdump命令抓取经过VPN隧道的数据包,将数据包生成pcap文件,并将pcap文件传输至测试终端,解析pcap文件数据,当存在端口号为DNS协议默认端口号的UDP流量时,判断为检测到DNS请求,存在DNS泄露。Use the tcpdump command to capture the data packets passing through the VPN tunnel, generate pcap files from the data packets, transfer the pcap files to the test terminal, and parse the pcap file data. When there is UDP traffic whose port number is the default port number of the DNS protocol, it is judged as DNS request detected, there is a DNS leak. 3.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,所述判断是否成功建立通信,得到IPV6泄露检测结果包括:3. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, whether described judging successfully establishes communication, obtains IPV6 leak detection result and comprises: 使用curl命令向网络协议ipv6-test提供的测试API发送通信请求,当获取到正确的请求响应码时,得到IPV6泄露的检测结果。Use the curl command to send a communication request to the test API provided by the network protocol ipv6-test. When the correct request response code is obtained, the detection result of IPV6 leakage is obtained. 4.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,所述判断是否若成功访问,得到kill-switch检测结果包括:4. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, if described judging whether to visit successfully, obtain kill-switch detection result and comprise: 在PF防火墙的配置文件中添加阻塞所有出站连接,放行测试IP连接的规则;Add a rule to block all outbound connections and release the test IP connection in the configuration file of the PF firewall; 导入添加规则后的PF防火墙的配置文件;Import the configuration file of the PF firewall after adding the rules; 开启添加规则后的PF防火墙;Open the PF firewall after adding rules; 向测试IP发送连接请求,当连接成功时,得到未设置kill-switch的检测结果。Send a connection request to the test IP, and when the connection is successful, the test result that kill-switch is not set is obtained. 5.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,所述分析Andriod权限文档,构建敏感权限规则库包括:5. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, described analyzing Andriod authority document, building sensitive authority rule base comprises: 提取Android权限文档中的所有权限;Extract all permissions in the Android permissions document; 将权限映射为资费,联网,短信,电话,隐私相关的类别,选取隐私相关类别的权限;Map permissions to tariff, networking, SMS, phone, privacy-related categories, and select permissions for privacy-related categories; 将隐私相关类别的权限中的权限类别、权限个数、权限名称和权限说明一一对应为列表,得到敏感权限规则库。The permission categories, the number of permissions, the permission names, and the permission descriptions in the permissions of the privacy-related categories are mapped one-to-one as a list to obtain a sensitive permission rule base. 6.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,所述获取VPN应用的扫描报告包括:6. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, the described scan report that obtains VPN application comprises: 计算VPN应用程序安装包的哈希值,以哈希值为参数调用数据库第一接口,获取virustotal数据库中的扫描报告;或调用第二接口,扫描VPN应用程序安装包,得到扫描报告,其中,所述扫描报告包括,被测应用是否被AV引擎标记为恶意软件的扫描结果。Calculate the hash value of the VPN application installation package, call the first interface of the database with the hash value as a parameter, and obtain the scan report in the virustotal database; or call the second interface, scan the VPN application installation package, and obtain the scan report, wherein, The scan report includes the scan result of whether the application under test is marked as malware by the AV engine. 7.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,所述获取通过VPN线路的流量数据包括:7. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, described obtaining the traffic data by VPN line comprises: 使用curl命令构造网络流量;Use the curl command to construct network traffic; 使用tcpdump命令抓取数据包;Use the tcpdump command to capture packets; 将数据包生成pcap文件,得到流量数据;Generate a pcap file from the data packet to get the traffic data; 所述获取API端口数据,包括使用curl命令构造请求IPIP.net提供的API端口的数据。The acquiring API port data includes using the curl command to construct data requesting the API port provided by IPIP.net. 8.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,所述分析所述加密协议,得到隧道配置的检测结果包括:8. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, described analyzing described encryption protocol, the detection result that obtains tunnel configuration comprises: 分析所述加密协议是否为不安全的协议,当所述加密协议不属于IPSec、Open VPN或SSL VPN协议时,得到隧道配置不安全的检测结果。It is analyzed whether the encryption protocol is an insecure protocol, and when the encryption protocol does not belong to IPSec, Open VPN or SSL VPN protocol, a detection result that the tunnel configuration is insecure is obtained. 9.根据权利要求1所述的Andriod平台VPN应用的安全性检测方法,其特征在于,使用检测命令检测VPN应用的第三方库包括:使用python LibRadar/libradar.py someapp.apk检测命令检测VPN应用中的第三方库。9. the security detection method of Andriod platform VPN application according to claim 1, is characterized in that, the third-party library that uses detection order to detect VPN application comprises: use python LibRadar/libradar.py someapp.apk detection order to detect VPN application third-party libraries in . 10.一种Andriod平台VPN应用的安全性检测装置,其特征在于,包括:10. A security detection device for Andriod platform VPN application, characterized in that, comprising: 敏感权限检测模块,用于分析Andriod权限文档,构建敏感权限规则库,反编译VPN应用安装包,获取权限文档,匹配标签,提取权限列表并匹配敏感权限规则库,得到敏感权限检测结果;Sensitive permission detection module, used to analyze Andriod permission documents, build sensitive permission rule base, decompile VPN application installation package, obtain permission documents, match tags, extract permission list and match sensitive permission rule base, and get sensitive permission detection results; 第三方库检测模块,使用检测命令检测VPN应用的第三方库,得到第三方库列表,所述第三方库包括广告库、游戏引擎库、地图定位服务库以及移动分析库等中的至少一种;The third-party library detection module uses the detection command to detect the third-party library of the VPN application, and obtains a list of third-party libraries, where the third-party library includes at least one of an advertisement library, a game engine library, a map location service library, and a mobile analysis library. ; 恶意行为检测模块,获取VPN应用的virustotal扫描报告,提取并分析扫描报告中AV引擎扫描被测应用恶意行为的结果,得到恶意行为检测结果;线路连接模块,用于安装VPN应用至测试终端运行,定位线路列表,解析线路列表的名称,循环遍历线路列表,建立线路连接;The malicious behavior detection module obtains the virustotal scan report of the VPN application, extracts and analyzes the results of the AV engine scanning the malicious behavior of the tested application in the scan report, and obtains the malicious behavior detection result; the line connection module is used to install the VPN application to the test terminal to run, Locate the line list, parse the name of the line list, loop through the line list, and establish a line connection; DNS和IPV6泄露检测模块,用于向测试机的默认DNS服务器发送DNS请求,监控是否有DNS数据不通过VPN隧道,得到DNS泄露检测结果;同时发送API请求,判断是否成功建立通信,得到IPV6泄露检测结果;The DNS and IPV6 leak detection module is used to send DNS requests to the default DNS server of the test machine to monitor whether there is any DNS data that does not pass through the VPN tunnel, and obtain the DNS leak detection result; at the same time, it sends an API request to determine whether the communication is successfully established, and the IPV6 leak is obtained. Test results; kill-switch检测模块,用于阻塞VPN连接,制造VPN掉线,访问测试IP地址,判断是否成功访问,得到kill-switch检测结果;The kill-switch detection module is used to block the VPN connection, make the VPN disconnect, access the test IP address, determine whether the access is successful, and get the kill-switch detection result; 隧道配置检测模块,用于获取通过VPN线路的流量数据,分析所述流量数据,提取VPN线路的加密协议,分析所述加密协议,得到隧道配置的检测结果。The tunnel configuration detection module is used for acquiring traffic data passing through the VPN line, analyzing the traffic data, extracting the encryption protocol of the VPN line, analyzing the encryption protocol, and obtaining the detection result of the tunnel configuration.
CN202010286040.2A 2020-04-13 2020-04-13 Security detection method and device for VPN application of Andriod platform Pending CN111625823A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010286040.2A CN111625823A (en) 2020-04-13 2020-04-13 Security detection method and device for VPN application of Andriod platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010286040.2A CN111625823A (en) 2020-04-13 2020-04-13 Security detection method and device for VPN application of Andriod platform

Publications (1)

Publication Number Publication Date
CN111625823A true CN111625823A (en) 2020-09-04

Family

ID=72258829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010286040.2A Pending CN111625823A (en) 2020-04-13 2020-04-13 Security detection method and device for VPN application of Andriod platform

Country Status (1)

Country Link
CN (1) CN111625823A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111865618A (en) * 2020-09-21 2020-10-30 四川新网银行股份有限公司 Method for realizing SSL VPN login protection by linkage firewall
CN113486308A (en) * 2021-07-28 2021-10-08 维沃移动通信有限公司 Application management method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685251A (en) * 2013-12-04 2014-03-26 电子科技大学 Android malicious software detecting platform oriented to mobile internet
US8856910B1 (en) * 2011-08-31 2014-10-07 Palo Alto Networks, Inc. Detecting encrypted tunneling traffic
CN104217162A (en) * 2014-09-05 2014-12-17 四川长虹电器股份有限公司 Method and system for detecting malicious software in smart terminal
CN106162648A (en) * 2015-04-17 2016-11-23 上海墨贝网络科技有限公司 A kind of behavioral value method, server and system applying installation kit
CN106709339A (en) * 2016-06-23 2017-05-24 腾讯科技(深圳)有限公司 Scanning result display method and device
CN106951782A (en) * 2017-03-22 2017-07-14 中南大学 A Malicious Code Detection Method for Android Applications

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8856910B1 (en) * 2011-08-31 2014-10-07 Palo Alto Networks, Inc. Detecting encrypted tunneling traffic
CN103685251A (en) * 2013-12-04 2014-03-26 电子科技大学 Android malicious software detecting platform oriented to mobile internet
CN104217162A (en) * 2014-09-05 2014-12-17 四川长虹电器股份有限公司 Method and system for detecting malicious software in smart terminal
CN106162648A (en) * 2015-04-17 2016-11-23 上海墨贝网络科技有限公司 A kind of behavioral value method, server and system applying installation kit
CN106709339A (en) * 2016-06-23 2017-05-24 腾讯科技(深圳)有限公司 Scanning result display method and device
CN106951782A (en) * 2017-03-22 2017-07-14 中南大学 A Malicious Code Detection Method for Android Applications

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
姜惠颖 等: "移动端VPN应用网络特征分析", 《中国科技论文在线》 *
王靖瑜 等: "Android应用隐私条例与敏感行为一致性检测", 《计算机科学与探索》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111865618A (en) * 2020-09-21 2020-10-30 四川新网银行股份有限公司 Method for realizing SSL VPN login protection by linkage firewall
CN113486308A (en) * 2021-07-28 2021-10-08 维沃移动通信有限公司 Application management method and device

Similar Documents

Publication Publication Date Title
US11463460B1 (en) Network traffic inspection
US10873594B2 (en) Test system and method for identifying security vulnerabilities of a device under test
US20190354709A1 (en) Enforcement of same origin policy for sensitive data
Ali et al. Betrayed by the guardian: Security and privacy risks of parental control solutions
Srinivasa et al. Open for hire: attack trends and misconfiguration pitfalls of IoT devices
Malik et al. CREDROID: Android malware detection by network traffic analysis
Tambe et al. Detection of threats to IoT devices using scalable VPN-forwarded honeypots
CN104363236A (en) Automatic vulnerability validation method
US20130227687A1 (en) Mobile terminal to detect network attack and method thereof
CN107634931A (en) Processing method, cloud server, gateway and the terminal of abnormal data
Srinivasa et al. Interaction matters: a comprehensive analysis and a dataset of hybrid IoT/OT honeypots
CN111625823A (en) Security detection method and device for VPN application of Andriod platform
US11657143B2 (en) Request control device, request control method, and request control program
TWI741698B (en) Method for detecting malicious attacks and network security management device
US20220337488A1 (en) Network device type classification
Zhang et al. Invade the Walled Garden: Evaluating GTP Security in Cellular Networks
EP4515819A1 (en) Application identification for phishing detection
Mannan et al. Privacy report card for parental control solutions
Al-Azzawi et al. Security analysis of the MAP-T IPv6 transition technology
Ham et al. DroidVulMon--Android Based mobile device vulnerability analysis and monitoring system
Kumar et al. Penetration testing of android-based smartphones
Chen Domain-specific threat modeling for mobile communication systems
Singh et al. Penetration testing and security measures to identify vulnerability inside the system
Radholm et al. Ethical Hacking of an IoT-device: Threat Assessment and Penetration Testing: A Survey on Security of a Smart Refrigerator
US12445462B2 (en) Technical support scam protection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200904