CN111079040A - Resource sniffing method, device, terminal, server and storage medium - Google Patents

Resource sniffing method, device, terminal, server and storage medium Download PDF

Info

Publication number
CN111079040A
CN111079040A CN201911176222.8A CN201911176222A CN111079040A CN 111079040 A CN111079040 A CN 111079040A CN 201911176222 A CN201911176222 A CN 201911176222A CN 111079040 A CN111079040 A CN 111079040A
Authority
CN
China
Prior art keywords
loading
domain name
target server
resource
domain
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.)
Granted
Application number
CN201911176222.8A
Other languages
Chinese (zh)
Other versions
CN111079040B (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.)
Reach Best Technology Co Ltd
Original Assignee
Reach Best Technology 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 Reach Best Technology Co Ltd filed Critical Reach Best Technology Co Ltd
Priority to CN201911176222.8A priority Critical patent/CN111079040B/en
Publication of CN111079040A publication Critical patent/CN111079040A/en
Application granted granted Critical
Publication of CN111079040B publication Critical patent/CN111079040B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The present disclosure relates to a resource sniffing method, apparatus, electronic device, and storage medium, the method comprising: sending an access request to a target server through a first domain name; if the webpage data fed back by the target server are received through the first domain name, in the process of loading the webpage data, loading resources of other domain names of the target server through the first domain name, and determining loading results of the other domain names; and feeding back the loading result to the target server so that the target server determines the available domain name according to the loading result. According to the domain name sniffing method and device, the domain name sniffing can be achieved through the browser used by the user instead of using a fixed browser or a simulator, so that the domain name can be sniffed under various network environments, the accuracy of sniffing results is improved, and the usability of services is guaranteed.

Description

