浏览器指纹反爬虫
瀏覽器指紋反爬蟲
在現(xiàn)行的網(wǎng)絡(luò)爬蟲檢測(cè)技術(shù)中,主要有以下兩大類:
- 行為檢測(cè)
- 指紋識(shí)別
行為檢測(cè)是通過分析網(wǎng)頁上用戶的操作(鼠標(biāo)的移動(dòng)、點(diǎn)擊、滾動(dòng)行為和瀏覽行為)來判斷操作者是否是機(jī)器控制的網(wǎng)絡(luò)爬蟲。
而指紋識(shí)別則是通過分析設(shè)備和瀏覽器的信息來判斷訪問者是否為網(wǎng)絡(luò)爬蟲。
除了 navigator,還有一些其它的標(biāo)志性字符串(不同的瀏覽器可能會(huì)有所不同),常見的特征串如下所示:
反指紋識(shí)別方法
- webdriver 配置
mitmproxy 篡改參數(shù)
# coding: utf-8# modify_response.py from mitmproxy import ctxdef response(flow):"""Modify response data"""if '/js/yoda.' in flow.request.url:# Screening selenium detectionfor webdriver_key in ['webdriver', '__driver_evaluate', '__webdriver_evaluate', '__selenium_evaluate','__fxdriver_evaluate', '__driver_unwrapped', '__webdriver_unwrapped','__selenium_unwrapped', '__fxdriver_unwrapped', '_Selenium_IDE_Recorder', '_selenium','calledSelenium', '_WEBDRIVER_ELEM_CACHE', 'ChromeDriverw', 'driver-evaluate','webdriver-evaluate', 'selenium-evaluate', 'webdriverCommand','webdriver-evaluate-response', '__webdriverFunc', '__webdriver_script_fn','__$webdriverAsyncExecutor', '__lastWatirAlert', '__lastWatirConfirm','__lastWatirPrompt', '$chrome_asyncScriptInfo', '$cdc_asdjflasutopfhvcZLmcfl_']:ctx.log.info('Remove "{}" from {}.'.format(webdriver_key, flow.request.url))flow.response.text = flow.response.text.replace('"{}"'.format(webdriver_key), '"NO-SUCH-ATTR"')print(webdriver_key)flow.response.text = flow.response.text.replace('t.webdriver', 'false')flow.response.text = flow.response.text.replace('ChromeDriver', '')mitmdump.exe -p Port number -s modify_response.py總結(jié)
- 上一篇: 阿里巴巴国际站询盘是什么意思?如何提高询
- 下一篇: 反浏览器指纹追踪(反浏览器指纹追踪技术)