mallka/anti-crawl 常规反爬虫安装

Anti web crawl,

  1. Feature
  2. Install
  3. How to use


  • reject dev tool
  • run a javascript command if chome headless deteactd.
  • get browser fingerprint and post to SOME URL


The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mallka/anti-crawl "dev-master"

or add

"mallka/anti-crawl": "dev-master"

to the require section of your composer.json file.

How to use

1. In view file:
<?= \mallka\anticrawl\Anti::widget([

        //the url of upload fingerprint,it will not fetch fingerprint if not set
        //run js command if chrome headless detected.default is alert 
2.Create some action for collect data
//sample action ,please create table first.

	use Yii;

	class AntiLogController extends \yii\web\Controller
		public function actionCreate()
			$model = new AntiLog();
			$model->ip = Yii::$app->request->getUserIP();
			$model->url =Yii::$app->request->getReferrer();
			$model->finger = Yii::$app->request->post('fingerPrint');
			$model->finger_time = Yii::$app->request->post('executeTime',0);
			$model->finger_detail = Yii::$app->request->post('detail',0);
			$model->user_id = Yii::$app->user->getId();


1 0
1 follower
Yii Version: 2.0
License: MIT
Category: Security
Developed by: mallka
Created on: May 27, 2020
Last updated: (not set)
Packagist Profile
Github Repository

Related Extensions