Basic web attacks can be roughly divided into three categories – “resource enumeration“, “parameter manipulation” and “other attacks”
Resource enumeration: traverse all accessible directories of the site, and then enumerate some common spare wheel file names (such as “SQL. Bak” and “index copy. HTML”) one by one. If you are lucky, you can download them directly.
Parameter manipulation: including SQL injection, XPath injection, CGI command execution, XXS and session hijacking. XXS attack refers to a malicious attacker inserting malicious HTML code into a web page. When a user browses the page, the embedded malicious HTML code will be executed to achieve the special purpose of a malicious user.
Cookie hijacking: by obtaining the permission of the page, write a simple request to the malicious site in the page and carry the user’s www.sangpi.comcookie. After obtaining the cookie, you can directly log in to the site as the stolen user.
Never trust any information sent by the client. These information should be encoded or filtered first
Carefully return the information entered by the user
Use blacklist and whitelist processing (i.e. “what sensitive information is not allowed” or “what information is only allowed”, whitelist is more effective but has high limitations)
Check and verify the source of the request, and check every important operationgameRevalidation
Use SSL to prevent third parties from listening to communication (but XSS, CSRF and SQL injection attacks cannot be prevented)
Do not store important documents and backup documents in places accessible to the public
Disordering session IDs
Verify the file uploaded by the user (not only the format verification, for example, a GIF picture should also be converted to binary and its color value < unsigned 8 bits > and width height value < unsigned 16 bits > per frame should be verified)
The WSDL document should require the user to register before it can be obtained