当前位置:网站首页>How to prevent malicious crawling of information by one-to-one live broadcast source server
How to prevent malicious crawling of information by one-to-one live broadcast source server
2022-07-03 23:06:00 【Cloudleopard network technology】
In the process of running the one-to-one live broadcast source code , The generated data will be stored on the server , For any platform , Data security is the problem that needs to be solved most in data storage . Except for malicious access 、 Domain name hijacking and other data problems , Some crawlers will crawl website information maliciously , At this time, it is necessary to intercept , Prevent data leakage .
The one-to-one live broadcast source code can be configured on demand nignx The environment and Apache Environmental Science , Achieve interception , The specific operation steps are as follows :
One 、Nginx Environment :
1. create profile
For example, enter nginx Install under directory conf Catalog , establish : test…conf
The contents are as follows :
# prohibit Scrapy Wait for the tool to grab if ($http_user_agent ~* (Scrapy|Curl|HttpClient)) {
return 403;
}
# Prohibit designation UA And UA Empty visit
if ($http_user_agent ~ "WinHttp|WebZIP|FetchURL|node-superagent|java/|
FeedDemon|Jullo|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|
CrawlDaddy|Java|Feedly|Apache-HttpAsyncClient|UniversalFeedParser|ApacheBench|
Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|
lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|BOT/0.1|
YandexBot|FlightDeckReports|Linguee Bot|^$" ) {
return 403;
}
2. Import the configuration file created above into the website configuration file
Include test.conf;
3. restart nginx Services take effect
systemctl restart nginx
Two 、apache Environment
1、 modify httpd.conf The configuration file
Add the following code , restart Apache take effect
Shell
DocumentRoot /home/wwwroot/xxx
SetEnvIfNoCase User–Agent “.*(FeedDemon|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|Feedly|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms)” BADBOT
Orderallow,deny
Allow fromall
deny fromenv=BADBOT
3、 ... and 、 test
1、 Use curl -A Simulate grabbing , such as :
curl -I -A 'Spider' www.test888.cn
give the result as follows :
[[email protected]]# curl -I -A 'Spider' www.test888.cn
HTTP/1.1 403 Forbidden
Server: nginx/1.12.0
Date: Wed, 24 Apr 2021 11:35:21 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive
above , It is the one-to-one live source code that intercepts the content of information crawled by crawlers , Preventing malicious crawling is just one of the security strategies to ensure data security , To learn more about security policies , You can pay attention to the following content .
Statement : The above content is original by cloudleopard technology , Without the author's consent , Prohibited reproduced , Otherwise, relevant legal liability will be investigated .
边栏推荐
- finalize finalization finally final
- LeetCode 540. A single element in an ordered array
- Why should enterprises do more application activities?
- How to solve the problem of requiring a password when accessing your network neighborhood on your computer
- Creation of the template of the password management software keepassdx
- Weekly leetcode - nc9/nc56/nc89/nc126/nc69/nc120
- Exclusive download! Alibaba cloud native brings 10 + technical experts to bring "new possibilities of cloud native and cloud future"
- What are the common computer problems and solutions
- [sg function] lightoj Partitioning Game
- Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
猜你喜欢
Gorilla/mux framework (RK boot): add tracing Middleware
Scratch uses runner Py run or debug crawler
Schematic diagram of crystal oscillator clock and PCB Design Guide
3 environment construction -standalone
Buuctf, web:[geek challenge 2019] buyflag
Interesting 10 CMD commands
[flax high frequency question] leetcode 426 Convert binary search tree to sorted double linked list
X Opencv feature point detection and matching
[network security] what is emergency response? What indicators should you pay attention to in emergency response?
Some 5000+ likes, the development notes of a director of cosmic factory, leaked
随机推荐
Opengauss database log management guide
Codeforces Round #768 (Div. 1)(A-C)
[sg function] 2021 Niuke winter vacation training camp 6 h. winter messenger 2
How to quickly build high availability of service discovery
[template summary] - binary search tree BST - Basics
Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
Ten minutes will take you in-depth understanding of multithreading. Multithreading on lock optimization (I)
Hcip day 12 notes
Scratch uses runner Py run or debug crawler
string
Current detection circuit - including op amp current scheme
Recursion and recursion
Pandaoxi's video
Arc135 partial solution
Creation of the template of the password management software keepassdx
To rotate 90 degrees clockwise and modify the video format
Interpretation of corolla sub low configuration, three cylinder power configuration, CVT fuel saving and smooth, safety configuration is in place
What are the common computer problems and solutions
Blue Bridge Cup -- Mason prime
Qtoolbutton - menu and popup mode