Web anti-virus method, device, equipment and medium based on BS architecture

By running the web anti-virus engine in the browser and using the browser kernel for anti-virus detection, the problem of high maintenance costs of traditional anti-virus methods is solved, and efficient and accurate virus detection is achieved.

CN118410489BActive Publication Date: 2024-11-05BEIJING ANTIY NETWORK SAFETY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410890293.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-11-05
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

Traditional anti-virus methods based on CS architecture require the installation of client software on the client, resulting in high installation and maintenance costs and complex maintenance.

Method used

Using the web antivirus method based on the BS architecture, by running the web antivirus engine in the client browser, using the browser kernel to detect the sample content, reducing the dependence on the client software and realizing it in the browser. Carry out anti-virus testing.

Benefits of technology

No need to download and upgrade client software, reduce installation and maintenance costs, improve detection efficiency, and improve detection accuracy through a combination of static and dynamic scanning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118410489B_ABST
    Figure CN118410489B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention relate to the field of anti-malicious code technology, and more particularly to a web anti-virus method, device, equipment and medium based on BS architecture. Applied to a client browser, the method includes: in response to a user clicking on any executable detection function in a web anti-virus engine, running a target plug-in in the browser; obtaining a scan list of the current detection function to read and write each sample from the hard disk to the browser memory; based on the logic code of the target plug-in, calling the browser kernel to perform anti-virus detection on the sample content written into the browser memory. This solution can implement anti-virus detection in the browser without downloading and upgrading the maintenance of the client software, which can save installation and maintenance costs compared to the client software of the CS architecture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of anti-malicious code, and in particular to a web anti-virus method, device, equipment and medium based on BS architecture. Background Art

[0002] Traditional anti-virus methods usually use CS architecture, that is, the client needs to install client software and use the server to respond. Traditional CS architecture anti-virus methods usually face problems such as poor distribution and high maintenance costs. Not only does it need to install client software on the client, which is time-consuming and memory-consuming, but when problems occur on the client (virus, hardware damage, etc.) or system software is upgraded, it needs to be reinstalled and upgraded, which has high maintenance costs. Summary of the invention

[0003] In order to solve the problems of time-consuming installation of client software and high maintenance cost in the traditional anti-virus method based on CS architecture, the embodiments of the present invention provide a web anti-virus method, apparatus, device and medium based on BS architecture.

[0004] On the one hand, an embodiment of the present invention provides a web anti-virus method based on a BS architecture, which is applied to a client browser, and the method includes:

[0005] In response to a user clicking on any executable detection function in the web anti-virus engine, running a target plug-in in the browser;

[0006] Get the scan list of the current detection function to read and write each sample from the hard disk to the browser memory;

[0007] Based on the logic code of the target plug-in, the browser kernel is called to perform anti-virus detection on the sample content written into the browser memory.

[0008] In a possible design, when the browser responds to the user accessing the web anti-virus engine, the browser is also used to display a plug-in download interface to add a new executable detection function.

[0009] In a possible design, after the logic code based on the target plug-in calls the browser kernel to perform anti-virus detection on the sample content written into the browser memory, the method further includes:

[0010] Releases the sample content written to the browser's memory.

[0011] In a possible design, in response to the user shutting down the web anti-virus engine, the browser stops running the plug-ins corresponding to the detection functions and releases the browser memory occupied by the web anti-virus engine.

[0012] In one possible design, the detection function includes at least a static scanning function;

[0013] Based on the logic code of the target plug-in, calling the browser kernel to perform anti-virus detection on the sample content written into the browser memory includes:

[0014] The browser obtains a pre-established static-dynamic correspondence table; wherein the static-dynamic correspondence table contains a plurality of output rules, and the output rule is a correspondence relationship between at least one static vector feature and a dynamic behavior;

[0015] Calling the browser kernel to scan and obtain a plurality of static vector features of each sample from the browser memory, and using the plurality of static vector features of each sample to combine and match the output rules in the dynamic-static correspondence table to obtain the dynamic behavior of each sample;

