Movatterモバイル変換


[0]ホーム

URL:


CN119155115B - Website security vulnerability detection method and system - Google Patents

Website security vulnerability detection method and system
Download PDF

Info

Publication number
CN119155115B
CN119155115BCN202411630378.XACN202411630378ACN119155115BCN 119155115 BCN119155115 BCN 119155115BCN 202411630378 ACN202411630378 ACN 202411630378ACN 119155115 BCN119155115 BCN 119155115B
Authority
CN
China
Prior art keywords
code
file
webshell file
webshell
processed
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.)
Active
Application number
CN202411630378.XA
Other languages
Chinese (zh)
Other versions
CN119155115A (en
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.)
Hangzhou Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Original Assignee
Hangzhou Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
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 Hangzhou Power Supply Co of State Grid Zhejiang Electric Power Co LtdfiledCriticalHangzhou Power Supply Co of State Grid Zhejiang Electric Power Co Ltd
Priority to CN202411630378.XApriorityCriticalpatent/CN119155115B/en
Publication of CN119155115ApublicationCriticalpatent/CN119155115A/en
Application grantedgrantedCritical
Publication of CN119155115BpublicationCriticalpatent/CN119155115B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种网站安全漏洞检测方法及系统,方法包括获取待处理Webshell文件,将其中的代码分割为若干个代码段;将目标网站中筛选出的各可交互代码块插入各代码段之间;筛选出代码中的风险字符串并进行改写;采用数据流图混淆法对变量传递过程进行隐藏;将加工后的Webshell文件与选定的检测工具进行交互,基于交互结果对检测工具进行修正,以修正后的检测工具对目标网站进行安全漏洞检测。本发明通过设计通过对Webshell文件进行加工,全面地绕过现有技术中对Webshell的静态检测,进而为开发更为有效的检测和防御策略提供基础,最终为静态检测工具的优化和改进做出方向指导。

The present invention discloses a website security vulnerability detection method and system, the method comprises obtaining a to-be-processed Webshell file, dividing the code therein into a plurality of code segments; inserting each interactive code block screened out from a target website between each code segment; screening out the risk character string in the code and rewriting it; using a data flow graph obfuscation method to hide the variable transfer process; interacting the processed Webshell file with a selected detection tool, correcting the detection tool based on the interaction result, and using the corrected detection tool to perform security vulnerability detection on the target website. The present invention processes the Webshell file by design, comprehensively bypasses the static detection of Webshell in the prior art, thereby providing a basis for developing a more effective detection and defense strategy, and finally providing a directional guidance for the optimization and improvement of static detection tools.

Description

