Common Web security hole -------- anti-hotlinking

1, anti-hotlinking prevent theft of things on their own services. . .

2, there is such a map on XSS services:

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<title></title>
</head>
<body>
<form action="postIndex" method="post">
        输入内容: <input type="text" name="name"> <br> <input
            type="submit">
    </form>
<img src="img/logo.PNG" alt="">
</body> 
</html>

On SatetyChain service: <img src = "http://127.0.0.1:8080/img/logo.PNG" alt = ""> quote came directly to this picture, it belongs to the Pirates of the map, how to prevent this from happening?

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<title></title>
</head>
<body>
<form action="postIndex" method="post">
        输入内容: <input type="text" name="name"> <br> <input
            type="submit">
    </form>
<img src="http://127.0.0.1:8080/img/logo.PNG" alt="">
</body> 
</html>

3, anti-hotlinking technology to achieve the above requirements, in simple terms, or by interceptor to intercept the request, view the request header Referer request record source, you can view pictures to the requested domain name, domain name, if not specified, allowed the request fails

 


127.0.0.1 8080 www.aiyuesheng.com
127.0.0.1 8081 bbs.aiyuesheng.com

C:\Windows\System32\drivers\etc\hosts

 

Guess you like

Origin www.cnblogs.com/pickKnow/p/11265785.html