[0016] Based on the static vector features and the dynamic behavior of each sample, a static scanning result is determined, and the static scanning result is returned to the browser page.

[0017] In a possible design, the dynamic-static correspondence table is established in the following manner:

[0018] Running each training sample in the training set, and monitoring the binary code position corresponding to the dynamic behavior of each training sample, so as to establish a dynamic behavior code position table;

[0019] Scan each of the training samples to obtain the static vector features of each of the training samples and the binary code positions corresponding to the static vector features, and establish a static vector feature code position table;

[0020] Traversing the dynamic behavior code position table, if the binary code position of the dynamic behavior is located within the binary code position of the static vector feature of the corresponding training sample in the static vector feature code position table, it is indicated that the static vector feature contains the binary code required for the dynamic behavior, so as to establish a corresponding relationship between the static vector feature and the dynamic behavior;

[0021] Based on the set threshold strategy, output rules are determined from all correspondences in the training set, and a dynamic and static correspondence table is established.

[0022] On the other hand, a web anti-virus device based on BS architecture is provided, which is arranged in a client browser, and includes:

[0023] an operating unit, configured to operate the target plug-in in the browser in response to a user clicking on any executable detection function in the web anti-virus engine;

[0024] The read-write unit is used to obtain the scan list of the current detection function to read and write each sample from the hard disk to the browser memory;

[0025] The detection unit is used to call the browser kernel to perform anti-virus detection on the sample content written into the browser memory based on the logic code of the target plug-in.

[0026] On the other hand, a computing device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of the present specification is implemented.

[0027] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in any embodiment of the present specification.

[0028] On the other hand, a computer program product is provided, comprising a computer program, wherein the computer program implements the steps of the above method when executed by a processor.

[0029] The embodiment of the present invention provides a web anti-virus method, device, equipment and medium based on BS architecture. By designing a web anti-virus engine, web virus detection is implemented in the browser of the client. When performing anti-virus detection, the sample content is read and written to the browser memory, and the browser kernel is called according to the logic code of the detection plug-in to perform anti-virus detection on the sample content in the browser memory. Therefore, this solution can implement anti-virus detection in the browser without downloading and upgrading the maintenance of client software, which can save installation and maintenance costs compared with the client software of CS architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 This is a flow chart of a web anti-virus method based on BS architecture provided by an embodiment of the present invention;

[0032] Figure 2 is a hardware architecture diagram of an electronic device provided by an embodiment of the present invention;

[0033] Figure 3 The structure diagram of a web anti-virus device based on BS architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0035] The specific implementation is described below.

[0036] Please refer to Figure 1 The embodiment of the present invention provides a web anti-virus method based on BS architecture, the method comprising:

[0037] Step 100: In response to a user clicking any executable detection function in a web anti-virus engine, running a target plug-in in a browser;

[0038] Step 102: Obtain a scan list of the current detection function to read and write each sample from the hard disk to the browser memory;

[0039] Step 104: Based on the logic code of the target plug-in, the browser kernel is called to perform anti-virus detection on the sample content written into the browser memory.

[0040] In the embodiment of the present invention, a webpage anti-virus engine is designed to implement webpage virus detection in the browser of the client. When performing anti-virus detection, the sample content is read and written to the browser memory, and the browser kernel is called according to the logic code of the detection plug-in to perform anti-virus detection on the sample content in the browser memory. Therefore, this solution can implement anti-virus detection in the browser without downloading and upgrading the client software, which can save installation and maintenance costs compared to the client software of the CS architecture.

[0041] Described below Figure 1 How the various steps are performed.

[0042] For step 100:

[0043] In this step, when the user accesses the web anti-virus engine in the browser, the web anti-virus engine obtains the plug-in download status of the current browser to display the detection functions that the browser can currently execute. The user can click on the detection function to jump to the web page of the function, and execute the logic code of the detection function by running the corresponding plug-in in the browser.

[0044] In some implementations, when the browser responds to the user accessing the web anti-virus engine, the browser is further configured to display a plug-in download interface to add an executable detection function.

