Summary of the invention
Problem to low, the easy appearance erroneous judgement of web site scan efficient in the correlation technique; The present invention proposes a kind of scan method and device of website; Can distinguish rank to the URL (URL) of website; Corresponding rule base is set in advance, calls the scanning engine utilization rule base corresponding URL is scanned with this rank.
Technical scheme of the present invention is achieved in that
According to an aspect of the present invention; A kind of scan method of website is provided; Be used for the website being scanned, wherein, be provided with corresponding scanning engine and the rule base that is used to scan in advance for each rank according to the rank of the uniform resource position mark URL of said website.
Scan method according to the website of the embodiment of the invention comprises:
Confirm the rank of URL to be scanned;
Call and the corresponding scanning engine of confirming of rank, so that URL is scanned by the invoked scanning engine utilization rule base corresponding with this rank;
Obtain the scanning result of invoked scanning engine, confirm the security of website according to scanning result.
Wherein, confirm that the rank of URL to be scanned comprises: the field to URL to be scanned is resolved, and obtains the field that URL comprises, and confirms the rank that needs that URL comprises scan according to field.
And call with the corresponding scanning engine of confirming of rank and comprise: according to by the determined rank of extracting of field, call and the pairing scanning engine of this rank, each invoked scanning engine is directed against appropriate level and scans.
Alternatively, for confirming of rank, process is following:
If URL comprises field host, then confirm and to carry out other scanning of server level to URL;
If URL comprises field port, then confirm and to carry out other scanning of port level to URL;
If URL comprises field directory, then confirm to carry out the scanning of directory level to URL;
If URL comprises field file, then confirm to carry out the scanning of file-level to URL;
If URL comprises field parameter, then confirm and to carry out other scanning of parametric degree to URL;
If URL comprises field form, then confirm and to carry out other scanning of list level to URL;
If URL comprises field text, then confirm and to carry out other scanning of text level to URL.
In addition, comprise the mode of this rank being carried out vulnerability scanning in the rule base of each rank correspondence.
Alternatively, the rank of URL comprise following one of at least: server rank, port rank, directory level, file-level, parameter rank, list rank, text rank.
Preferably, for different stage, the mode that scans is following:
For the server rank, the mode that scans comprise following one of at least: detect server and whether launched dangerous approach, whether existed unsafe third party to use, whether have unsafe server extender, whether shielded by search engine;
For the port rank, the mode that scans comprise following one of at least: the risk and the sensitivity that detect the port of launching;
For directory level, the mode that scans comprise following one of at least: detect and whether exist responsive catalogue, scanning backup directory, scanning directory whether to have sensitive document, detect and whether have irrational directory permission setting, detect catalogue and whether have CGI(Common gateway interface) CGI leak;
For file-level, the mode that scans comprise following one of at least: detect whether there is backup file;
For the parameter rank, the mode that scans comprise following one of at least: whether have malicious script in the detected parameters, whether have error code, whether have malice URL redirect;
For the list rank, the mode that scans comprise following one of at least: detect list and whether have malicious script, whether have error code, whether have malice URL redirect;
For the text rank, the mode that scans comprise following one of at least: detect text and whether exist source code to leak, detect and whether have sensitive content, detect and whether exist local path to leak.
According to a further aspect in the invention; A kind of scanister of website is provided; The rank that is used for the uniform resource position mark URL of website scans the website, and scanister comprises a plurality of rule bases, a plurality of scanning engine, determination module, calling module, judge module.
In this device, determination module is used for confirming the rank of URL to be scanned; Calling module is used to call the corresponding scanning engine of confirming with determination module of rank; For each scanning engine in a plurality of scanning engines, corresponding at least one rank of URL, and each scanning engine is used under the calling of calling module, according to the rule base of this scanning engine institute corresponding level this rank scanned; Each rule base comprises the mode that this rank is scanned corresponding to the rank of URL in a plurality of rule bases; Judge module is used for confirming according to the scanning result of invoked scanning engine the security of website.
Wherein, determination module is used for the field of URL to be scanned is resolved, and obtains the field that URL comprises, and confirms the rank that needs that URL comprises scan according to field.
In addition, calling module is used for calling and the pairing scanning engine of this rank according to by the determined rank of extracting of field, and each invoked scanning engine scans to appropriate level.
In addition, alternatively, the rank of URL comprise following one of at least:
Server rank, port rank, directory level, file-level, parameter rank, list rank, text rank.
The present invention distinguishes rank through the URL to the website; Corresponding rule base is set in advance, calls the scanning engine utilization rule base corresponding URL is scanned, because each URL possesses the rank that need scan after the classification with this rank; So the pairing rule base of the rank that need not to scan just need not to use; And when the rank that needs are scanned scanned, the rule base that need not to use can not produce ongoing scanning yet and disturb, and having reduced needs matching rules quantity when scanning; Thereby can improve the accuracy of scanning leak and add fast scan speed; Reach purpose accurate, that scan fast, and help the executed in parallel of task, the utilization of optimization process resource.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those of ordinary skills obtained belongs to the scope that the present invention protects.
According to embodiments of the invention; A kind of scan method of website is provided; Be used for the website being scanned, wherein, be provided with corresponding scanning engine and the rule base that is used to scan in advance for each rank according to the rank of the uniform resource position mark URL of website.Because each URL possesses the rank that need scan after the classification; So the pairing rule base of the rank that need not to scan just need not to use; And when the rank that needs are scanned scanned, the rule base that need not to use can not produce ongoing scanning yet and disturb, and having reduced needs matching rules quantity when scanning; Thereby can improve the accuracy of scanning leak and add fast scan speed; Reach purpose accurate, that scan fast, and help the executed in parallel of task, the utilization of optimization process resource.To describe in detail below embodiments of the invention with and can reach the principle of above-mentioned effect.
As shown in Figure 1, comprise according to the scan method of the website of the embodiment of the invention:
Step S101 confirms the rank of URL to be scanned; Step S103 calls and the corresponding scanning engine of confirming of rank, so that by the invoked scanning engine utilization rule base corresponding with this rank URL is scanned;
Step S105 obtains the scanning result of invoked scanning engine, confirms the security of website according to scanning result.
And, comprise the mode of this rank being carried out vulnerability scanning in the rule base of each rank correspondence.
When confirming the rank of URL to be scanned, can resolve the field of URL to be scanned, obtain the field that URL comprises, confirm the rank that needs that URL comprises scan according to field.Therefore, a URL possibly possess the rank that a plurality of needs scan.
Afterwards, just can call and the pairing scanning engine of this rank according to by the determined rank of extracting of field, each invoked scanning engine scans to appropriate level.
Alternatively, the rank of URL comprise following one of at least: server rank, port rank, directory level, file-level, parameter rank, list rank, text rank.Among the cited embodiment hereinafter, the corresponding rule base of each rank and a scanning engine, but in fact, each scanning engine and rule can also can corresponding a plurality of ranks.
Address with the URL form is an example: the host of " http: " " // " [": " port] path [parameters] ["? " Query]
Definite method for host (server) rank is: host part in the URL form promptly is divided into host (server);
Definite method for port (port) rank is: port part in the URL form promptly is divided into port (port);
Is definite method for directory (catalogue) rank is: the catalogue part in the URL form in the path part promptly divided into directory (catalogue), like http://webscan.360.cn/manager/file.php? Among the a=1/manager/ is directory level;
Definite method for file (file) rank is: the file part in the path part in the URL form promptly is divided into file (file); For example, with http://webscan.360.cn/manager/file.php? File.php confirms as and is file-level among the a=1;
Definite method for parameter (parameter) rank is: parameters part in the URL form promptly is divided into parameter (parameter);
Definite method for form (list) rank is: query part in the URL form promptly is divided into form (list);
Definite method for text (text) rank is: the complete URL part in the URL form all can be divided into text (text).
Carry out the process such as the following steps a-d of vulnerability scanning for the typing rule in service regeulations storehouse (vulnerability database):
(a) rank of analyzing and confirming to belong to:
If detect the leak of server, then be included into host (server) rank;
If the leak of detection port then is included into port (port) rank;
If detect the leak of catalogue, then be included into directory (catalogue) rank;
If detect the leak of file, then be included into file (file) rank;
If the leak of detected parameters then is included into parameter (parameter) rank;
If detect the leak of list, then be included into form (list) rank;
If detect the leak of text, then be included into text (text) rank.
(b) analyze for other leak of every kind of level, concrete leak method of testing and judgment rule (that is, corresponding to each level other rule base content) as follows:
To the server rank, then detect server whether launched dangerous approach, whether exist unsafe third party use, whether exist unsafe server extender, whether by the search engine shielding etc.;
To the port rank, then detect whether to have started and have excessive risk very, responsive port;
To directory level, then detect whether have responsive catalogue, backup directory, sensitive document, irrational directory permission setting, general CGI leak (sql of third party APP injects and cross-site scripting attack leak, sensitive content leak) etc.;
To file-level, then detect whether there is backup file etc.;
To the parameter rank, then detect whether have that cross-site scripting attack, sql injections, xpath injection, the blind injection of sql, any file of operating system read or carry out, any URL redirect etc.;
To the list rank, then detect whether have that cross-site scripting attack, sql injections, xpath injection, the blind injection of sql, any file of operating system read or carry out, any URL redirect etc.;
To the text rank, then detect whether have source code leakage, sensitive content, local path leakage etc.
(c) write the leak rule, and specify the affiliated rank of leak.
(d) save as vulnerability database.
For example, the step such as the following steps (A)-(I) of the execution of vulnerability scanning engine:
(A) reptile is found URL;
(B) resolve URL, extract host, port, directory, file, parameter, form, text part among the URL, save as host_1, port_1, directory_1, file_1, parameter_1, form_1, text_1 respectively
(C) scanning sequence obtains host_1, if for empty (this URL address need not to carry out other scanning of server level) or to this rank completion scanning, then skip; Otherwise start host (server) testing engine, load other vulnerability database of host (server) level (that is, above-mentioned corresponding to other rule base of server level), this server is carried out detailed Hole Detection;
(D) scanning sequence obtains port_1, if be that empty perhaps this rank the completion scanned, then skips; Otherwise start port (port) testing engine, load other vulnerability database of port (port) level, this port is carried out detailed Hole Detection;
(E) scanning sequence obtains directory_1, if be that empty perhaps this rank the completion scanned, then skips; Otherwise start directory (catalogue) testing engine, load other vulnerability database of directory (catalogue) level, this catalogue is carried out detailed Hole Detection;
(F) scanning sequence obtains file_1, if be that empty perhaps this rank the completion scanned, then skips; Otherwise start file (file) testing engine, load other vulnerability database of file (file) level, this document is carried out detailed Hole Detection;
(G) scanning sequence obtains parameter_1, if be that empty perhaps this rank the completion scanned, then skips; Otherwise start parameter (parameter) testing engine, load other vulnerability database of parameter (parameter) level, this parameter is carried out detailed Hole Detection;
(H) scanning sequence obtains form_1, if be that empty perhaps this rank the completion scanned, then skips; Otherwise start form (list) testing engine, load other vulnerability database of form (list) level, this list is carried out detailed Hole Detection;
(I) scanning sequence obtains text_1, if be that empty perhaps this rank the completion scanned, then skips; Otherwise start text (text) testing engine, load other vulnerability database of text (text) level, the text is carried out detailed Hole Detection;
Can find out that through above description a URL need not to carry out all other scannings of level probably, therefore, also just need not to mate, so can improve accuracy and saving speed with all other rule bases of level.
In addition, for each vulnerability database sweep limit, be described below:
Host (server): all leaks relevant with server are all returned this type of, do not limit operating system and WEB server;
Port (port): all leaks relevant with port all are included into this type of;
Directory (catalogue): the leak of influential catalogue all be included into this type of;
File (file): the leak of influential file all be included into this type of;
Parameter (parameter): the leak of influential parameter all be included into this type of;
Form (list): the leak of influential list all be included into this type of;
Text (text): the leak of influential text all be included into this type of.
According to embodiments of the invention, a kind of scanister of website also is provided, be used for the website being scanned according to the rank of URL.
As shown in Figure 2; Comprise that according to the scanister of the embodiment of the invention a plurality of rule bases are (from purpose clearly; 2 rule bases have been shown among Fig. 2, and in fact, the quantity of rule base can be decided according to other quantity of level) 21, a plurality of scanning engine 22, determination module 23, calling module 24 and judge module 25; Wherein
Determination module 23 is used for confirming the rank of URL to be scanned;
Calling module 24 is used to call the corresponding scanning engine of confirming with determination module 23 of rank;
For each scanning engine in a plurality of scanning engines 22, corresponding at least one rank of URL, and each scanning engine is used under the calling of calling module 24, according to the rule base of this scanning engine institute corresponding level this rank scanned;
Each rule base comprises the mode that this rank is scanned corresponding at least one rank of URL in a plurality of rule bases 21;
25 securities that are used for confirming the website of judge module according to the scanning result of invoked scanning engine 22.
Wherein, determination module 23 is used for the field of URL to be scanned is resolved, and obtains the field that URL comprises, and confirms the rank that needs that URL comprises scan according to field.
And calling module 24 can be used for calling and the pairing scanning engine of this rank according to by the determined rank of extracting of field, and each invoked scanning engine scans to appropriate level.
Alternatively, the rank of URL comprise following one of at least: server rank, port rank, directory level, file-level, parameter rank, list rank, text rank.
The rule that is comprised in the mode that each scanning engine scans and each rule base illustrates in method embodiment before, no longer repeats here.
In sum, by means of technique scheme of the present invention, the present invention is through distinguishing rank to URL; Corresponding rule base is set in advance, calls the scanning engine utilization rule base corresponding the website is scanned, because each URL possesses the rank that need scan after the classification with this rank; So the pairing rule base of the rank that need not to scan just need not to use; And when the rank that needs are scanned scanned, the rule base that need not to use can not produce ongoing scanning yet and disturb, and having reduced needs matching rules quantity when scanning; Thereby can improve the accuracy of scanning leak and add fast scan speed; Reach purpose accurate, that scan fast, and help the executed in parallel of task, the utilization of optimization process resource.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.