Resource sniffing method, device, terminal, server and storage medium
Technical Field
The present disclosure relates to internet technologies, and in particular, to a resource sniffing method, apparatus, terminal, server, and storage medium.
Background
In order to cope with access to a complicated http(s) application service, a plurality of domain names are used simultaneously for the same WEB (global Wide area network) service. Especially, a plurality of domain names exist when sharing related services are issued, but the network environment is complex, and in different regions or different browsers, the link of a certain domain name can be hijacked by an intermediate network operator or the browser, so that normal access cannot be realized.
In the related art, a fixed client is basically adopted to poll and access a service end aiming at a sniffing mode of service accessibility, for a WEB end, a real WEB browser or a simulated WEB browser is generally used to send a request to the service end, and whether the service is normal or not is judged according to whether a return result exists or not and the correctness of the return result. According to the method, because one WEB browser or a simulator is used for sniffing, whether the service is normal or not can be sniffed only in a solidified mode under one network environment, the simulator mode is difficult to poll the real limited condition, and the accuracy of the sniffing result is low.
Disclosure of Invention
The present disclosure provides a resource sniffing method, apparatus, terminal, server, and storage medium to at least solve the problem of low accuracy of sniffing results in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a resource sniffing method, including:
sending an access request to a target server through a first domain name;
if the webpage data fed back by the target server are received through the first domain name, in the process of loading the webpage data, loading resources of other domain names of the target server through the first domain name, and determining loading results of the other domain names;
and feeding back the loading result to the target server so that the target server determines the available domain name according to the loading result.
Optionally, in the process of loading the web page data, loading resources of other domain names of the target server through the first domain name, and determining a loading result of the other domain names, where the loading result includes:
in the process of loading the webpage data, sending a static resource acquisition request to the target server through the first domain name;
receiving static resources returned by the target server, wherein the static resources comprise domain name loading files;
in the process of loading the static resources, according to the domain name loading file, sending a loading request for the static resources of the specified domain name to the target server through the first domain name;
if the feedback of the target server is received, determining that the loading result of the static resource of the specified domain name is successful; and if the feedback of the target server is not received, determining that the loading result of the static resource of the specified domain name is loading failure.
Optionally, the static resource includes at least one of cascading style sheets CSS, JS, hypertext markup language HTML, and pictures.
Optionally, in the process of loading the web page data, loading resources of other domain names of the target server through the first domain name, and determining a loading result of the other domain names, where the loading result includes:
under the condition of supporting cross-domain access, in the process of loading the webpage data, sending an AJAX request for a specified domain name of the target server through the first domain name;
if the feedback resource of the target server is received, loading the feedback resource, and determining that the loading result corresponding to the AJAX request of the specified domain name is successful; and if the feedback resource of the target server is not received, determining that the loading result corresponding to the AJAX request of the specified domain name is loading failure.
According to a second aspect of the embodiments of the present disclosure, there is provided a resource sniffing method, including:
receiving loading results sent by a plurality of browsers to obtain a plurality of loading results, wherein the loading results are obtained by loading resources of other domain names of a target server through a first domain name in the process of loading webpage data when the browser receives the webpage data of the target server through the first domain name;
and determining the available domain name according to the plurality of loading results.
Optionally, the determining an available domain name according to the multiple loading results includes:
counting the loading results of the same domain name in the multiple loading results;
if the loading result of one domain name meets the preset condition, determining that the domain name is unavailable; if the loading result of one domain name does not meet the preset condition, determining that the domain name is available;
the available domain names are recorded.
According to a third aspect of the embodiments of the present disclosure, there is provided a resource sniffing apparatus, including:
an access request sending module configured to send an access request to a target server through a first domain name;
the resource loading module is configured to load resources of other domain names of the target server through the first domain name and determine loading results of the other domain names in the process of loading the webpage data if the webpage data fed back by the target server are received through the first domain name;
and the loading result feedback module is configured to feed the loading result back to the target server, so that the target server determines an available domain name according to the loading result.
Optionally, the resource loading module includes:
a static resource request unit configured to send a static resource acquisition request to the target server through the first domain name in a process of loading the web page data;
a static resource receiving unit configured to receive a static resource returned by the target server, where the static resource includes a domain name loading file;
a loading request generation unit configured to send a loading request for the static resource of the specified domain name to the target server through the first domain name according to the domain name loading file in the process of loading the static resource;
a static loading result determining unit configured to determine that a loading result of the static resource of the specified domain name is a successful loading if the feedback of the target server is received; and if the feedback of the target server is not received, determining that the loading result of the static resource of the specified domain name is loading failure.
Optionally, the static resource includes at least one of CSS, JS, HTML, and pictures.
Optionally, the resource loading module includes:
an AJAX request sending unit, configured to send an AJAX request for a specified domain name of the target server through the first domain name in a process of loading the webpage data under the condition of supporting cross-domain access;
the AJAX loading result determining unit is configured to load the feedback resource if the feedback resource of the target server is received, and determine that the loading result corresponding to the AJAX request of the specified domain name is successful in loading; and if the feedback resource of the target server is not received, determining that the loading result corresponding to the AJAX request of the specified domain name is loading failure.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a resource sniffing apparatus, including:
the loading result receiving module is configured to receive loading results sent by a plurality of browsers to obtain a plurality of loading results, wherein the loading results are obtained by loading resources of other domain names of a target server through a first domain name in the process of loading webpage data when the browser receives the webpage data of the target server through the first domain name;
an available domain name determining module configured to determine an available domain name according to the plurality of loading results.
Optionally, the available domain name determining module includes:
a loading result counting unit configured to count loading results of the same domain name in the plurality of loading results;
the available domain name determining unit is configured to determine that a domain name is unavailable if a loading result of the domain name meets a preset condition; if the loading result of one domain name does not meet the preset condition, determining that the domain name is available;
a domain name recording unit configured to record an available domain name.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a terminal, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource sniffing method as described in the first aspect.
According to a sixth aspect of embodiments of the present disclosure, there is provided a server including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource sniffing method as described in the second aspect.
According to a seventh aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions, when executed by a processor of a terminal, enable the terminal to perform the resource sniffing method according to the first aspect, or, when executed by a processor of a server, enable the server to perform the resource sniffing method according to the second aspect.
According to an eighth aspect of embodiments of the present disclosure, there is provided a computer program product comprising readable program code which, when executed by a processor of a terminal, enables the terminal to perform the resource sniffing method as described in the first aspect or which, when executed by a processor of a server, enables the server to perform the resource sniffing method as described in the second aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
according to the method and the device for sniffing the domain name, if the access request is sent to the target server through the first domain name and the webpage data fed back by the target server is received, in the process of loading the webpage data, resources of other domain names of the target server are loaded through the first domain name, the loading results of the other domain names are determined, and the loading results are fed back to the target server, so that the target server determines the available domain name according to the loading results, the sniffing of the domain name can be achieved through a browser used by a user instead of the sniffing through a fixed browser or a simulator, the domain name can be sniffed under various network environments, the accuracy of the sniffing results is improved, and the usability of the service is guaranteed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a method of resource sniffing in accordance with an exemplary embodiment;
fig. 2 is a schematic diagram of sniffing other domain names by successfully accessing domain names in an embodiment of the present disclosure;
FIG. 3 is a flow diagram illustrating a method of resource sniffing in accordance with an exemplary embodiment;
FIG. 4 is a flow diagram illustrating a method of resource sniffing in accordance with an exemplary embodiment;
FIG. 5 is a flow diagram illustrating a method of resource sniffing in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating a resource sniffing apparatus in accordance with an exemplary embodiment;
FIG. 7 is a block diagram illustrating a resource sniffing apparatus in accordance with an exemplary embodiment;
FIG. 8 is a block diagram illustrating a terminal in accordance with an exemplary embodiment;
FIG. 9 is a block diagram illustrating a server in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
For network services actively pushed to users, sharing pages similar to propagation, or propagation pages similar to WeChat friend circles, and the like, a server actively issues domain names to users for access. When the user accesses the domain names, the user can be hijacked by the operator and return pages which are not originally accessed by the user due to high traffic or other factors. For the condition, the accessibility of the domain name needs to be sniffed, the embodiment of the disclosure uses the WEB service of the embodiment to sniff the accessibility of the same service under other domain names, and can dynamically adjust the issued available domain name according to the sniffing result to better ensure the availability of the WEB service.
Fig. 1 is a flowchart illustrating a resource sniffing method according to an exemplary embodiment, which is used in a browser based on the http(s) protocol, and which snoops accessibility to a plurality of domain names of a target server through the browser, as shown in fig. 1, and includes the following steps.
In step S11, an access request is sent to the target server by the first domain name.
The target server is a server capable of providing a target service, and one target server may correspond to a plurality of domain names.
In step S12, if the web page data fed back by the target server is received through the first domain name, in the process of loading the web page data, loading resources of other domain names of the target server through the first domain name, and determining a loading result of the other domain names.
As shown in fig. 2, when a user accesses a target server through a browser or an operator platform, a domain name to be accessed by the user is issued by the target server, and among a plurality of domain names issued by the target server, an unavailable (e.g., blocked) domain name and an available domain name may appear. As shown in fig. 2, it is assumed that the target server corresponds to the a domain name, the B domain name, and the C domain name, and if the a domain name is used when the user accesses the target server, the a domain name can be used to sniff whether the user can access the B domain name and the C domain name when the a domain name is successfully accessed to the target server. Similarly, when the user accesses the target server, the issued domain name is the B domain name, and when the B domain name is available, the B domain name can be used to sniff whether the user can access the a domain name and the C domain name.
If the browser receives webpage data fed back by the target server through the first domain name, it is determined that the browser successfully accesses the target server through the first domain name, and the first domain name is available, so that other domain names corresponding to the target server can be sniffed through the first domain name in the process of loading the webpage data, namely resources of other domain names of the target server are loaded through the first domain name, and the condition of resource accessibility of other domain names of the target server is determined. The accessibility of other domain names may be sniffed by requesting resources of the other domain names from the target server. The first domain name is a domain name currently used by the browser. The browser is a browser used by a user, and is not a fixed browser and a simulator in the related art, so that the domain name of the target server can be respectively subjected to accessibility sniffing by utilizing the network environment where a plurality of browsers are located.
When sniffing the resource accessibility of a domain name, the loading result of the domain name can be determined by whether the feedback resource of the domain name is received, i.e. if the feedback resource is received, the domain name is determined to be available, and if the feedback resource is not received, the domain name is determined to be unavailable.
In the embodiment of the present disclosure, a fixed browser or a simulator is not required to be used to sniff the domain name of the target server, but the browser used by the user is used to sniff the domain name of the target server.
In step S13, the loading result is fed back to the target server, so that the target server determines an available domain name according to the loading result.
The browser loads the resources of one domain name, determines the loading result of the domain name, and then feeds the loading result back to the target server, and the target server can determine the available domain name according to the feedback results of the multiple browsers, so that the available domain name is selected for issuing when the domain name is subsequently issued, and the availability of the WEB service is ensured.
The target server can determine the forbidden result of the domain name according to the loading result fed back by the browser, and further determine the available domain name. The result of the encapsulation of the domain name may include that the domain name is completely encapsulated, which means that it cannot be accessed regardless of the media type (MINETYPE) of the HTTP resource, and that the domain name is partially encapsulated. If all resources corresponding to a domain name are not sealed, determining that the domain name is not sealed; if partial resources corresponding to a domain name are forbidden, determining that the domain name is partially forbidden; if all resources corresponding to a domain name are blocked, determining that the domain name is completely blocked.
In the exemplary embodiment, if the access request is sent to the target server through the first domain name and the webpage data fed back by the target server is received, in the process of loading the webpage data, resources of other domain names of the target server are loaded through the first domain name, the loading results of the other domain names are determined, and the loading results are fed back to the target server, so that the target server determines an available domain name according to the loading results, and the domain name can be sniffed through a browser used by a user instead of a fixed browser or a simulator, so that the domain name can be sniffed in various network environments, the accuracy of the sniffing results is improved, and the availability of the service is ensured.
Fig. 3 is a flowchart illustrating a resource sniffing method according to an exemplary embodiment, where as shown in fig. 3, the resource sniffing method is used in a browser based on the http(s) protocol, and the browser performs accessibility sniffing on a plurality of domain names of a target server, and the exemplary embodiment mainly performs sniffing on static resources of other domain names by successfully accessing a first domain name of the target server, and includes the following steps.
In step S31, an access request is sent to the target server by the first domain name.
In step S32, receiving the web page data fed back by the target server through the first domain name, and in the process of loading the web page data, sending a static resource acquisition request to the target server through the first domain name.
After the browser successfully accesses the target server through the first domain name, in the process of loading the webpage data to be accessed, the browser needs to interact with the target server for multiple times to complete loading of the webpage data, wherein the loading of static resources of the webpage is involved, and when the static resources of the webpage need to be loaded, the browser first needs to send a static resource acquisition request to the target server. The static resource includes at least one of CSS (Cascading Style Sheets), js (javascript), HTML (HyperText Markup Language), and pictures. CSS is a computer Language for expressing a file style such as HTML (Extensible Markup Language) or XML (Extensible Markup Language), and can statically modify a web page and dynamically format elements of the web page in accordance with various script languages. JS is an transliterated script language, which is a dynamic type, weak type, prototype-based language and built-in support type. HTML is a markup language, including a series of tags, through which documents on the network can be unified in format, so that discrete Internet resources are connected into a logical whole.
The process of loading the webpage data by the browser comprises the following steps: and requesting an HTML page from the server, analyzing the HTML by the browser, requesting CSS and JS from the server, executing a request API interface by the JS, assembling a page by the JS according to the data, requesting pictures from the server, and displaying the webpage. When the browser needs to load the resource, the corresponding resource is requested to the target server, and the browser loads the resource after the target server returns the corresponding resource.
In step S33, a static resource returned by the target server is received, where the static resource includes a domain name loading file.
And after receiving the static resource acquisition request sent by the browser, the target server returns the static resource requested by the browser, wherein the static resource returned by the target server comprises the domain name loading file. The domain name loading file is an instruction file for loading static resources of the specified domain name, and the static resources also include at least one of CSS, JS, HTML and pictures. The specified domain name is a domain name other than the first domain name corresponding to the target server.
For example, when the browser needs to load the CSS, the browser sends a CSS acquisition request to the target server, receives the CSS returned by the target server, and sends the CSS returned by the target server including the domain name loading file. When the browser needs to load the JS, a JS obtaining request is sent to the target server, the JS returned by the target server is received, and the JS returned by the target server comprises a domain name loading file. When the browser needs to load the picture, the browser sends a picture loading request to the target server and receives the picture returned by the target server, wherein the picture returned by the target server comprises a domain name loading file.
In step S34, in the process of loading the static resource, a file is loaded according to the domain name, and a loading request for the static resource of the specified domain name is sent to the target server through the first domain name.
The domain name loading file comprises static resources corresponding to the specified domain name to be loaded. The browser loads the received static resources after receiving the static resources, and loads the static resources of the specified domain name through the first domain name according to the domain name loading file in the process of loading the static resources, namely, sends a loading request for the static resources of the specified domain name to the target server through the first domain name.
In step S35, if the feedback of the target server is received, it is determined that the loading result of the static resource of the specified domain name is successful; and if the feedback of the target server is not received, determining that the loading result of the static resource of the specified domain name is loading failure.
If the feedback of the target server is received and the static resource of the specified domain name is loaded, determining that the loading result of the static resource of the specified domain name is successful, if the static resource of the specified domain name fails to be loaded, failing to load the static resource of the specified domain name, and determining that the loading result of the static resource of the specified domain name is failed to be loaded. When the browser introduces the static resource of the specified domain name, the browser needs to send an acquisition request of the static resource of the specified domain name to the target server, if the feedback of the target server is received, the static resource can be loaded, an introduction identifier is set for the loaded static resource, and whether the loading is successful or not is determined by inquiring whether the introduction identifier is included or not, namely if the static resource comprises the introduction identifier, the loading of the static resource of the specified domain name is determined to be successful, and if the static resource does not include the introduction identifier, the loading of the static resource of the specified domain name is determined to be failed.
For example, if the browser successfully loads the CSS of the specified domain name, it is determined that the CSS of the specified domain name is not blocked, and if the browser fails to introduce the JS of the specified domain name, it is determined that the JS of the specified domain name is blocked.
In step S36, the loading result is fed back to the target server, so that the target server determines an available domain name according to the loading result.
The exemplary embodiment implements sniffing of static resources of a specified domain name by a first domain name by successfully accessing a first domain name of a target server instead of sniffing using a fixed browser or simulator by determining that the static resources of the specified domain name are successfully loaded if feedback of the target server is received and determining that the loading result of the static resources of the specified domain name is loading failure if feedback of the target server is not received by sending a loading request of the static resources of the specified domain name to the target server through the first domain name according to a domain name loading file in the process of loading the static resources, thereby sniffing the domain name in various network environments, the accuracy of the sniffing result is improved, and the availability of static resources in the service is ensured.
Fig. 4 is a flowchart illustrating a resource sniffing method according to an exemplary embodiment, where as shown in fig. 4, the resource sniffing method is used in a browser based on the http(s) protocol, and the browser performs accessibility sniffing on a plurality of domain names of a target server, and the exemplary embodiment mainly performs sniffing on AJAX requests of other domain names by successfully accessing a first domain name of the target server, and includes the following steps.
In step S41, an access request is sent to the target server by the first domain name.
In step S42, if the web page data fed back by the target server is received through the first domain name, in the case of supporting cross-domain access, in the process of loading the web page data, an AJAX request for the specified domain name of the target server is sent through the first domain name.
The specified domain name is a domain name other than the first domain name corresponding to the target server. AJAX (Asynchronous Java and XML, Asynchronous JS and XML) is a WEB development technology for asynchronously requesting data, and is helpful for improving user experience and page performance. The core of the AJAX technology is an XMLHttpRequest object (XHR for short), and the XHR provides a smooth interface for sending requests to a server and analyzing server responses and can acquire more information from the server in an asynchronous mode.
When the browser needs to sniff the AJAX requests of other domain names except the first domain name, the browser needs to be allowed to perform cross-domain access, so that resources corresponding to the AJAX requests of other domain names can be loaded. Therefore, under the condition of supporting cross-domain access, the browser can enable the XHR object to send out the AJAX request of the appointed domain name of the target server through the first domain name, namely, the XHR object sends out the HTTP request of the appointed domain name of the target server through the first domain name, and receives the feedback of the target server.
In step S43, if the feedback resource of the target server is received, loading the feedback resource, and determining that the loading result corresponding to the AJAX request of the specified domain name is successful; and if the feedback resource of the target server is not received, determining that the loading result corresponding to the AJAX request of the specified domain name is loading failure.
And if the XHR object receives the feedback resource of the target server, sending the feedback resource of the target server to the browser, and the browser receives the feedback resource of the target server, and determining that the AJAX request of the specified domain name is not blocked, namely determining that the loading result corresponding to the AJAX request of the specified domain name is successful in loading. If the XHR object does not receive the feedback resource of the target server within the preset time after sending the AJAX request, the information that the feedback is not received can be sent to the browser, the browser receives the information and determines that the AJAX request of the specified domain name is forbidden, namely, determines that the loading result corresponding to the AJAX request of the specified domain name is loading failure.
In step S44, the loading result is fed back to the target server, so that the target server determines an available domain name according to the loading result.
In the exemplary embodiment, in the process of loading the webpage data returned by the target server, under the condition of supporting cross-domain access, the AJAX request of the specified domain name of the target server is sent through the first domain name, if the feedback resource of the target server is received, the feedback resource is loaded, and the loading result corresponding to the AJAX request of the specified domain name is determined to be loading success, and if the feedback resource of the target server is not received, the loading result corresponding to the AJAX request of the specified domain name is determined to be loading failure, so that the sniffing of the AJAX request of the specified domain name through the first domain name which successfully accesses the target server is realized, instead of using a fixed browser or a simulator for sniffing, the domain name can be sniffed under various network environments, the accuracy of the sniffing result is improved, and the availability of the AJAX request in service is ensured.
Fig. 5 is a flowchart illustrating a resource sniffing method according to an exemplary embodiment, which is used in the target server to determine an available domain name according to a loading result fed back by the browser, as shown in fig. 5.
In step S51, receiving loading results sent by multiple browsers to obtain multiple loading results, where the loading results are obtained by loading resources of other domain names of a target server by a first domain name in a process of loading web page data when the browser receives the web page data of the target server by the first domain name.
After the first browser successfully accesses the target server through the first domain name, in the process of loading webpage data returned by the target server, resources of other domain names of the target server can be loaded through the first domain name, and a loading result is returned to the target server; after the second browser successfully accesses the target server through the second domain name, in the process of loading the webpage data returned by the target server, the resources of other domain names of the target server can be loaded through the second domain name, and the loading result is returned to the target server; similarly, other browsers can also perform resource accessibility sniffing through the first domain name, the second domain name, or other domain names, and return the loading result to the target server. The target server may receive the loading results fed back by the multiple browsers, that is, the target server receives the multiple loading results. One browser can feed back one loading result or feed back a plurality of loading results.
In step S52, an available domain name is determined according to the plurality of loading results.
The loading result may include that a specific resource of a domain name may be loaded or may not be loaded, for example, CSS of a domain name may be loaded, JS may not be loaded, and the like.
The plurality of load results may be load results for a plurality of domain names. Therefore, the available domain name can be determined by counting a plurality of loading results according to the domain name.
In an exemplary embodiment, the determining an available domain name according to the plurality of loading results may include: counting the loading results of the same domain name in the multiple loading results; if the loading result of one domain name meets the preset condition, determining that the domain name is unavailable; if the loading result of one domain name does not meet the preset condition, determining that the domain name is available; the available domain names are recorded.
The preset condition is a condition for determining whether a domain name is forbidden.
And counting a plurality of loading results according to the same domain name to obtain the loading result of each domain name. The loading result of a domain name may include available resources and unavailable resources, and the number of browsers corresponding to each resource. If the proportion of the number of browsers corresponding to the unavailable resource of one domain name in the browsers returning the sniffing results reaches a preset proportion, determining that the resource is unavailable; if all resources of a domain name are unavailable, determining that the domain name is unavailable; if all resources of a domain name are available, determining that the domain name is available. The available domain name is recorded and the partially unavailable domain name and the resources for which the domain name is unavailable are recorded. Through the statistics of the loading result and the record of the available domain name, the available domain name can be conveniently selected for issuing in the follow-up process.
When a user spreads a sharing page, a domain name acquisition request of the sharing page to be spread is sent to a target server through a sharing platform (such as WeChat and the like), and when the target server receives the domain name acquisition request, an available domain name can be issued, so that the service availability can be ensured. When the existing domain names have resources which are not available, a new domain name can be regenerated and issued to ensure the availability of the service.
In the exemplary embodiment, the loading results sent by the multiple browsers are received, the available domain names are determined according to the multiple loading results, and the loading results are obtained by loading resources of other domain names when the browsers successfully access the target server, so that domain names can be sniffed through the browsers used by users instead of using fixed browsers or simulators, the domain names can be sniffed under various network environments, the accuracy of the sniffing results is improved, and the delivered domain names are adjusted according to the sniffing results, so that the service availability is ensured.
FIG. 6 is a block diagram illustrating a resource sniffing apparatus in accordance with an exemplary embodiment. Referring to fig. 6, the apparatus includes an access request transmitting module 61, a resource loading module 62, and a loading result feedback module 63.
The access request sending module 61 is configured to send an access request to the target server through the first domain name;
the resource loading module 62 is configured to, if web page data fed back by the target server is received through a first domain name, load resources of other domain names of the target server through the first domain name in a process of loading the web page data, and determine a loading result of the other domain names;
the loading result feedback module 63 is configured to feed back the loading result to the target server, so that the target server determines an available domain name according to the loading result.
Optionally, the resource loading module includes:
a static resource request unit configured to send a static resource acquisition request to the target server through the first domain name in a process of loading the web page data;
a static resource receiving unit configured to receive a static resource returned by the target server, where the static resource includes a domain name loading file;
a loading request generation unit configured to send a loading request for the static resource of the specified domain name to the target server through the first domain name according to the domain name loading file in the process of loading the static resource;
a static loading result determining unit configured to determine that a loading result of the static resource of the specified domain name is a successful loading if the feedback of the target server is received; and if the feedback of the target server is not received, determining that the loading result of the static resource of the specified domain name is loading failure.
Optionally, the static resource includes at least one of CSS, JS, HTML, and pictures.
Optionally, the resource loading module includes:
an AJAX request sending unit, configured to send an AJAX request for a specified domain name of the target server through the first domain name in a process of loading the webpage data under the condition of supporting cross-domain access;
the AJAX loading result determining unit is configured to load the feedback resource if the feedback resource of the target server is received, and determine that the loading result corresponding to the AJAX request of the specified domain name is successful in loading; and if the feedback resource of the target server is not received, determining that the loading result corresponding to the AJAX request of the specified domain name is loading failure.
In the exemplary embodiment, the access request sending module sends the access request to the target server through the first domain name, the resource loading module loads resources of other domain names of the target server through the first domain name in the process of loading the webpage data if receiving the webpage data fed back by the target server through the first domain name, and determines loading results of the other domain names, and the loading result feedback module feeds the loading results back to the target server, so that the target server determines an available domain name according to the loading results, and the domain name can be sniffed through a browser used by a user instead of a fixed browser or a simulator, so that the domain name can be sniffed under various network environments, the accuracy of the sniffing results is improved, and the availability of the service is ensured.
FIG. 7 is a block diagram illustrating a resource sniffing apparatus in accordance with an exemplary embodiment. Referring to fig. 7, the apparatus includes a loading result receiving module 71 and an available domain name determining module 72.
The loading result receiving module 71 is configured to receive loading results sent by multiple browsers to obtain multiple loading results, where the loading results are obtained by loading resources of other domain names of a target server by a first domain name in a process of loading web page data when the browser receives the web page data of the target server by the first domain name;
the available domain name determination module 72 is configured to determine an available domain name based on the plurality of loading results.
Optionally, the available domain name determining module includes:
a loading result counting unit configured to count loading results of the same domain name in the plurality of loading results;
the available domain name determining unit is configured to determine that a domain name is unavailable if a loading result of the domain name meets a preset condition; if the loading result of one domain name does not meet the preset condition, determining that the domain name is available;
a domain name recording unit configured to record an available domain name.
In the exemplary embodiment, the loading result receiving module receives the loading results sent by the multiple browsers, the available domain name determining module determines the available domain name according to the multiple loading results, and the loading result is obtained by loading the resources of other domain names when the browsers successfully access the target server, so that the domain name can be sniffed by the browser used by the user instead of using a fixed browser or a simulator, and the domain name can be sniffed in multiple network environments, the accuracy of the sniffing result is improved, the issued domain name is adjusted according to the sniffing result, and the service availability is ensured.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 8 is a block diagram illustrating a terminal according to an example embodiment. For example, the terminal 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
Referring to fig. 8, terminal 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the terminal 800. Examples of such data include instructions for any application or method operating on terminal 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of terminal 800. Power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for terminal 800.
The multimedia component 808 includes a screen providing an output interface between the terminal 800 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the terminal 800 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the terminal 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
Sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for terminal 800. For example, sensor assembly 814 can detect an open/closed state of terminal 800, the relative positioning of components, such as a display and keypad of terminal 800, sensor assembly 814 can also detect a change in position of terminal 800 or a component of terminal 800, the presence or absence of user contact with terminal 800, orientation or acceleration/deceleration of terminal 800, and a change in temperature of terminal 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
Communication component 816 is configured to facilitate communications between terminal 800 and other devices in a wired or wireless manner. The apparatus 800 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the terminal 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the terminal 800 to perform the above-described method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
FIG. 9 is a block diagram illustrating a server in accordance with an example embodiment. Referring to fig. 9, the server 900 includes a processing component 922 that further includes one or more processors and memory resources, represented by memory 932, for storing instructions, such as applications, that are executable by the processing component 922. The application programs stored in memory 932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 922 is configured to execute instructions to perform the above-described methods.
The server 900 may also include a power component 926 configured to perform power management of the server 900, a wired or wireless network interface 950 configured to connect the server 900 to a network, and an input/output (I/O) interface 958. The server 900 may operate based on an operating system stored in memory 932, such as Windows Server, MacOS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a storage medium is also provided that includes instructions, such as the memory 932 that includes instructions, that are executable by the processing component 922 of the server 900 to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises readable program code executable by the processor 820 of the terminal 800 to perform the above-mentioned resource sniffing method or by the processing component 922 of the server 900 to perform the above-mentioned resource sniffing method. Alternatively, the program code may be stored in a storage medium of the terminal 800 or the server 900, which may be a non-transitory computer-readable storage medium, for example, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method for resource sniffing, comprising:
sending an access request to a target server through a first domain name;
if the webpage data fed back by the target server are received through the first domain name, in the process of loading the webpage data, loading resources of other domain names of the target server through the first domain name, and determining loading results of the other domain names;
and feeding back the loading result to the target server so that the target server determines the available domain name according to the loading result.
2. The method according to claim 1, wherein the loading, in the process of loading the web page data, resources of other domain names of the target server by the first domain name and determining loading results of the other domain names include:
in the process of loading the webpage data, sending a static resource acquisition request to the target server through the first domain name;
receiving static resources returned by the target server, wherein the static resources comprise domain name loading files;
in the process of loading the static resources, according to the domain name loading file, sending a loading request for the static resources of the specified domain name to the target server through the first domain name;
if the feedback of the target server is received, determining that the loading result of the static resource of the specified domain name is successful; and if the feedback of the target server is not received, determining that the loading result of the static resource of the specified domain name is loading failure.
3. The method according to claim 1, wherein the loading, in the process of loading the web page data, resources of other domain names of the target server by the first domain name and determining loading results of the other domain names include:
under the condition of supporting cross-domain access, in the process of loading the webpage data, sending an AJAX request for a specified domain name of the target server through the first domain name;
if the feedback resource of the target server is received, loading the feedback resource, and determining that the loading result corresponding to the AJAX request of the specified domain name is successful; and if the feedback resource of the target server is not received, determining that the loading result corresponding to the AJAX request of the specified domain name is loading failure.
4. A method for resource sniffing, comprising:
receiving loading results sent by a plurality of browsers to obtain a plurality of loading results, wherein the loading results are obtained by loading resources of other domain names of a target server through a first domain name in the process of loading webpage data when the browser receives the webpage data of the target server through the first domain name;
and determining the available domain name according to the plurality of loading results.
5. The method of claim 4, wherein determining the available domain name according to the plurality of loading results comprises:
counting the loading results of the same domain name in the multiple loading results;
if the loading result of one domain name meets the preset condition, determining that the domain name is unavailable; if the loading result of one domain name does not meet the preset condition, determining that the domain name is available;
the available domain names are recorded.
6. A resource sniffing device, comprising:
an access request sending module configured to send an access request to a target server through a first domain name;
the resource loading module is configured to load resources of other domain names of the target server through the first domain name and determine loading results of the other domain names in the process of loading the webpage data if the webpage data fed back by the target server are received through the first domain name;
and the loading result feedback module is configured to feed the loading result back to the target server, so that the target server determines an available domain name according to the loading result.
7. A resource sniffing device, comprising:
the loading result receiving module is configured to receive loading results sent by a plurality of browsers to obtain a plurality of loading results, wherein the loading results are obtained by loading resources of other domain names of a target server through a first domain name in the process of loading webpage data when the browser receives the webpage data of the target server through the first domain name;
an available domain name determining module configured to determine an available domain name according to the plurality of loading results.
8. A terminal, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource sniffing method as claimed in any of claims 1 to 3.
9. A server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the resource sniffing method as claimed in claim 4 or 5.
10. A storage medium having instructions that, when executed by a processor of a terminal, enable the terminal to perform the resource sniffing method as claimed in any one of claims 1 to 3 or that, when executed by a processor of a server, enable the server to perform the resource sniffing method as claimed in claim 4 or 5.
CN201911176222.8A 2019-11-26 2019-11-26 Resource sniffing method, device, terminal, server and storage medium Active CN111079040B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911176222.8A CN111079040B (en) 2019-11-26 2019-11-26 Resource sniffing method, device, terminal, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911176222.8A CN111079040B (en) 2019-11-26 2019-11-26 Resource sniffing method, device, terminal, server and storage medium