[0045] In this embodiment, as anti-virus technology is constantly developing, detection functions are also constantly being upgraded and added. By displaying a new plug-in download interface in the browser, the browser is enabled to add an executable detection function.

[0046] In addition, the browser is also used to display the download interface of the anti-virus client for the user to select.

[0047] Regarding step 102 and step 104:

[0048] It should be noted that although cloud scanning is based on the BS architecture, the detection logic is on the server side, while the detection logic of this step runs in the browser of the client.

[0049] In this embodiment, unlike the client software directly occupying the client's hard disk memory, the web anti-virus engine needs to first access the sample entity based on the hard disk path of each sample entity in the scan list on the client, and read and write the sample content from the hard disk to the browser memory, so that when the plug-in runs in the browser, the sample content in the browser memory can be scanned for viruses. Moreover, unlike the client software directly calling the CPU to execute the detection logic, the web anti-virus engine needs to call the browser kernel to perform anti-virus scanning on the copied sample.

[0050] In some implementations, after step 104, the method further includes:

[0051] Releases sample content written to browser memory.

[0052] In this embodiment, after the scan is completed, the sample content written into the browser memory is released, and the hard disk path of the black sample is returned to the user, so as to realize web anti-virus. Compared with downloading client anti-virus software, the web anti-virus method of this embodiment can greatly reduce the resource occupation of the client.

[0053] In some implementations, in response to the user shutting down the web anti-virus engine, the browser stops running the plug-in corresponding to each detection function and releases the browser memory occupied by the web anti-virus engine.

[0054] In this embodiment, when the web anti-virus page is closed, the plug-in stops running and the occupied browser memory is immediately released. Compared with the client software, it not only reduces resource usage but also makes the operation more convenient.

[0055] In the embodiment of the present invention, the logic code of the webpage anti-virus engine is written based on HTML language.

[0056] In some embodiments, the detection function includes at least a static scanning function;

[0057] When the detection function is a static scanning function, step 104 may include the following steps S1-S3:

[0058] Step S1, the browser obtains a pre-established static-dynamic correspondence table; wherein the static-dynamic correspondence table contains a number of output rules, and the output rule is a correspondence relationship between at least one static vector feature and a dynamic behavior;

[0059] Step S2, calling the browser kernel to scan and obtain a number of static vector features of each sample from the browser memory, and using the static vector features of each sample to combine and match the output rules in the dynamic and static correspondence table to obtain the dynamic behavior of each sample;

[0060] Step S3, based on the static vector features and dynamic behaviors of each sample, determine the static scanning result, and return the static scanning result to the browser page.

[0061] Traditional static scanning methods cannot obtain the dynamic behavior of samples and can only perform anti-virus scanning on samples based on static feature rules. If you want to judge the samples as malicious based on their dynamic behavior, you can only run the samples in a sandbox and perform dynamic malicious detection after determining the dynamic behavior of the samples. Therefore, traditional static scanning methods cannot judge the samples as malicious based on their dynamic behavior and their accuracy is not high.

[0062] In this embodiment, the established static-dynamic correspondence table is obtained from the server in advance, and the static-dynamic correspondence table is stored in the browser memory; then after the user clicks the static scanning function, the browser will read and write each sample from the hard disk to the browser memory according to the hard disk path of the scan list; then, based on the logic code of the target plug-in, the browser will call the browser kernel to scan the sample content written into the browser memory to obtain the static vector feature of each sample, and combine several static vector features of the sample, sequentially match each output rule in the static-dynamic correspondence table, and determine the dynamic behavior of the hit output rule as the dynamic behavior of the sample. Therefore, in this embodiment, the dynamic behavior of the sample can be determined by matching the static vector features obtained by static scanning with the static-dynamic correspondence table obtained in advance without running the sample. Compared with the defect that the traditional static scanning method can only use static vector features to judge black, this embodiment can determine a more accurate static scanning result based on static vector features and dynamic behavior, thereby improving the accuracy rate of static scanning judgment of the web anti-virus engine.

[0063] The following describes how each step of the static scanning function is performed.

[0064] For step S1:

