File downloading method and device, electronic equipment and readable medium
By intercepting the user's file download request and judging the download permissions, combined with the use of virtual disk and target hash functions, the problem of difficult users to identify the authenticity of the download source and difficult to detect malicious attack behavior is solved, and the file integrity and security guarantee is achieved.
Patent Information
- Application Number
- CN202411770667.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-11
AI Technical Summary
It is difficult for users to identify the authenticity of the download source and are susceptible to fraud by fake links and counterfeit websites. Malicious attackers can use means such as disguise and induce, making their attack behavior more difficult to detect and prevent.
By intercepting the user's file download request, obtain the file type, and determine whether you have download permission based on the user's personal information. If you have permissions, download the file to the virtual disk, use the virtual disk to determine whether there is malicious information in the file, and use the target hash function to determine whether the file is corrupted.
Ensure the integrity and security of files, prevent malware or corrupt files from harming the system and data, enhance the ability to detect and block malicious behavior, and improve the security of the zero-trust system.
Smart Images

Figure CN119814759A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a file downloading method, a file downloading device, an electronic device and a computer-readable medium. Background Art
[0002] In daily office scenarios, users need to download content from the Internet, including software, code packages, documents, etc. However, it is difficult for users to identify the authenticity of the download source, and due to the influence of "survivor bias", users are easily deceived by fake links and counterfeit websites. At the same time, malicious attackers can use disguises and inducements to make their attacks more difficult to detect and prevent. Summary of the invention
[0003] The embodiments of the present invention provide a file downloading method, device, electronic device and computer-readable storage medium to solve the problem that it is difficult for users to identify the authenticity of the download source, and due to the influence of "survivor bias", users are easily deceived by fake links and counterfeit websites. At the same time, malicious attackers can use disguise and inducement to make their attack behaviors more difficult to detect and prevent.
[0004] The embodiment of the present invention discloses a file downloading method, comprising:
[0005] Intercept the user's file download request and obtain the file type corresponding to the file download request;
[0006] Based on the personal information of the user, determining whether the user has permission to download files of the file type;
[0007] If the user has the permission, the file corresponding to the file download request is downloaded to a preset virtual disk, and the virtual disk is used to determine whether there is malicious information in the file; the file contains a preset target hash function;
[0008] If the malicious information does not exist in the file, delivering the file to the user;
[0009] Based on the target hash function, it is determined whether the file obtained by the user is damaged.
[0010] Optionally, the file also contains a target hash value corresponding to the target hash function; and judging whether the file obtained by the user is damaged based on the target hash function includes:
[0011] Based on the target hash function, calculating a hash value to be processed corresponding to the target hash function;
[0012] If the to-be-processed hash value is the same as the target hash value, it is confirmed that the file obtained by the user is not damaged;
[0013] If the to-be-processed hash value is different from the target hash value, it is confirmed that the file obtained by the user is damaged.
[0014] Optionally, intercepting a user's file download request includes:
[0015] Acquire a network request sent by the user; the network request includes a network request identifier;
[0016] Based on the network request identifier, determining whether the network request is the file download request;
[0017] If the network request is the file download request, the file download request is intercepted.
[0018] Optionally, judging whether the user has permission to download files of the file type based on the personal information of the user includes:
[0019] Acquire the user's personal information; the personal information includes at least one of an ID number, birthday, file download password, and a verification code received by the user terminal;
[0020] Based on the personal information, obtaining the identity of the user;
[0021] Based on the identity of the user, it is determined whether the user has permission to download files of the file type.
[0022] Optionally, the method comprises:
[0023] Obtain the domain name corresponding to the file download request;
[0024] Determine whether the domain name exists in a preset whitelist;
[0025] If the domain name does not exist in the whitelist, the verification code received by the user terminal is obtained, and the identity of the user is verified based on the verification code.
[0026] Optionally, the method comprises:
[0027] The file obtained by the user is scanned using a preset malware scanning engine to determine whether there is malware in the file.
[0028] Optionally, the method comprises:
[0029] The download information of the file is recorded; the download information includes at least one of the downloading user, the downloading time and the name of the downloaded file.
[0030] The embodiment of the present invention also discloses a file downloading device, comprising:
[0031] An interception module is used to intercept a user's file download request and obtain the file type corresponding to the file download request;
[0032] An authority determination module, used to determine whether the user has the authority to download files of the file type based on the user's personal information;
[0033] A download module, used for downloading the file corresponding to the file download request to a preset virtual disk if the user has the permission, and judging whether there is malicious information in the file through the virtual disk; the file contains a preset target hash function;
[0034] A delivery module, configured to deliver the file to the user if the malicious information does not exist in the file;
[0035] A damage judgment module is used to judge whether the file obtained by the user is damaged based on the target hash function.
[0036] Optionally, the file also contains a target hash value corresponding to the target hash function; and the damage judgment module includes:
[0037] A calculation submodule, configured to calculate a hash value to be processed corresponding to the target hash function based on the target hash function;
[0038] A first confirmation submodule, configured to confirm that the file obtained by the user is not damaged if the hash value to be processed is the same as the target hash value;
[0039] The second confirmation submodule is used to confirm that the file obtained by the user is damaged if the to-be-processed hash value is different from the target hash value.
[0040] Optionally, the interception module includes:
[0041] A request acquisition submodule, used to acquire the network request sent by the user; the network request includes a network request identifier;
[0042] A request determination submodule, used to determine whether the network request is the file download request based on the network request identifier;
[0043] The interception submodule is used to intercept the file download request if the network request is the file download request.
[0044] Optionally, the authority determination module includes:
[0045] A personal information acquisition submodule, used to acquire the user's personal information; the personal information includes at least one of an ID number, birthday, file download password, and a verification code received by the user terminal;
[0046] An identity acquisition submodule, used to acquire the identity of the user based on the personal information;
[0047] The authority determination submodule is used to determine whether the user has the authority to download files of the file type based on the identity of the user.
[0048] Optionally, the device comprises:
[0049] A domain name acquisition module, used to obtain the domain name corresponding to the file download request;
[0050] A whitelist determination module is used to determine whether the domain name exists in a preset whitelist;
[0051] The verification code acquisition module is used to acquire the verification code received by the user terminal if the domain name does not exist in the whitelist, and verify the identity of the user based on the verification code.
[0052] Optionally, the device comprises:
[0053] The scanning module is used to use a preset malware scanning engine to scan the file obtained by the user to determine whether there is malware in the file.
[0054] Optionally, the device comprises:
[0055] The information recording module is used to record the download information of the file; the download information includes at least one of the downloading user, downloading time and download file name.
[0056] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0057] The memory is used to store computer programs;
[0058] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0059] The embodiment of the present invention further discloses one or more computer-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described in the embodiment of the present invention.
[0060] The embodiments of the present invention include the following advantages:
[0061] In an embodiment of the present invention, a user's file download request is intercepted, and the file type corresponding to the file download request is obtained. Based on the user's personal information, it is determined whether the user has the authority to download files of the file type; if the user has the authority, the file corresponding to the file download request is downloaded to a preset virtual disk, and the virtual disk is used to determine whether there is malicious information in the file; a preset target hash function exists in the file. If there is no malicious information in the file, the file is delivered to the user; based on the target hash function, it is determined whether the file obtained by the user is damaged. By determining whether there is malicious information in the file through the virtual disk and determining whether the file obtained by the user is damaged based on the target hash function, the integrity and security of the file are ensured to prevent malicious software or damaged files from causing harm to the system and data. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 is a flowchart of a method for downloading a file provided in an embodiment of the present invention;
[0063] Figure 2 is a flowchart of another method for downloading files provided in an embodiment of the present invention;
[0064] Figure 3 is a structural block diagram of a file downloading device provided in an embodiment of the present invention;
[0065] Figure 4 is a block diagram of an electronic device provided in an embodiment of the present invention;
[0066] Figure 5 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0068] To facilitate understanding of the technical solutions and technical effects of the embodiments of the present invention, the prior art of the present invention is briefly described below.
[0069] The main principle of zero-trust security refers to the fact that vulnerabilities often occur when companies place too much trust in individuals or devices. The zero-trust model states that by default, any user, even one allowed into the network, can be deceived in downloading operations, so they should not be trusted.
[0070] In daily office scenarios, users need to download from the Internet, including software, code packages, documents, and other content. Therefore, security is crucial in the file download scenario in zero trust. However, it is difficult for users to identify the authenticity of the download source, and due to the influence of "survivor bias", users are easily deceived by fake links and counterfeit websites. At the same time, malicious attackers can use disguise and inducement to make their attack behavior more difficult to detect and prevent.
[0071] Reference Figure 1 , shows a flowchart of a file downloading method provided in an embodiment of the present invention, which may specifically include the following steps:
[0072] Step 101, intercepting a user's file download request and obtaining a file type corresponding to the file download request;
[0073] In an embodiment of the present invention, a user may send at least one type of network request to the Internet. The network request may include a file download request. A user may download a file from the Internet through a file download request. However, when a user downloads a file through the Internet, it is difficult for the user to identify the authenticity of the download source and the user is easily deceived by fake links and counterfeit websites.
[0074] To ensure the security of file downloads in zero trust, you can intercept the user's file download request and obtain the file type corresponding to the file download request.
[0075] In some embodiments of the present invention, intercepting a user's file download request includes:
[0076] Acquire a network request sent by the user; the network request includes a network request identifier;
[0077] Based on the network request identifier, determining whether the network request is the file download request;
[0078] If the network request is the file download request, the file download request is intercepted.
[0079] In an embodiment of the present invention, the network request sent by the user usually includes a network request identifier. Therefore, the network request sent by the user can be obtained, and according to the network request identifier of the network request, it is determined whether the network request is a file download request. Specifically, if the network request identifier is: Content-Type: application / octet-stream, then the network request is confirmed to be a file download request. Among them, Content-Type refers to the content type, and application / octet-stream is a MIME (Multipurpose Internet Mail Extensions) type, indicating that the data is a binary stream, usually used for file downloads.
[0080] In an embodiment of the present invention, if the network request is a file download request, the file download request is intercepted and the file type corresponding to the file download request is determined.
[0081] Step 102, based on the user's personal information, determining whether the user has permission to download files of the file type;
[0082] In the embodiment of the present invention, the user's personal information can be obtained, the user's identity can be confirmed based on the user's personal information, and it can be determined whether the user is a user disguised by a malicious attacker, and whether the user has the authority to download files of the file type corresponding to the file download request.
[0083] In some embodiments of the present invention, judging whether the user has permission to download files of the file type based on the user's personal information includes:
[0084] Acquire the user's personal information; the personal information includes at least one of an ID number, birthday, file download password, and a verification code received by the user terminal;
[0085] Based on the personal information, obtaining the identity of the user;
[0086] Based on the identity of the user, it is determined whether the user has permission to download files of the file type.
[0087] In an embodiment of the present invention, the user's personal information can be obtained, and based on the user's personal information, the user's identity can be obtained. The user's personal information includes at least one of the user's ID number, birthday, file download password, and verification code received by the user terminal. The file download password refers to the password that the user needs to enter to confirm the user's identity when downloading files through the Internet. In an embodiment of the present invention, based on the user's identity, it can be determined whether the user has the authority to download files of the file type corresponding to the file download request.
[0088] Specifically, in a zero-trust environment, after intercepting the file download request sent by the user, the user needs to be authenticated and authorized to ensure that only authorized users can download specific files. This can be achieved through authentication mechanisms such as single sign-on and multi-factor authentication and access control policies.
[0089] Single sign-on refers to obtaining a single piece of personal information entered by the user and verifying the user's identity through the single piece of personal information. Single personal information can be an ID number, password, birthday, etc.
[0090] Multi-factor authentication refers to proving the user's identity by obtaining two or more personal information of the user, such as a password and a mobile phone SMS verification code, a password and the user's birthday, etc.
[0091] Access control policies are rules used to manage user access rights to resources. For example: Role-based access control: Based on the user's role, determine whether the user has permission to download a specific file.
[0092] In the embodiment of the present invention, a user attack challenge can also be performed, that is, a password, verification code, etc. are used to determine whether the user is disguised as a malicious attacker, and whether there is an automated attack or account takeover.
[0093] In some embodiments of the invention, the method comprises:
[0094] Obtain the domain name corresponding to the file download request;
[0095] Determine whether the domain name exists in a preset whitelist;
[0096] If the domain name does not exist in the whitelist, the verification code received by the user terminal is obtained, and the identity of the user is verified based on the verification code.
[0097] In an embodiment of the present invention, the domain name corresponding to the file download request can be obtained, and it is determined whether the domain name exists in a preset whitelist. If the domain name does not exist in the whitelist, a verification code received by the user terminal is obtained, and the identity of the user is verified based on the verification code. The domain name corresponding to the file download request is the network address used by the user when sending the file download request.
[0098] Step 103: If the user has the permission, the file corresponding to the file download request is downloaded to a preset virtual disk, and the virtual disk is used to determine whether there is malicious information in the file; the file contains a preset target hash function;
[0099] In an embodiment of the present invention, after verifying the user's identity and confirming that the user has the authority to download files of the file type corresponding to the file download request, the file corresponding to the file download request is downloaded to a preset virtual disk environment. The virtual disk environment simulates certain parts of the operating system, but is isolated from the user's actual system. The virtual disk environment can further analyze and test the file, help detect whether there is malicious information in the file, and prevent unknown malicious behavior in the file to protect the actual system from unknown threats. Therefore, it is possible to determine whether there is malicious information in the file through the virtual disk.
[0100] Malicious information includes malware, code, etc. It should be noted that there is a preset target hash function in the file.
[0101] Step 104: if the malicious information does not exist in the file, the file is delivered to the user;
[0102] In the embodiment of the present invention, if the virtual disk environment confirms that there is no malicious information in the file, the file can be delivered to the user. The file obtained by the user is the downloaded file.
[0103] Step 105: Based on the target hash function, determine whether the file obtained by the user is damaged.
[0104] In the embodiment of the present invention, after the actual system used by the user obtains the downloaded file, the system can determine whether the file obtained by the user is tampered with or damaged during the transmission process based on the target hash function included in the file.
[0105] In some embodiments of the present invention, the file also contains a target hash value corresponding to the target hash function; and judging whether the file obtained by the user is damaged based on the target hash function includes:
[0106] Based on the target hash function, calculating a hash value to be processed corresponding to the target hash function;
[0107] If the to-be-processed hash value is the same as the target hash value, it is confirmed that the file obtained by the user is not damaged;
[0108] If the to-be-processed hash value is different from the target hash value, it is confirmed that the file obtained by the user is damaged.
[0109] In an embodiment of the present invention, the download file includes a target hash function and a target hash value corresponding to the target hash function. After the actual system used by the user obtains the downloaded file, the system can calculate the to-be-processed hash value corresponding to the target hash function based on the target hash function. If the to-be-processed hash value is the same as the target hash value, it is confirmed that the file obtained by the user has not been damaged or tampered with; if the to-be-processed hash value is different from the target hash value, it is confirmed that the file obtained by the user has been damaged or tampered with.
[0110] Specifically, the target hash function can be md5 (Message-Digest Algorithm 5). The steps to calculate the hash value of the data to be processed based on the MD5 hash function are as follows: First, obtain the data to be hashed. This can be any form of data, such as text, files, etc. Then, create an MD5 hash object in the system. Convert the data to be hashed into a byte string. Pass the data byte string to the hash object. Finally, call the digest() or hexdigest() method of the hash object to obtain the hash value. The digest() method returns binary data, while hexdigest() returns a string in hexadecimal format.
[0111] In some embodiments of the invention, the method comprises:
[0112] The file obtained by the user is scanned using a preset malware scanning engine to determine whether there is malware in the file.
[0113] In an embodiment of the present invention, a malware scanning engine may be used to scan the downloaded file to detect whether there is malware in the file, so as to prevent the malware from spreading into the system.
[0114] In some embodiments of the invention, the method comprises:
[0115] The download information of the file is recorded; the download information includes at least one of the downloading user, the downloading time and the name of the downloaded file.
[0116] In the embodiment of the present invention, detailed information of file downloads, including user, time, file name, etc., is recorded to facilitate subsequent audits and investigations, which helps to track and identify potential security incidents.
[0117] In an embodiment of the present invention, a user's file download request is intercepted, and the file type corresponding to the file download request is obtained. Based on the user's personal information, it is determined whether the user has the authority to download files of the file type; if the user has the authority, the file corresponding to the file download request is downloaded to a preset virtual disk, and the virtual disk is used to determine whether there is malicious information in the file; a preset target hash function exists in the file. If there is no malicious information in the file, the file is delivered to the user; based on the target hash function, it is determined whether the file obtained by the user is damaged. By determining whether there is malicious information in the file through the virtual disk and determining whether the file obtained by the user is damaged based on the target hash function, the integrity and security of the file are ensured to prevent malicious software or damaged files from causing harm to the system and data.
[0118] In a zero-trust system, high requirements are placed on users, and the misoperation of a single user may affect the global network security. File downloading is an operation that users use frequently and has extremely high security risks. The present invention uses a virtual disk to determine whether there is malicious information in the file and determines whether the file obtained by the user is damaged based on the target hash function, thereby ensuring the integrity and security of the user's downloaded files, enhancing the ability to detect and prevent malicious behavior, and improving the security of the zero-trust system.
[0119] In the embodiment of the present invention, all browser download behaviors of user terminals are included in the management and control of zero-trust products, and users are only allowed to download official software. Files from third parties and non-whitelisted domain names require manual confirmation by users through verification codes, passwords, etc., and warnings will be recorded to the audit center.
[0120] Reference Figure 2 , shows a flowchart of another method for downloading a file provided in an embodiment of the present invention, which may specifically include the following steps:
[0121] Step 201, file download control.
[0122] Step 202: Network request interception, including network request filtering and extracting related domain names.
[0123] Obtain the network request sent by the user, which includes a network request identifier. Based on the network request identifier, determine whether the network request is a file download request; if the network request is a file download request, intercept the file download request and obtain the domain name corresponding to the file download request.
[0124] Step 203: User authentication and authorization, including security challenges for non-whitelisted domain names.
[0125] The user's personal information is obtained, and the personal information includes at least one of an ID number, birthday, file download password, and a verification code received by the user terminal. Based on the personal information, the user's identity is obtained; based on the user's identity, whether the user has the authority to download files of the file type is determined.
[0126] It is determined whether the domain name exists in a preset whitelist. If the domain name does not exist in the whitelist, a verification code received by the user terminal is obtained, and the identity of the user is verified based on the verification code.
[0127] Step 204: virtual disk storage.
[0128] The file corresponding to the file download request is downloaded to a preset virtual disk, and the virtual disk is used to determine whether there is malicious information in the file.
[0129] Step 205, Trojan scanning, including local calculation of MD5 and uploading to cloud sandbox Trojan scanning.
[0130] Based on the target hash function, the hash value to be processed corresponding to the target hash function is calculated. If the hash value to be processed is the same as the target hash value, it is confirmed that the file obtained by the user is not damaged; if the hash value to be processed is different from the target hash value, it is confirmed that the file obtained by the user is damaged. The file obtained by the user is scanned using the preset malware scanning engine to determine whether there is malware in the file.
[0131] A cloud sandbox is a cloud computing environment that allows users to run and test unknown or untrusted code, applications, or files in an isolated environment without posing potential threats to the host system or other network environments.
[0132] Step 206: audit operation records.
[0133] The download information of the file is recorded, where the download information includes at least one of the downloading user, the downloading time and the name of the downloaded file.
[0134] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0135] Reference Figure 3 , shows a structural block diagram of a file downloading device provided in an embodiment of the present invention, which may specifically include the following modules:
[0136] The interception module 301 is used to intercept the user's file download request and obtain the file type corresponding to the file download request;
[0137] The authority determination module 302 is used to determine whether the user has the authority to download files of the file type based on the user's personal information;
[0138] The download module 303 is used to download the file corresponding to the file download request to a preset virtual disk if the user has the permission, and determine whether there is malicious information in the file through the virtual disk; the file contains a preset target hash function;
[0139] A delivery module 304, configured to deliver the file to the user if the malicious information does not exist in the file;
[0140] The damage judgment module 305 is used to judge whether the file obtained by the user is damaged based on the target hash function.
[0141] In an optional embodiment of the present invention, the file also contains a target hash value corresponding to the target hash function; and the damage judgment module includes:
[0142] A calculation submodule, configured to calculate a hash value to be processed corresponding to the target hash function based on the target hash function;
[0143] A first confirmation submodule, configured to confirm that the file obtained by the user is not damaged if the hash value to be processed is the same as the target hash value;
[0144] The second confirmation submodule is used to confirm that the file obtained by the user is damaged if the to-be-processed hash value is different from the target hash value.
[0145] In an optional embodiment of the present invention, the interception module includes:
[0146] A request acquisition submodule, used to acquire the network request sent by the user; the network request includes a network request identifier;
[0147] A request determination submodule, used to determine whether the network request is the file download request based on the network request identifier;
[0148] The interception submodule is used to intercept the file download request if the network request is the file download request.
[0149] In an optional embodiment of the present invention, the authority determination module includes:
[0150] A personal information acquisition submodule, used to acquire the user's personal information; the personal information includes at least one of an ID number, birthday, file download password, and a verification code received by the user terminal;
[0151] An identity acquisition submodule, used to acquire the identity of the user based on the personal information;
[0152] The authority determination submodule is used to determine whether the user has the authority to download files of the file type based on the identity of the user.
[0153] In an optional embodiment of the present invention, the device comprises:
[0154] A domain name acquisition module, used to obtain the domain name corresponding to the file download request;
[0155] A whitelist determination module is used to determine whether the domain name exists in a preset whitelist;
[0156] The verification code acquisition module is used to acquire the verification code received by the user terminal if the domain name does not exist in the whitelist, and verify the identity of the user based on the verification code.
[0157] In an optional embodiment of the present invention, the device comprises:
[0158] The scanning module is used to use a preset malware scanning engine to scan the file obtained by the user to determine whether there is malware in the file.
[0159] In an optional embodiment of the present invention, the device comprises:
[0160] The information recording module is used to record the download information of the file; the download information includes at least one of the downloading user, downloading time and download file name.
[0161] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0162] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0163] Memory 403, used for storing computer programs;
[0164] The processor 401 is used to execute the program stored in the memory 403 to implement the following steps:
[0165] Intercept the user's file download request and obtain the file type corresponding to the file download request;
[0166] Based on the personal information of the user, determining whether the user has permission to download files of the file type;
[0167] If the user has the permission, the file corresponding to the file download request is downloaded to a preset virtual disk, and the virtual disk is used to determine whether there is malicious information in the file; the file contains a preset target hash function;
[0168] If the malicious information does not exist in the file, delivering the file to the user;
[0169] Based on the target hash function, it is determined whether the file obtained by the user is damaged.
[0170] In an optional embodiment of the present invention, the file also contains a target hash value corresponding to the target hash function; and judging whether the file obtained by the user is damaged based on the target hash function includes:
[0171] Based on the target hash function, calculating a hash value to be processed corresponding to the target hash function;
[0172] If the to-be-processed hash value is the same as the target hash value, it is confirmed that the file obtained by the user is not damaged;
[0173] If the to-be-processed hash value is different from the target hash value, it is confirmed that the file obtained by the user is damaged.
[0174] In an optional embodiment of the present invention, intercepting a user's file download request includes:
[0175] Acquire a network request sent by the user; the network request includes a network request identifier;
[0176] Based on the network request identifier, determining whether the network request is the file download request;
[0177] If the network request is the file download request, the file download request is intercepted.
[0178] In an optional embodiment of the present invention, judging whether the user has permission to download files of the file type based on the personal information of the user includes:
[0179] Acquire the user's personal information; the personal information includes at least one of an ID number, birthday, file download password, and a verification code received by the user terminal;
[0180] Based on the personal information, obtaining the identity of the user;
[0181] Based on the identity of the user, it is determined whether the user has permission to download files of the file type.
[0182] In an optional embodiment of the present invention, the method includes:
[0183] Obtain the domain name corresponding to the file download request;
[0184] Determine whether the domain name exists in a preset whitelist;
[0185] If the domain name does not exist in the whitelist, the verification code received by the user terminal is obtained, and the identity of the user is verified based on the verification code.
[0186] In an optional embodiment of the present invention, the method includes:
[0187] The file obtained by the user is scanned using a preset malware scanning engine to determine whether there is malware in the file.
[0188] In an optional embodiment of the present invention, the method includes:
[0189] The download information of the file is recorded; the download information includes at least one of the downloading user, the downloading time and the name of the downloaded file.
[0190] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0191] The communication interface is used for communication between the above terminal and other devices.
[0192] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0193] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0194] like Figure 5 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 501 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes a file downloading method described in the above embodiment.
[0195] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes a file downloading method described in the above embodiment.
[0196] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0197] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0198] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0199] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A file downloading method, characterized in that: include: Intercept the user's file download request and obtain the file type corresponding to the file download request; Based on the personal information of the user, determining whether the user has permission to download files of the file type; If the user has the permission, the file corresponding to the file download request is downloaded to a preset virtual disk, and whether malicious information is contained in the file is determined through the virtual disk; There is a preset target hash function in the file; If the malicious information does not exist in the file, delivering the file to the user; Based on the target hash function, it is determined whether the file obtained by the user is damaged.
2. The method according to claim 1, characterized in that The file also contains a target hash value corresponding to the target hash function; The determining, based on the target hash function, whether the file obtained by the user is damaged includes: Based on the target hash function, calculating a hash value to be processed corresponding to the target hash function; If the to-be-processed hash value is the same as the target hash value, it is confirmed that the file obtained by the user is not damaged; If the to-be-processed hash value is different from the target hash value, it is confirmed that the file obtained by the user is damaged.
3. The method according to claim 1, characterized in that The intercepting of the user's file download request comprises: Acquire a network request sent by the user; the network request includes a network request identifier; Based on the network request identifier, determining whether the network request is the file download request; If the network request is the file download request, the file download request is intercepted.
4. The method according to claim 1, characterized in that: The determining, based on the user's personal information, whether the user has permission to download files of the file type includes: Acquire the user's personal information; the personal information includes at least one of an ID number, birthday, file download password, and a verification code received by the user terminal; Based on the personal information, obtaining the identity of the user; Based on the identity of the user, it is determined whether the user has permission to download files of the file type.
5. The method according to claim 1, characterized in that The method comprises: Obtain the domain name corresponding to the file download request; Determine whether the domain name exists in a preset whitelist; If the domain name does not exist in the whitelist, the verification code received by the user terminal is obtained, and the identity of the user is verified based on the verification code.
6. The method according to claim 1, characterized in that The method comprises: The file obtained by the user is scanned using a preset malware scanning engine to determine whether there is malware in the file.
7. The method according to claim 1, characterized in that The method comprises: The download information of the file is recorded; the download information includes at least one of the downloading user, the downloading time and the name of the downloaded file.
8. A file downloading device, characterized in that: include: An interception module is used to intercept a user's file download request and obtain the file type corresponding to the file download request; An authority determination module, used to determine whether the user has the authority to download files of the file type based on the user's personal information; A download module, configured to download the file corresponding to the file download request to a preset virtual disk if the user has the permission, and determine whether there is malicious information in the file through the virtual disk; There is a preset target hash function in the file; A delivery module, configured to deliver the file to the user if the malicious information does not exist in the file; A damage judgment module is used to judge whether the file obtained by the user is damaged based on the target hash function.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.
10. One or more computer-readable media having instructions stored thereon, which when executed by one or more processors cause the processors to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Credible storage and access permission control method for object storage system based on block chain
CN110138733A
SFTP authorization method and system based on portable operation and maintenance gateway
CN116074128A
File processing method and system
CN117313085A
File transmission method and system, storage medium and electronic equipment
CN118433171A
Method and apparatus for examining forgery of file by using file hash value
KR1020180036140A