CSRF attacks
Cross-site request forgery, in which an attacker steals your identity and sends malicious requests on your behalf. CSRF can do things like: send emails in your name, send messages, steal your account, even buy goods, virtual currency transfer…… The problems include personal privacy leakage and property security.
For example, you login in taobao www.taobao.com, this time your browser has your login cookie, the premise is not logged out, this time someone to send you a link, this link request to visit Taobao, sent a request, this time your cookie will be obtained, The somebody else can undertake operation to your taobao account
This attack must satisfy two conditions:
- Log in to trusted website A and generate cookies locally.
- Visit dangerous site B without logging out of A.
XSS attacks
Cross-site scripting attacks, in which any attempt is made to execute scripts on target sites that are not on target sites is to embed code in web pages
Insert malicious Script code into the Web page. When the user browses the page, the Script code embedded in the Web will be executed, so as to achieve the purpose of malicious attack on the user.
For example, a user enters javascript code in the input of a website, which is triggered when the user clicks, or stored in a database, which is triggered when the administrator looks at it
"Onclick ="javascript:alert('handsome boy') =====" <input type="text" value=" nirvana in fire "onclick="javascript:alert('handsome boy')">Copy the code
attacks
Non-persistent attack
All need to modify the URL address content, that is, in the page or URL to enter their own script code, not through the database, to obtain the information of the page
Reflection type: The attacker mixes the script in the URL. The server receives the URL and takes out the malicious code as a parameter, splices it into HTML and returns it. After the BROWSER parses the HTML, it executes the malicious code to obtain user information
DOM type: The attack script is written in the URL to induce the user to click the URL. If the URL is parsed, the attack script will be run. The main difference is that DOM attacks do not go through the server
Persistent attack
After the page operation is stored in the database, and then according to this will be stored after the web page sent to others for attack
Stored: A web page with an attack generated by typing some script code into the input and letting it be stored in the background.