[0065] In some implementations, the dynamic-static correspondence table is established in the following manner:

[0066] Run each training sample in the training set, and monitor the binary code position corresponding to the dynamic behavior of each training sample to establish a dynamic behavior code position table;

[0067] Scan each training sample to obtain the static vector features of each training sample and the binary code position corresponding to each static vector feature, and establish a static vector feature code position table;

[0068] Traversing the dynamic behavior code position table, if the binary code position of the dynamic behavior is located in the binary code position of the static vector feature of the corresponding training sample in the static vector feature code position table, it is indicated that the static vector feature contains the binary code required for the dynamic behavior, so as to establish a corresponding relationship between the static vector feature and the dynamic behavior;

[0069] Based on the threshold setting strategy, the output rules are determined from all the corresponding relations in the training set, and a dynamic and static correspondence table is established.

[0070] It can be understood that the process of establishing the dynamic and static correspondence table can be performed on the server to reduce the resource occupation of the client.

[0071] In this embodiment, since the binary code corresponding to the static vector feature contains the necessary binary code required for the execution of dynamic behavior, data mining can be performed on the server side using a sandbox, an isolated physical machine, or a virtual machine, and the dynamic behavior of the training sample and the binary code position of the static vector feature can be used to establish a correspondence between the static vector feature and the dynamic behavior.

[0072] For example, training sample A is run in the background, the dynamic behavior (D1, D2, D3...Dn) of the training sample A is obtained, and the binary code segment position (T1, T2, T3...Tn) executed by the dynamic behavior corresponding to the training sample A is recorded; where T1 is the binary code segment position corresponding to the dynamic behavior of D1.

[0073] Perform static scanning on the training sample to obtain the static vector features (J1, J2, J3...Jn) of the sample; obtain the binary code segment position (t1, t2, t3...tn) corresponding to the static vector features; wherein t1 is the binary code segment position corresponding to the J1 static vector feature.

[0074] Traverse the binary code segment positions (T1, T2, T3...Tn) corresponding to the dynamic behavior of the sample, and determine whether T1-Tn is located in any binary code segment position (t1, t2, t3...tn). If so, establish a correspondence between the dynamic behavior and the matching static vector feature.

[0075] For example, T1 is compared with t1, t2, t3...tn in sequence. If T1 is not located in any position among t1, t2, t3...tn, then the dynamic behavior D1 corresponding to T1 does not have a matching static vector feature. If T1 is located in t3, then the dynamic behavior D1 corresponding to T1 establishes a corresponding relationship with the static vector J3 corresponding to t3.

[0076] However, determining all established correspondences as output rules is likely to result in a high false alarm rate. Therefore, it is necessary to set a threshold policy for the correspondences and only determine the correspondences that meet the threshold policy as output rules to reduce the false alarm rate of static scanning.

[0077] In some implementations, the threshold includes an occurrence count threshold and an occurrence probability threshold of the corresponding relationship in the training set.

[0078] It is understandable that when the sample size or sample collection method of the training set changes, the number of occurrences of the same correspondence is likely to vary greatly. If only the occurrence threshold is set, the output rules generated by the dynamic and static correspondence table will be more random, which is not conducive to subsequent static scanning.

[0079] Therefore, in this embodiment, an occurrence probability threshold is also set. Only when the two thresholds are satisfied at the same time can it be used as an output rule, thereby reducing the randomness of the output rule and improving the accuracy of black judgment in static scanning.

[0080] In some embodiments, the step of "determining output rules from all correspondences in the training set based on a set threshold strategy and establishing a dynamic-static correspondence table" includes:

[0081] Perform statistical analysis on the correspondence between static vector features and dynamic behaviors in the training set to determine the number of occurrences and probability of each correspondence;

[0082] The corresponding relationship in which the number of occurrences and the probability of occurrence are respectively greater than or equal to the number of occurrences threshold and the probability of occurrence threshold is determined as the output rule to obtain a dynamic and static correspondence table.

