当前位置:网站首页>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 .
边栏推荐
- QT creator source code learning note 05, how does the menu bar realize plug-in?
- Mongoose the table associated with the primary key, and automatically bring out the data of another table
- Text replacement demo
- The 2022 global software R & D technology conference was released, and world-class masters such as Turing prize winners attended
- Yyds dry goods inventory Spring Festival "make" your own fireworks
- Programming language (2)
- [sg function] lightoj Partitioning Game
- Overview of Yunxi database executor
- Recursion and recursion
- Shell script three swordsman awk
猜你喜欢

How the computer flushes the local DNS cache

Fluent learning (5) GridView

The reason why the computer runs slowly and how to solve it

Loop compensation - explanation and calculation of first-order, second-order and op amp compensation
![[Android reverse] use the DB browser to view and modify the SQLite database (copy the database file from the Android application data directory | use the DB browser tool to view the data block file)](/img/6e/3ffa91154a718b6ace6c8ca87c5995.jpg)
[Android reverse] use the DB browser to view and modify the SQLite database (copy the database file from the Android application data directory | use the DB browser tool to view the data block file)

2022.02.13

Teach you how to run two or more MySQL databases at the same time in one system

Unsafe and CAS principle

Programming language (1)

MLX90614 driver, function introduction and PEC verification
随机推荐
Go Technology Daily (2022-02-13) - Summary of experience in database storage selection
Loop compensation - explanation and calculation of first-order, second-order and op amp compensation
Niuke winter vacation training camp 4 g (enumeration optimization, Euler power reduction)
Learning methods of zynq
[issue 16] golang's one-year experience in developing Purdue Technology
Ten minutes will take you in-depth understanding of multithreading. Multithreading on lock optimization (I)
Unity shader visualizer shader graph
Current detection circuit - including op amp current scheme
[Android reverse] application data directory (files data directory | lib application built-in so dynamic library directory | databases SQLite3 database directory | cache directory)
Summary of basic knowledge of exception handling
Qtoolbutton available signal
6.2 normalization 6.2.5 third normal form (3NF)
在恒泰证券开户怎么样?安全吗?
IO flow review
Runtime. getRuntime(). totalMemory/maxMemory()
Hcip day 16 notes
URLEncoder. Encode and urldecoder Decode processing URL
What are the common computer problems and solutions
Pan Yueming helps Germany's Rochester Zodiac custom wristwatch
Scratch uses runner Py run or debug crawler