Website security vulnerability detection method and system
Technical Field
The invention relates to the technical field of network security, in particular to a website security vulnerability detection method and system.
Background
With the continuous updating of network technology and the popularization of network applications, the data security problem of the website server is increasingly prominent.
In the security protection process of the network, in order to realize security monitoring on a website or a server, a Webshell sample capable of bypassing protection software needs to be obtained, so that the Webshell sample bypassing a security protection system can be used as an effective sample for vulnerability testing. In the prior art, webshell samples are often selected from the existing Webshell library, however, with development of technology and transformation of codes, sample data with higher effectiveness cannot be obtained from the existing Webshell library, so that the vulnerability test effect on websites is greatly reduced.
Therefore, how to improve the vulnerability detection effect on the website and promote the security protection of the website has become a technical problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention provides a website security vulnerability detection method and system, which are used for promoting and optimizing the security detection function of a website.
In order to solve the above technical problems, an embodiment of the present invention provides a website security vulnerability detection method, including:
and acquiring the to-be-processed Webshell file, and dividing codes in the to-be-processed Webshell file into a plurality of code segments according to the coding rule of the to-be-processed Webshell file.
And screening a plurality of interactable code blocks from the acquired page codes in the target website, and inserting the interactable code blocks between the code segments to obtain a first Webshell file, wherein the insertion process is configured to interact the selected code segments with the corresponding interactable code blocks in a coupling mode.
And screening the first Webshell file based on a character string feature matching rule, and rewriting each risk character string obtained by screening to obtain a second Webshell file.
And hiding the variable transfer process in the second Webshell file by adopting a data flow diagram confusion method to obtain a third Webshell file.
And interacting the third Webshell file with a selected detection tool, correcting the detection tool based on an interaction result, and detecting the security hole of the target website by the corrected detection tool.
Further, the dividing the codes in the to-be-processed Webshell file into a plurality of code segments according to the coding rule of the to-be-processed Webshell file includes:
Extracting code data in the Webshell file to be processed, and matching specified codes in the code data by using a regular expression.
And dividing the code data according to the matching result to obtain a plurality of code segments.
Further, the dividing the code data according to the matching result, after obtaining a plurality of code segments, further includes:
and carrying out logic verification on each divided code segment, and correcting the division result of each code segment according to the verification result.
Further, the inserting each of the interactable code blocks between each of the code segments comprises:
And determining an interaction interface according to the function and the logic relation of each interactable code block.
And analyzing the data information which needs to be exchanged and transferred by each code segment.
And establishing a matching relation between each code segment and each interaction interface according to the data information.
And coupling each code segment with each interactable code block according to the matching relation.
Further, the character string feature matching rules include word matching rules, sentence matching rules and frequency detection rules.
The screening of the first Webshell file based on the character string feature matching rule, and the rewriting of each risk character string obtained by screening, includes:
and screening system functions in the risk character string from the first Webshell file, and dynamically rewriting function names of the system functions through character string operation.
And screening nested functions in the risk strings from the first Webshell file, independently providing the embedded functions in the nested functions, and calling the embedded functions through new variables.
And recoding the risk character string in the first Webshell file in an encryption mapping mode.
Further, the recoding the risk character string in the first Webshell file by means of encryption mapping includes:
and encrypting all the risk character strings in the first Webshell file by using an encryption mapping rule, and transcoding all the risk character strings after the encryption.
Further, the coding conversion rules comprise ASCII coding rules, unicode coding, GBK/GB2312 coding and Base64 coding rules.
Further, hiding the variable transfer process in the second Webshell file by adopting a dataflow graph confusion method includes:
and performing assignment transformation on the variables in the second Webshell file by using judgment sentences to realize hiding of the explicit assignment sentences.
And writing part of variable information into file attribute information of the second Webshell file in a file steganography mode.
Further, the writing the partial variable information into the file attribute information of the second Webshell file by means of file steganography includes:
Variable information is written as hidden data into the spare data stream of the Webshell by utilizing the spare data stream characteristic of the NTFS file system.
Another embodiment of the present invention provides a website security vulnerability detection system, including:
The code segmentation module is used for acquiring the to-be-processed Webshell file and segmenting codes in the to-be-processed Webshell file into a plurality of code segments according to the coding rule of the to-be-processed Webshell file.
The code interaction module is used for screening a plurality of interactable code blocks from the acquired page codes in the target website, inserting the interactable code blocks between the code segments to obtain a first Webshell file, wherein the insertion process is configured to interact the selected code segments with the corresponding interactable code blocks in a coupling mode.
And the character string rewriting module is used for screening the first Webshell file based on a character string characteristic matching rule, and rewriting each risk character string obtained by screening to obtain a second Webshell file.
And the variable hiding module is used for hiding the variable transmission process in the second Webshell file by adopting a data flow diagram confusion method to obtain a third Webshell file.
And the vulnerability detection module is used for interacting the third Webshell file with a selected detection tool, correcting the detection tool based on an interaction result, and detecting the security vulnerability of the target website by the corrected detection tool.
Compared with the prior art, the embodiment of the invention has the beneficial effects that at least one of the following points is adopted:
(1) Considering the thinness of the existing Webshell detection technology, the invention comprehensively bypasses the static detection of the Webshell in the prior art by designing the detection method based on the Optode/Bytecode, the detection method based on the character string matching, the detection method based on the CFG and the detection method based on the DFG and Taint.
(2) By analyzing strategies and technologies of Webshell attacks, the mechanism and the limitation of the Webshell detection tool are deeply analyzed, so that a basis is provided for developing more effective detection and defense strategies, and finally direction guidance is made for optimization and improvement of the static detection tool.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for detecting website security vulnerabilities according to an embodiment of the present invention;
Fig. 2 is a block diagram of a website security vulnerability detection system according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the invention, and the purpose of these embodiments is to provide a more thorough and complete disclosure of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present application, the terms "first," "second," "third," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", "a third", etc. may explicitly or implicitly include one or more such feature. In the description of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
In the description of the present application, unless explicitly stated or limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected, mechanically connected, electrically connected, directly connected, indirectly connected via an intervening medium, or in communication between two elements. The terms "vertical," "horizontal," "left," "right," "upper," "lower," and the like are used herein for descriptive purposes only and not to indicate or imply that the apparatus or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore should not be construed as limiting the application. The term "and/or" as used herein includes any and all combinations of one or more of the associated listed items. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art.
In the description of the present application, it should be noted that all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art unless defined otherwise. The terminology used in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application, as the particular meaning of the terms described above in the present application will be understood to those of ordinary skill in the art in the detailed description of the application.
An embodiment of the present invention provides a website security breach detection method, specifically, referring to fig. 1, fig. 1 is a flowchart showing steps of the website security breach detection method in one embodiment of the present invention, including steps S11 to S15:
And S11, acquiring a to-be-processed Webshell file, and dividing codes in the to-be-processed Webshell file into a plurality of code segments according to coding rules of the to-be-processed Webshell file.
The code segmentation process comprises the steps of extracting code data in the Webshell file to be processed, matching specified codes (such as function definition, conditional statement, circulation statement and the like) in the code data by using a regular expression, and positioning key parts in the codes according to a matching result so as to segment the code data and obtain a plurality of code segments.
In addition, code segmentation can be realized through a static code analysis tool, the static code analysis tool is adopted to scan and analyze the Webshell file to be processed, code logic, function call, variable statement and the like in the file are identified, and code segments are divided according to the code logic, the function call, the variable statement and the like.
After the codes are divided, in order to verify the logic rationality of the divided codes, logic verification is carried out on each divided code segment, and the division result of each code segment is corrected according to the verification result so as to ensure that each code segment can correctly express the logic and the functions in the original Webshell file.
Step S12, a plurality of interactable code blocks are screened from the acquired page codes in the target website, and the interactable code blocks are inserted between the code segments to obtain a first Webshell file, wherein the insertion process is configured to interact the selected code segments with the corresponding interactable code blocks in a coupling mode.
The embodiment is mainly aimed at processing Webshell files by using a detection method based on Opcode/Bytecode, a detection method based on CFG (control flow graph), a detection method based on character string matching and a detection method based on DFG (data flow graph). For the detection method based on the Opcode/Bytecode, the processing mode adopted in this embodiment is that the Webshell file code is inserted into the page code of the target website, or the page code of the target website is inserted into the Webshell file code, for example, the page code of the target website is inserted into the Webshell file code, and the specific process is that a plurality of interactable code blocks are screened out from the acquired page code of the target website, and each interactable code block is inserted between each code segment of the Webshell file to be processed.
However, although this method may bypass detection on the level of Opcode, the inserted code and the code block in the original Webshell file to be processed may not have semantic association, and the two codes that do not have interaction may be separated by CFG (control flow graph) or the like and then detected by a detection tool, so in the CFG-based detection method, in the process of inserting the code, the inserted code and the original code need to be interacted in a coupling manner under the condition that the original control flow is not affected, so as to further improve the confusion difficulty, and the specific process adopted in this embodiment is as follows:
And determining an interaction interface according to the function and the logic relation of each interactable code block, analyzing the data information to be exchanged and transferred by each code segment, establishing a matching relation between each code segment and each interaction interface according to the data information, and coupling each code segment and each interactable code block according to the matching relation.
In addition, to further obfuscate the code and prevent the detected tool from screening out abnormal codes, the embodiment may also use a method of introducing a random algorithm to generate a non-deterministic input to interfere with the simplification and detection of the code by the CFG. Specifically, the method adopted in this embodiment is as follows:
And adding a random character string in the output part of the program, wherein the character string can be accessed for multiple times through a remote tool in the subsequent Webshell execution process, and determining the real output result of the program according to the unchanged part in the access result by comparing the results of multiple accesses. For example, after the Webshell program successfully bypasses the initial detection and starts to execute, if the result obtained by accessing a certain code segment for multiple times is the content of character strings "resultlyr", "result123", "resultexc", etc., after a certain number of character strings are obtained, the actual result of executing the code segment can be obtained by comparing the obtained result to be the character string "result", and the subsequent character string is the character string randomly added to the actual result by using a random algorithm.
And step S13, screening the first Webshell file based on a character string feature matching rule, and rewriting each risk character string obtained by screening to obtain a second Webshell file.
The character string matching-based detection method adopts character string feature matching rules to rewrite the screened risk character strings so as to bypass detection, wherein the character string feature matching rules comprise word matching rules, sentence matching rules, frequency detection rules and the like.
The method for rewriting each risk character string obtained by screening comprises the following steps:
And screening system functions in the risk character string from the first Webshell file, and dynamically rewriting function names of the system functions through character string operation.
And screening nested functions in the risk character string from the first Webshell file, independently providing the embedded functions in each nested function, and calling the embedded functions through the new variable.
And recoding the risk character strings in the first Webshell file in a mode of encryption mapping. The specific process includes that encryption mapping rules are used for carrying out encryption processing on each risk character string in the first Webshell file, and encoding rules such as ASCII encoding rules, unicode encoding, GBK/GB2312 encoding and Base64 encoding rules are used for carrying out encoding conversion on each risk character string after the encryption processing.
Furthermore, the risk string may also be rewritten to bypass string-match based detection by:
And hiding global variables, namely avoiding detection of related variable names, dynamically generating variable names through string operation, or packaging original variables by defining new variables.
Renaming the function parameters, namely avoiding the detection of the related function and variable combination, proposing the original function parameters, assigning the original function parameters to new variables, and carrying out parameter transmission by using the new variables.
Limiting the operation quantity of single-line codes, namely avoiding the detection of related frequencies and splitting the overlong single-line codes in the AST.
The adjustment of the position of each line of program in the code, i.e. the avoidance of the detection of the relevant position, can be achieved by interleaving normal codes between each code.
And S14, hiding the variable transfer process in the second Webshell file by adopting a data flow diagram confusion method to obtain a third Webshell file.
Some detection tools use Taint technology to track user control input to form a data flow graph DFG, and detect sink points in the graph, so that input sources and outputs of data are analyzed, and detection of Webshells is achieved.
For the detection method based on the DFG (data flow graph), if, while, for and other judgment sentences can be utilized to carry out assignment transformation on the variables in the second Webshell file so as to realize hiding of the explicit assignment sentence and further avoid detection.
For some variable data with smaller occupied memory, the spare data stream characteristic of the NTFS file system can be utilized, and the part of variable information is written into the file attribute information, the CPU cache or other spare data streams of the second Webshell file as hidden data in a file steganography mode, so that detection is avoided.
And S15, interacting the third Webshell file with a selected detection tool, correcting the detection tool based on an interaction result, and detecting the security vulnerabilities of the target website by the corrected detection tool.
The website security vulnerability detection method considers the thinness of the existing Webshell detection technology, and rewrites the Webshell codes by designing the detection method based on the Optode/Bytecode, the detection method based on the character string matching, the detection method based on the CFG and the detection method based on the DFG and Taint, thereby comprehensively bypassing the static detection of the Webshell in the prior art. By analyzing strategies and technologies of Webshell attacks, the mechanism and the limitation of the Webshell detection tool are deeply analyzed, so that a basis is provided for developing more effective detection and defense strategies, and finally direction guidance is made for optimization and improvement of the static detection tool.
The embodiment of the invention also provides a website security hole detection system for executing the website security hole detection system, and fig. 2 is a structural block diagram of the website security hole detection system according to the embodiment of the invention, wherein the system comprises:
The code segmentation module 21 is configured to obtain a to-be-processed Webshell file, and segment a code in the to-be-processed Webshell file into a plurality of code segments according to a coding rule of the to-be-processed Webshell file.
The code interaction module 22 is configured to screen a plurality of interactable code blocks from the acquired page codes in the target website, insert each interactable code block between each code segment to obtain a first Webshell file, where the insertion process is configured to interact the selected code segment with each corresponding interactable code block in a coupling manner.
And the character string rewriting module 23 is configured to screen the first Webshell file based on a character string feature matching rule, and rewrite each risk character string obtained by screening to obtain a second Webshell file.
And the variable hiding module 24 is configured to hide the variable transmission process in the second Webshell file by using a dataflow graph confusion method, so as to obtain a third Webshell file.
And the vulnerability detection module 25 is configured to interact the third Webshell file with a selected detection tool, correct the detection tool based on an interaction result, and detect the security vulnerability of the target website by using the corrected detection tool.
The technical features and technical effects of the system provided by the embodiment of the present invention are the same as those of the method provided by the embodiment of the present invention, and are not described herein. The various modules in the system described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
The foregoing examples illustrate only a few embodiments of the invention and are described in detail herein without thereby limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.