[0083] In this embodiment, by counting the number of occurrences and the probability of occurrence of each corresponding relationship established by the training samples of the training set, the output rules are determined based on the number of occurrence thresholds and the probability of occurrence thresholds, which can reduce the randomness of the output rules and obtain a more accurate and effective dynamic and static correspondence table.

[0084] The embodiment of the present invention provides two methods for calculating the occurrence probability, and the two methods are described below respectively.

[0085] Method 1:

[0086] In method 1, the probability of occurrence of the corresponding relationship is calculated by the following formula:

[0087]

[0088] In the formula, is the occurrence probability of the corresponding relationship, is the number of occurrences of the corresponding relationship between the current static vector feature and the current dynamic behavior in the training set, is the total number of occurrences of all corresponding relations in the training set.

[0089] In the first method, the reliability of the corresponding relationship is determined by calculating the occurrence probability of the current corresponding relationship in the training set, which can effectively reduce the randomness of the output rules and obtain a more accurate and effective dynamic and static corresponding table.

[0090] Method 2:

[0091] In the second method, the occurrence probability of the corresponding relationship is calculated by the following formula:

[0092]

[0093] In the formula, is the occurrence probability of the corresponding relationship, is the number of occurrences of the corresponding relationship between the current static vector feature and the current dynamic behavior in the training set, is the total number of occurrences of corresponding relations containing the current static vector feature in the training set.

[0094] In this second method, since the same static vector feature may correspond to multiple dynamic behaviors, by calculating the probability of the current static vector feature corresponding to the current dynamic behavior in the training set, compared with method one, the reliability of the output rules can be further improved, and the accuracy of black judgment in static scanning can be further improved.

[0095] In some embodiments, the threshold is dynamically adjusted as follows:

[0096] For each adjustment, perform:

[0097] Acquire a first sample set collected in a first time period and a second sample set collected in a second time period; the second time period is later than the first time period;

[0098] Run each sample in the first sample set, and perform static scanning on each sample in the first sample set to respectively establish a dynamic behavior code position table and a static vector feature code position table corresponding to the first sample set;

[0099] Traversing the dynamic behavior code position table corresponding to the first sample set, to establish a correspondence between the static vector feature corresponding to the first sample set and the dynamic behavior based on whether the binary code position of the dynamic behavior in the first sample set is located within the binary code position corresponding to the static vector feature in the static vector feature code position table;

[0100] Based on the current threshold, determine the output rule from all the corresponding relationships of the first sample set, and establish a target dynamic and static correspondence table;

[0101] Performing static scanning on each sample in the second sample set respectively, so as to utilize a plurality of static vector features of the sample, combine and match the output rules in the target static-dynamic correspondence table, and determine the dynamic behavior of the sample;

[0102] When the false alarm rate of the dynamic behavior in the second sample set is greater than the expected false alarm rate, the current threshold is increased;

[0103] When the false alarm rate of the dynamic behavior in the second sample set is less than the expected false alarm rate, the current threshold is reduced.

[0104] In this embodiment, with the continuous development of web anti-virus engines, viruses will become more complex and diverse. Fixed thresholds will cause the dynamic and static correspondence table to be unusable for a long time, so the thresholds need to be dynamically adjusted.

[0105] Specifically, by running each sample of the most recently collected first sample set in a sandbox, an isolated physical machine or a virtual machine, the current threshold is reused to generate a new target static-dynamic correspondence table; then, each sample in the second sample set is statically scanned using the target static-dynamic correspondence table, so as to detect the dynamic behavior of each sample in the second sample set using the target static-dynamic correspondence table; then, the validity of the current threshold is verified based on the false alarm rate of the dynamic behavior in the second sample set, and the current threshold is adjusted using the expected false alarm rate; when the false alarm rate of the dynamic behavior in the second sample set is less than the expected false alarm rate, it means that the accuracy of the target static-dynamic correspondence table generated using the current threshold does not meet the expected standard, and the current threshold needs to be reduced. By verifying and adjusting the threshold in the above manner, the static-dynamic correspondence table can be continuously updated as the virus develops, thereby ensuring the accuracy of black judgment in the static scanning method of the embodiment of the present invention.

[0106] For step S2 and step S3:

[0107] It can be understood that there may be situations where various combinations of static vector features correspond to different dynamic behaviors, that is, the output rule can be the correspondence between one or more static vector features and a dynamic behavior, for example, static vector features A and B correspond to dynamic behavior 1, and static vector features A and C correspond to dynamic behavior 2.

[0108] It is necessary to combine several static vector features of the sample, match each output rule in the static-dynamic correspondence table in turn, and determine the dynamic behavior of the hit output rule as the dynamic behavior of the sample. In the embodiment of the present invention, the dynamic behavior of the sample can be obtained by only statically scanning the sample without sandbox operation, and the binary code segment corresponding to the dynamic behavior can be accurately pointed out, and the dynamic behavior that will not be triggered due to different scenarios during the operation process can be obtained.

[0109] Then, the static scanning function of the embodiment of the present invention can jointly determine the static scanning result based on the static vector characteristics and dynamic behavior of the sample, and the black judgment accuracy is higher.

[0110] It should be noted that after the dynamic behavior is determined, a malicious dynamic behavior rule library or other malicious dynamic detection methods can be used to determine whether the dynamic behavior of the sample is malicious, and the malicious dynamic detection method is not limited here.

[0111] like Figure 2 , Figure 3 As shown, the embodiment of the present invention provides a web anti-virus device based on BS architecture. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, Figure 2 As shown in FIG. 1 , a hardware architecture diagram of a computing device where a web anti-virus device based on a BS architecture is located is provided in an embodiment of the present invention. Figure 2 In addition to the processor, memory, network interface, and non-volatile memory shown in the figure, the computing device in which the device is located in the embodiment may also generally include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 3 As shown, as a device in a logical sense, the CPU of the computing device in which it is located reads the corresponding computer program in the non-volatile memory into the internal memory and runs it.

[0112] like Figure 3 As shown, this embodiment provides a web anti-virus device based on BS architecture, including:

[0113] The running unit 301 is used to run the target plug-in in the browser in response to the user clicking any executable detection function in the web anti-virus engine;

[0114] The read / write unit 302 is used to obtain the scan list of the current detection function to read and write each sample from the hard disk to the browser memory;

[0115] The detection unit 303 is used to call the browser kernel to perform anti-virus detection on the sample content written into the browser memory based on the logic code of the target plug-in.

[0116] In one embodiment of the present invention, when the browser responds to the user accessing the web anti-virus engine, the browser is also used to display a plug-in download interface to add an executable detection function.

[0117] In one embodiment of the present invention, after executing the logic code based on the target plug-in and calling the browser kernel to perform anti-virus detection on the sample content written into the browser memory, the detection unit 303 is further used to:

[0118] Releases sample content written to browser memory.

[0119] In one embodiment of the present invention, in response to the user shutting down the webpage anti-virus engine, the browser stops running the plug-ins corresponding to the various detection functions and releases the browser memory occupied by the webpage anti-virus engine.

[0120] In one embodiment of the present invention, the detection function at least includes a static scanning function; when the detection unit 303 performs the static scanning function, it is used to perform the following operations:

[0121] The browser obtains a pre-established static-dynamic correspondence table; wherein the static-dynamic correspondence table contains a plurality of output rules, and the output rule is a correspondence relationship between at least one static vector feature and a dynamic behavior;

[0122] The browser kernel is called to scan and obtain several static vector features of each sample from the browser memory, and the output rules in the dynamic and static correspondence table are combined and matched using the several static vector features of each sample to obtain the dynamic behavior of each sample;

[0123] Based on the static vector features and dynamic behaviors of each sample, the static scanning results are determined and returned to the browser page.

[0124] In one embodiment of the present invention, the dynamic-static correspondence table is established in the following manner:

[0125] Run each training sample in the training set, and monitor the binary code position corresponding to the dynamic behavior of each training sample to establish a dynamic behavior code position table;

[0126] Scan each training sample to obtain the static vector features of each training sample and the binary code position corresponding to each static vector feature, and establish a static vector feature code position table;

[0127] Traversing the dynamic behavior code position table, if the binary code position of the dynamic behavior is located in the binary code position of the static vector feature of the corresponding training sample in the static vector feature code position table, it is indicated that the static vector feature contains the binary code required for the dynamic behavior, so as to establish a corresponding relationship between the static vector feature and the dynamic behavior;

[0128] Based on the threshold setting strategy, the output rules are determined from all the corresponding relations in the training set, and a dynamic and static correspondence table is established.

[0129] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on a web anti-virus device based on a BS architecture. In other embodiments of the present invention, a web anti-virus device based on a BS architecture may include more or fewer components than those shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0130] The information interaction, execution process and other contents between the units in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.

[0131] An embodiment of the present application further provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, a web anti-virus method based on a BS architecture in any embodiment of the present invention is implemented.

[0132] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the web anti-virus method based on the BS architecture provided in the above-mentioned method embodiments.

[0133] An embodiment of the present application also provides a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the web anti-virus method based on the BS architecture described in any of the above embodiments.

[0134] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0135] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0136] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0137] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A web anti-virus method based on BS architecture, characterized in that: Applied to a client browser, the method comprises: In response to a user clicking on any executable detection function in the web anti-virus engine, running a target plug-in in the browser; Get the scan list of the current detection function to read and write each sample from the hard disk to the browser memory; Based on the logic code of the target plug-in, calling the browser kernel to perform anti-virus detection on the sample content written into the browser memory; The detection function at least includes a static scanning function; The logic code based on the target plug-in calls the browser kernel to perform anti-virus detection on the sample content written into the browser memory, including: The browser obtains a pre-established static-dynamic correspondence table; wherein the static-dynamic correspondence table contains a plurality of output rules, and the output rule is a correspondence relationship between at least one static vector feature and a dynamic behavior; Calling the browser kernel to scan and obtain a plurality of static vector features of each sample from the browser memory, and using the plurality of static vector features of each sample to combine and match the output rules in the dynamic-static correspondence table to obtain the dynamic behavior of each sample; Determine a static scanning result based on the static vector feature and the dynamic behavior of each sample, and return the static scanning result to the browser page; The dynamic and static correspondence table is established in the following manner: Running each training sample in the training set, and monitoring the binary code position corresponding to the dynamic behavior of each training sample, so as to establish a dynamic behavior code position table; Scan each of the training samples to obtain the static vector features of each of the training samples and the binary code positions corresponding to the static vector features, and establish a static vector feature code position table; Traversing the dynamic behavior code position table, if the binary code position of the dynamic behavior is located within the binary code position of the static vector feature of the corresponding training sample in the static vector feature code position table, it is indicated that the static vector feature contains the binary code required for the dynamic behavior, so as to establish a corresponding relationship between the static vector feature and the dynamic behavior; Based on the set threshold strategy, output rules are determined from all correspondences in the training set, and a dynamic and static correspondence table is established.

2. The method according to claim 1, characterized in that When the browser responds to the user accessing the web anti-virus engine, the browser is also used to display a plug-in download interface to add an executable detection function.

3. The method according to claim 1, characterized in that After the logic code based on the target plug-in calls the browser kernel to perform anti-virus detection on the sample content written into the browser memory, the method further includes: Releases the sample content written to the browser's memory.

4. The method according to claim 1, characterized in that: In response to the user shutting down the webpage anti-virus engine, the browser stops running the plug-ins corresponding to the various detection functions and releases the browser memory occupied by the webpage anti-virus engine.

5. A web anti-virus device based on BS architecture, used to implement the method according to any one of claims 1 to 4, characterized in that: Set in the client browser, the device includes: an operating unit, configured to operate the target plug-in in the browser in response to a user clicking on any executable detection function in the web anti-virus engine; The read-write unit is used to obtain the scan list of the current detection function to read and write each sample from the hard disk to the browser memory; The detection unit is used to call the browser kernel to perform anti-virus detection on the sample content written into the browser memory based on the logic code of the target plug-in.

6. A computing device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 4.

8. A computer program product, characterized in that The method comprises a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.