Publications (2)

Publication Number Publication Date
CN111079040A true CN111079040A (en) 2020-04-28
CN111079040B CN111079040B (en) 2023-09-01

Family

ID=70311701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911176222.8A Active CN111079040B (en) 2019-11-26 2019-11-26 Resource sniffing method, device, terminal, server and storage medium

Country Status (1)

Country Link
CN (1) CN111079040B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770161A (en) * 2020-06-28 2020-10-13 北京百度网讯科技有限公司 https sniffing jump method and device
CN114827158A (en) * 2021-01-18 2022-07-29 网宿科技股份有限公司 Configuration information loading method, system and server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040199520A1 (en) * 2003-04-04 2004-10-07 Parsons Advanced Holdings, Inc. Method for checking the availability of a domain name
CN103327135A (en) * 2013-06-27 2013-09-25 贝壳网际(北京)安全技术有限公司 Domain name resolution method, device and client
CN109246227A (en) * 2018-09-26 2019-01-18 北京达佳互联信息技术有限公司 A kind of data request method, device, terminal device and storage medium
CN109600385A (en) * 2018-12-28 2019-04-09 北京神州绿盟信息安全科技股份有限公司 A kind of access control method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040199520A1 (en) * 2003-04-04 2004-10-07 Parsons Advanced Holdings, Inc. Method for checking the availability of a domain name
CN103327135A (en) * 2013-06-27 2013-09-25 贝壳网际(北京)安全技术有限公司 Domain name resolution method, device and client
CN109246227A (en) * 2018-09-26 2019-01-18 北京达佳互联信息技术有限公司 A kind of data request method, device, terminal device and storage medium
CN109600385A (en) * 2018-12-28 2019-04-09 北京神州绿盟信息安全科技股份有限公司 A kind of access control method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111770161A (en) * 2020-06-28 2020-10-13 北京百度网讯科技有限公司 https sniffing jump method and device
CN114827158A (en) * 2021-01-18 2022-07-29 网宿科技股份有限公司 Configuration information loading method, system and server

Also Published As

Publication number Publication date
CN111079040B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN106569800B (en) Front-end interface generation method and device
CN107329743B (en) Application page display method and device and storage medium
CN107203398B (en) Application distribution method and device
CN107423106B (en) Method and apparatus for supporting multi-frame syntax
CN107193606B (en) Application distribution method and device
CN107220059B (en) Application interface display method and device
CN107239351B (en) Pasting method and device
CN106708967B (en) Page display method and device
CN111079040B (en) Resource sniffing method, device, terminal, server and storage medium
CN105808304B (en) Code deployment method, device and system
CN110413169B (en) Information display method, device and medium
CN111639276A (en) Resource preloading method and device and storage medium
CN109525652B (en) Information sharing method, device, equipment and storage medium
CN104572230B (en) Script file loading method and device and script file generating method and device
CN111695064B (en) Buried point loading method and device
CN110968492B (en) Information processing method and device and storage medium
CN111782997A (en) Method and device for loading webpage and storage medium
CN112486770A (en) Client dotting reporting method and device, electronic equipment and storage medium
CN109976872B (en) Data processing method and device, electronic equipment and storage medium
CN105630948A (en) Web page display method and apparatus
CN105868354B (en) Webpage repairing method and device
CN112486617B (en) Ciphertext data processing architecture, method, apparatus and machine readable medium
CN114428737A (en) Communication method, device, equipment and storage medium based on micro service system
CN114025317A (en) Multimedia resource propagation method, device, server, terminal and storage medium
CN107257384B (en) Service state monitoring method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant