CN117714107A - File downloading method, device, computer equipment and computer readable storage medium - Google Patents

File downloading method, device, computer equipment and computer readable storage medium Download PDF

Info

Publication number
CN117714107A
CN117714107A CN202311591992.5A CN202311591992A CN117714107A CN 117714107 A CN117714107 A CN 117714107A CN 202311591992 A CN202311591992 A CN 202311591992A CN 117714107 A CN117714107 A CN 117714107A
Authority
CN
China
Prior art keywords
request
source file
user
file
downloading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311591992.5A
Other languages
Chinese (zh)
Inventor
苏海红
张�浩
黄政
马建江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yishi Huolala Technology Co Ltd
Original Assignee
Shenzhen Yishi Huolala 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 Shenzhen Yishi Huolala Technology Co Ltd filed Critical Shenzhen Yishi Huolala Technology Co Ltd
Priority to CN202311591992.5A priority Critical patent/CN117714107A/en
Publication of CN117714107A publication Critical patent/CN117714107A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a file downloading method, a file downloading device, computer equipment and a computer readable storage medium, wherein the method comprises the following steps: intercepting a user downloading request, adding a check field, and forwarding; whether the verification request comes from Nginx forwarding or not, encrypting the request and forwarding after the verification is successful, and rejecting the request after the verification is failed; decrypting to verify whether the request is legal, rejecting the request when the request is illegal, and returning to the source file when the request is legal; and judging whether the source file needs to be processed or not, directly returning the source file to the user and recording the user downloading operation when the source file does not need to be processed, and returning the source file to the user and recording the user downloading operation after encrypting and/or watermarking the source file when the source file needs to be processed. According to the method, the encryption and/or watermarking processing on the source file is realized by intercepting the downloaded file request of the user, so that the source file leakage is avoided, the actual operation of the user is effectively recorded, and the file leakage and service load overhigh or breakdown caused by malicious attack can be prevented.

Description

File downloading method, device, computer equipment and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for downloading a file, a computer device, and a computer readable storage medium.
Background
The development of the visual system requires a great deal of manpower and financial resources, so most enterprises can select third party visual software to integrate when needing the visual system, such as Tableau or sailing, and the like, when integrating and embedding a third party system page for display, a user can directly download a source file to cause leakage after downloading the file, and the front end of the embedded page can not capture the follow-up operation and record of the user, and can also face malicious attacks of other people, such as continuous transmission of downloading requests, so that the load of storing the file is too high and even the influence of running is caused.
Disclosure of Invention
The invention aims to provide a file downloading method, a file downloading device, computer equipment and a computer readable storage medium, which aim to solve the problem that file downloading and user operation cannot be controlled after an enterprise system integrates third-party report system software.
In a first aspect, the present invention provides a file downloading method, applied to a system integrated with third party software, including:
s101, intercepting a user downloading request, adding a check field, and forwarding;
s102, verifying whether the request comes from Nginx forwarding, encrypting the request and forwarding after verification is successful, and rejecting the request after verification is failed;
s103, decrypting to verify whether the request is legal, rejecting the request when the request is illegal, and returning to the source file when the request is legal;
s104, judging whether the source file needs to be processed, directly returning the source file to the user and recording the user downloading operation when the source file does not need to be processed, encrypting and/or watermarking the source file when the source file needs to be processed, and then returning the source file to the user and recording the user downloading operation.
In a second aspect, the present invention provides a file downloading device, applied to a system integrated with third party software, comprising:
the interception module is used for intercepting a user downloading request, adding a check field and forwarding the user downloading request;
the encryption module is used for verifying whether the request comes from Nginx forwarding, encrypting the request and forwarding after verification is successful, and rejecting the request after verification is failed;
the source file acquisition module is used for decrypting and verifying whether the request is legal or not, rejecting the request when the request is illegal, and returning the source file when the request is legal;
and the source file processing module is used for judging whether the source file needs to be processed, directly returning the source file to a user and recording the user downloading operation when the source file does not need to be processed, encrypting and/or watermarking the source file when the source file needs to be processed, and then returning the source file to the user and recording the user downloading operation.
In a third aspect, the present invention provides a computer device comprising:
one or more processors;
a memory; and
one or more computer programs, the processor and the memory being connected by a bus, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, which when executing the computer programs implement the steps of the file downloading method as described above.
In a fourth aspect, the present invention provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of a file downloading method as described above.
The invention provides a file downloading method, which can realize encryption and/or watermarking of a source file by intercepting a file downloading request of a capturing user, avoid source file leakage, effectively record the real operation of the user, prevent the risk of file leakage caused by directly obtaining a file by linking a front-end page downloading request by other people through analysis and falsification of the request, and prevent service load from being too high or crashed caused by malicious attack.
Drawings
FIG. 1 is a flowchart of a file downloading method according to a first embodiment of the present invention;
FIG. 2 is a functional block diagram of a file downloading device according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a computer device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples.
Embodiment one:
as shown in fig. 1, a first embodiment of the present invention provides a file downloading method 100, which is applied to a system integrated with third party software, such as an enterprise internal system integrated with a Tableau system, etc., where the file downloading method 100 includes the following steps:
s101, intercepting a user downloading request, adding a check field, and forwarding. For example, a front-end server of the system intercepts a user downloading request, adds a check field and forwards the user downloading request to a back-end server of the system, and intercepts the front-end request by configuring an Nginx interception rule on the front-end server, so that when a user initiates the downloading request, the downloading request is intercepted. The interception rules may be based on specific download requests to analyze how configured specifically. The downloading request also carries cookie information of the user browser when being forwarded.
S102, verifying whether the request comes from Nginx forwarding, encrypting the request and forwarding after verification is successful, and rejecting the request after verification is failed. For example, the back-end server of the system verifies whether the request comes from the Nginx forwarding of the front-end server, and after verification is successful, the encryption request is forwarded to the source file storage server, and if verification fails, the request is refused, wherein the encryption request is encrypted according to an encryption rule formulated with the source file storage server, and the back-end server receives parameters transmitted by the front-end server and obtains a download link address according to the agreed rule.
S103, decrypting to verify whether the request is legal, rejecting the request when the request is illegal, and returning the source file when the request is legal. For example, after receiving an encryption request, a source file storage server of the system verifies whether the request is legal through decryption, refuses the request when the request is illegal, and returns the source file to a back-end server of the system when the request is legal, wherein the source file storage server is generally a back-end server of a third-party system, and the reason for separating the source file storage server from the back-end server of an enterprise is that the back-end server of the third-party system needs to bear daily running tasks and requests displayed by corresponding pages at the front end, and the request needs to keep high stability, so the source file storage server is generally separated from the back-end server of the enterprise.
S104, judging whether the source file needs to be processed, directly returning the source file to the user and recording the user downloading operation when the source file does not need to be processed, encrypting and/or watermarking the source file when the source file needs to be processed, and then returning the source file to the user and recording the user downloading operation. For example, the backend server of the system determines whether the source file needs to be processed after acquiring the source file, directly returns the source file to the user and records the user download operation when the source file does not need to be processed, encrypts and/or watermarking the source file when the source file needs to be processed, then returns the source file to the user and records the user download operation, wherein the backend server accesses the source file through the download link address acquired in step S102 and returns the download link address to the front-end user.
According to the file downloading method provided by the embodiment of the invention, the file downloading request of the capturing user is intercepted, so that the encryption and/or watermarking processing of the source file is realized, the source file leakage is avoided, the real operation of the user is effectively recorded, the risk of file leakage caused by directly obtaining the file by linking a front-end page downloading request by a fake request through analysis of the front-end page downloading request can be prevented, and the service load is prevented from being too high or crashed caused by malicious attack.
Embodiment two:
the second embodiment of the present invention provides a file downloading device 200, which is applied to a system integrated with third party software, and includes:
the interception module 201 is configured to intercept a user download request, add a check field, and forward the user download request;
the encryption module 202 is configured to verify whether the request is forwarded from nginnx, encrypt the request and forward the request after verification is successful, and reject the request after verification fails;
a source file obtaining module 203, configured to decrypt and verify whether the request is legal, reject the request when the request is illegal, and return the source file when the request is legal;
the source file processing module 204 is configured to determine whether processing is required for the source file, directly return the source file to the user and record the user download operation when processing is not required, encrypt and/or watermark the source file when processing is required, and then return the source file to the user and record the user download operation.
The file downloading device provided by the second embodiment of the present invention and the file downloading method provided by the first embodiment of the present invention belong to the same concept, and detailed implementation processes thereof are shown in the entire specification, and are not repeated here.
Embodiment III:
as shown in fig. 3, a third embodiment of the present invention provides a computer apparatus 300, including:
one or more processors 301;
a memory 302; and
one or more computer programs, the processor and the memory being connected by a bus, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, which when executing the computer programs, implement the steps of the file downloading method as provided in embodiment one.
Embodiment four:
a fourth embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the file downloading method as provided in the first embodiment.
The invention provides a file downloading method, which can realize encryption and/or watermarking of a source file by intercepting a file downloading request of a capturing user, avoid source file leakage, effectively record the real operation of the user, prevent the risk of file leakage caused by directly obtaining a file by linking a front-end page downloading request by other people through analysis and falsification of the request, and prevent service load from being too high or crashed caused by malicious attack.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (6)

1. A method for downloading a file, applied to a system integrated with third party software, comprising:
s101, intercepting a user downloading request, adding a check field, and forwarding;
s102, verifying whether the request comes from Nginx forwarding, encrypting the request and forwarding after verification is successful, and rejecting the request after verification is failed;
s103, decrypting to verify whether the request is legal, rejecting the request when the request is illegal, and returning to the source file when the request is legal;
s104, judging whether the source file needs to be processed, directly returning the source file to the user and recording the user downloading operation when the source file does not need to be processed, encrypting and/or watermarking the source file when the source file needs to be processed, and then returning the source file to the user and recording the user downloading operation.
2. The method of claim 1, wherein intercepting the user download request is accomplished by configuring an Nginx interception rule.
3. The method of claim 1, wherein intercepting the user download request and forwarding with the addition of the check field further comprises forwarding cookie information for the user browser.
4. A file downloading apparatus for use in a system incorporating third party software, the apparatus comprising:
the interception module is used for intercepting a user downloading request, adding a check field and forwarding the user downloading request;
the encryption module is used for verifying whether the request comes from Nginx forwarding, encrypting the request and forwarding after verification is successful, and rejecting the request after verification is failed;
the source file acquisition module is used for decrypting and verifying whether the request is legal or not, rejecting the request when the request is illegal, and returning the source file when the request is legal;
and the source file processing module is used for judging whether the source file needs to be processed, directly returning the source file to a user and recording the user downloading operation when the source file does not need to be processed, encrypting and/or watermarking the source file when the source file needs to be processed, and then returning the source file to the user and recording the user downloading operation.
5. A computer device, comprising:
one or more processors;
a memory; and
one or more computer programs, the processor and the memory being connected by a bus, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, characterized in that the processor, when executing the computer programs, implements the steps of the file downloading method according to any of claims 1 to 3.
6. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the file downloading method according to any one of claims 1 to 3.
CN202311591992.5A 2023-11-27 2023-11-27 File downloading method, device, computer equipment and computer readable storage medium Pending CN117714107A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311591992.5A CN117714107A (en) 2023-11-27 2023-11-27 File downloading method, device, computer equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311591992.5A CN117714107A (en) 2023-11-27 2023-11-27 File downloading method, device, computer equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117714107A true CN117714107A (en) 2024-03-15

Family

ID=90148864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311591992.5A Pending CN117714107A (en) 2023-11-27 2023-11-27 File downloading method, device, computer equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117714107A (en)

Similar Documents

Publication Publication Date Title
US9588848B2 (en) System and method of restoring modified data
US9900346B2 (en) Identification of and countermeasures against forged websites
US7613918B2 (en) System and method for enforcing a security context on a downloadable
US8949995B2 (en) Certifying server side web applications against security vulnerabilities
US20090316894A1 (en) Method and apparatus for checking consistency between digital contents
KR101387600B1 (en) Electronic file sending method
CN112217835A (en) Message data processing method and device, server and terminal equipment
CN110851800B (en) Code protection method, device, system and readable storage medium
CN111698237A (en) Method and system for adding watermark to WEB page
CN106330817A (en) Webpage access method, device and terminal
CN110968872A (en) File vulnerability detection processing method and device, electronic equipment and storage medium
CN105930728A (en) Application examining method and device
CN113395269B (en) Data interaction method and device
CN117714107A (en) File downloading method, device, computer equipment and computer readable storage medium
CN105893862A (en) Browser cache data protection method and device
KR20230111434A (en) Method and system for mydata service authentication
CN111181831B (en) Communication data processing method and device, storage medium and electronic device
Phumkaew et al. Android forensic and security assessment for hospital and stock-and-trade applications in thailand
CN111049794A (en) Page reverse crawling method and device, storage medium and gateway equipment
KR102042086B1 (en) Module for controlling encryption communication protocol
KR20090024371A (en) A.i drm agent
CN114222301B (en) Fraud site processing method, fraud site processing device and storage medium
WO2019134272A1 (en) Method, device, and system for detecting secondary packaging of application installation package, and storage medium
He et al. On the application of digital forensics in different scenarios
CN116094748A (en) Message signature interception system based on bloom filter

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