Claims (9)

Translated fromChinese
1.一种网站安全漏洞检测方法,其特征在于,包括:1. A website security vulnerability detection method, characterized by comprising:获取待处理Webshell文件,根据所述待处理Webshell文件的编码规则将所述待处理Webshell文件中的代码分割为若干个代码段;Obtain a Webshell file to be processed, and divide the code in the Webshell file to be processed into a plurality of code segments according to the encoding rule of the Webshell file to be processed;从获取到的目标网站中的页面代码中筛选出若干个可交互代码块,将各所述可交互代码块插入各所述代码段之间,得到第一Webshell文件,其中,所述插入过程被配置为将选定的所述代码段以耦合的方式与对应的各所述可交互代码块进行交互;具体包括:根据各所述可交互代码块的功能和逻辑关系确定交互接口;分析各所述代码段需交换传递的数据信息;根据所述数据信息建立各所述代码段与各所述交互接口的匹配关系;根据所述匹配关系对各所述代码段与各所述可交互代码块进行耦合;所述可交互代码块为可与所述待处理代码块产生语义关联的代码;A plurality of interactive code blocks are screened out from the page code of the acquired target website, and each of the interactive code blocks is inserted between each of the code segments to obtain a first Webshell file, wherein the insertion process is configured to interact the selected code segment with the corresponding interactive code blocks in a coupled manner; specifically comprising: determining an interactive interface according to the function and logical relationship of each of the interactive code blocks; analyzing the data information to be exchanged and transmitted by each of the code segments; establishing a matching relationship between each of the code segments and each of the interactive interfaces according to the data information; coupling each of the code segments with each of the interactive code blocks according to the matching relationship; the interactive code block is a code that can generate a semantic association with the code block to be processed;基于字符串特征匹配规则对所述第一Webshell文件进行筛选,并将筛选得出的各风险字符串进行改写,得到第二Webshell文件;The first Webshell file is screened based on a string feature matching rule, and each risk string obtained by the screening is rewritten to obtain a second Webshell file;采用数据流图混淆法对所述第二Webshell文件中的变量传递过程进行隐藏,得到第三Webshell文件;A data flow graph obfuscation method is used to hide the variable transfer process in the second Webshell file to obtain a third Webshell file;将所述第三Webshell文件与选定的检测工具进行交互,基于交互结果对所述检测工具进行修正,以修正后的所述检测工具对所述目标网站进行安全漏洞检测。The third Webshell file interacts with the selected detection tool, the detection tool is modified based on the interaction result, and the modified detection tool is used to perform security vulnerability detection on the target website.2.如权利要求1所述的网站安全漏洞检测方法,其特征在于,所述根据所述待处理Webshell文件的编码规则将所述待处理Webshell文件中的代码分割为若干个代码段,包括:2. The website security vulnerability detection method according to claim 1, characterized in that the code in the to-be-processed Webshell file is divided into a plurality of code segments according to the encoding rule of the to-be-processed Webshell file, including:提取所述待处理Webshell文件中的代码数据,使用正则表达式对所述代码数据中的指定代码进行匹配;Extract code data from the Webshell file to be processed, and use regular expressions to match specified codes in the code data;根据匹配结果对所述代码数据进行分割,得到若干个代码段。The code data is segmented according to the matching result to obtain a plurality of code segments.3.如权利要求2所述的网站安全漏洞检测方法,其特征在于,所述根据匹配结果对所述代码数据进行分割,得到若干个代码段后,还包括:3. The website security vulnerability detection method according to claim 2, characterized in that after the code data is segmented according to the matching result to obtain a plurality of code segments, it further comprises:对划分后的各所述代码段进行逻辑验证,根据验证结果对各所述代码段的划分结果进行修正。Performing logic verification on each of the divided code segments, and correcting the division results of each of the code segments according to the verification results.4.如权利要求1所述的网站安全漏洞检测方法,其特征在于,所述字符串特征匹配规则包括单词匹配规则、语句匹配规则和频率检测规则;4. The website security vulnerability detection method according to claim 1, wherein the string feature matching rule comprises a word matching rule, a sentence matching rule and a frequency detection rule;所述基于字符串特征匹配规则对所述第一Webshell文件进行筛选,并将筛选得出的各风险字符串进行改写,包括:The first Webshell file is screened based on the string feature matching rule, and each risk string obtained by the screening is rewritten, including:从所述第一Webshell文件中筛选出风险字符串中的系统函数,通过字符串操作动态改写各所述系统函数的函数名;Filtering out system functions in risk strings from the first Webshell file, and dynamically rewriting the function names of each of the system functions through string operations;从所述第一Webshell文件中筛选出风险字符串中的嵌套函数,将各所述嵌套函数中的内嵌函数单独提出,通过传入新变量调用所述内嵌函数;Filter out nested functions in the risk string from the first Webshell file, extract the embedded functions in each nested function separately, and call the embedded functions by passing in new variables;将所述第一Webshell文件中的风险字符串通过加密映射的方式重新编码。The risk character string in the first Webshell file is re-encoded by means of encryption mapping.5.如权利要求4所述的网站安全漏洞检测方法,其特征在于,所述将所述第一Webshell文件中的风险字符串通过加密映射的方式重新编码,包括:5. The website security vulnerability detection method according to claim 4, characterized in that the step of re-encoding the risk character string in the first Webshell file by means of encryption mapping comprises:使用加密映射规则对所述第一Webshell文件中的各所述风险字符串进行加密处理,对加密处理后的各所述风险字符串进行编码转换。The risk character strings in the first Webshell file are encrypted using encryption mapping rules, and the encrypted risk character strings are converted into codes.6.如权利要求5所述的网站安全漏洞检测方法,其特征在于,所述编码转换的规则包括ASCII编码规则、Unicode编码、GBK/GB2312编码和Base64编码规则。6. The website security vulnerability detection method as described in claim 5 is characterized in that the encoding conversion rules include ASCII encoding rules, Unicode encoding, GBK/GB2312 encoding and Base64 encoding rules.7.如权利要求1所述的网站安全漏洞检测方法,其特征在于,所述采用数据流图混淆法对所述第二Webshell文件中的变量传递过程进行隐藏,包括:7. The website security vulnerability detection method according to claim 1, characterized in that the use of a data flow graph obfuscation method to hide the variable transfer process in the second Webshell file comprises:使用判断语句对所述第二Webshell文件中的变量进行赋值变换以实现显式赋值语句的隐藏;Using a judgment statement to perform assignment transformation on the variables in the second Webshell file to achieve hiding of the explicit assignment statement;通过文件隐写的方式将部分变量信息写入第二Webshell文件的文件属性信息中。Part of the variable information is written into the file attribute information of the second Webshell file by means of file steganography.8.如权利要求7所述的网站安全漏洞检测方法,其特征在于,所述通过文件隐写的方式将部分变量信息写入第二Webshell文件的文件属性信息中,包括:8. The website security vulnerability detection method according to claim 7, characterized in that the step of writing part of the variable information into the file attribute information of the second Webshell file by means of file steganography comprises:利用NTFS文件系统的备用数据流特性,将变量信息作为隐藏数据写入到Webshell的备用数据流中。By taking advantage of the alternate data stream feature of the NTFS file system, the variable information is written into the alternate data stream of the Webshell as hidden data.9.一种网站安全漏洞检测系统,其特征在于,包括:9. A website security vulnerability detection system, characterized by comprising:代码分割模块,用于获取待处理Webshell文件,根据所述待处理Webshell文件的编码规则将所述待处理Webshell文件中的代码分割为若干个代码段;A code segmentation module is used to obtain a Webshell file to be processed, and segment the code in the Webshell file to be processed into a plurality of code segments according to the encoding rule of the Webshell file to be processed;代码交互模块,用于从获取到的目标网站中的页面代码中筛选出若干个可交互代码块,将各所述可交互代码块插入各所述代码段之间,得到第一Webshell文件,其中,所述插入过程被配置为将选定的所述代码段以耦合的方式与对应的各所述可交互代码块进行交互;具体包括:根据各所述可交互代码块的功能和逻辑关系确定交互接口;分析各所述代码段需交换传递的数据信息;根据所述数据信息建立各所述代码段与各所述交互接口的匹配关系;根据所述匹配关系对各所述代码段与各所述可交互代码块进行耦合;所述可交互代码块为可与所述待处理代码块产生语义关联的代码;A code interaction module is used to filter out a number of interactive code blocks from the page code of the acquired target website, insert each of the interactive code blocks between the code segments, and obtain a first Webshell file, wherein the insertion process is configured to interact the selected code segment with the corresponding interactive code blocks in a coupled manner; specifically including: determining an interactive interface according to the function and logical relationship of each of the interactive code blocks; analyzing the data information to be exchanged and transmitted by each of the code segments; establishing a matching relationship between each of the code segments and each of the interactive interfaces according to the data information; coupling each of the code segments with each of the interactive code blocks according to the matching relationship; the interactive code block is a code that can generate a semantic association with the code block to be processed;字符串改写模块,用于基于字符串特征匹配规则对所述第一Webshell文件进行筛选,并将筛选得出的各风险字符串进行改写,得到第二Webshell文件;A string rewriting module, used for screening the first Webshell file based on a string feature matching rule, and rewriting each risk string obtained by screening to obtain a second Webshell file;变量隐藏模块,用于采用数据流图混淆法对所述第二Webshell文件中的变量传递过程进行隐藏,得到第三Webshell文件;A variable hiding module, used to hide the variable transfer process in the second Webshell file by using a data flow graph obfuscation method to obtain a third Webshell file;漏洞检测模块,用于将所述第三Webshell文件与选定的检测工具进行交互,基于交互结果对所述检测工具进行修正,以修正后的所述检测工具对所述目标网站进行安全漏洞检测。The vulnerability detection module is used to interact the third Webshell file with the selected detection tool, modify the detection tool based on the interaction result, and perform security vulnerability detection on the target website with the modified detection tool.
CN202411630378.XA2024-11-152024-11-15Website security vulnerability detection method and systemActiveCN119155115B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411630378.XACN119155115B (en)2024-11-152024-11-15Website security vulnerability detection method and system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411630378.XACN119155115B (en)2024-11-152024-11-15Website security vulnerability detection method and system

Publications (2)

Publication NumberPublication Date
CN119155115A CN119155115A (en)2024-12-17
CN119155115Btrue CN119155115B (en)2025-02-14

Family

ID=93805162

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411630378.XAActiveCN119155115B (en)2024-11-152024-11-15Website security vulnerability detection method and system

Country Status (1)

CountryLink
CN (1)CN119155115B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112434266A (en)*2021-01-262021-03-02成都无糖信息技术有限公司Shell code control flow flattening confusion method
CN114662109A (en)*2022-04-242022-06-24中国工商银行股份有限公司Webshell detection method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
KR20140042478A (en)*2012-09-282014-04-07주식회사 이지시큐어Web shell detecting apparatus and method using script obfuscation process function
CN106411578B (en)*2016-09-122019-07-12国网山东省电力公司电力科学研究院A kind of web publishing system and method being adapted to power industry
CN117370982A (en)*2023-10-242024-01-09北京启明星辰信息安全技术有限公司Method and device for determining file risk
CN118611997B (en)*2024-08-092024-11-08国网浙江省电力有限公司杭州供电公司Perception safety protection method, system and equipment based on network port protection device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112434266A (en)*2021-01-262021-03-02成都无糖信息技术有限公司Shell code control flow flattening confusion method
CN114662109A (en)*2022-04-242022-06-24中国工商银行股份有限公司Webshell detection method and device

Also Published As

Publication numberPublication date
CN119155115A (en)2024-12-17

Similar Documents

PublicationPublication DateTitle
Chen et al.Detecting android malware using clone detection
CN114077741B (en)Software supply chain safety detection method and device, electronic equipment and storage medium
US9715593B2 (en)Software vulnerabilities detection system and methods
US9639703B2 (en)Method, system, and computer program product for automatically mitigating vulnerabilities in source code
Rubinov et al.Automated partitioning of android applications for trusted execution environments
US8800042B2 (en)Secure web application development and execution environment
US7849509B2 (en)Detection of security vulnerabilities in computer programs
US8266700B2 (en)Secure web application development environment
US8635602B2 (en)Verification of information-flow downgraders
LivshitsDynamic taint tracking in managed runtimes
WO2022180702A1 (en)Analysis function addition device, analysis function addition program, and analysis function addition method
JP7287480B2 (en) Analysis function imparting device, analysis function imparting method and analysis function imparting program
US12155686B2 (en)Method, system, and computer program product for automatically mitigating vulnerabilities in source code
US20240054225A1 (en)Intelligent service security enforcement system
CN113901463B (en)Concept drift-oriented interpretable Android malicious software detection method
Veronese et al.Webspec: Towards machine-checked analysis of browser security mechanisms
Homaei et al.Athena: A framework to automatically generate security test oracle via extracting policies from source code and intended software behaviour
CN119155115B (en)Website security vulnerability detection method and system
Borzykh et al.Detecting Code Security Breaches by Means of Dataflow Analysis
JP5208367B2 (en) Security critical data container
Choi et al.Chracer: Memory analysis of Chromium-based browsers
JP6984760B2 (en) Converter and conversion program
Anantharaman et al.Intent as a secure design primitive
CN119691757B (en) Firmware logic vulnerability detection method, system, electronic device and computer-readable storage medium based on large language model thinking chain
Zaazaa et al.Automatic Static Vulnerability Detection Approaches and Tools: State of the Art

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp