程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Dare to see the series? Python font anti crawling actual combat case internship monk, continue to dig a hole

編輯:Python

️  Internship   Actual combat scene   monk

This blog continues to learn about font anti - crawling , The site involved is internship  x, The target site address can be directly searched by Baidu .

You can see that there are many in the source code on the right “ The statement ”, This contains key information .
Then follow the routine , Retrieve font related information in developer tools , But after screening , Didn't get the anti crawl font , only one  file?  There are a few possibilities .

Here is a new scene , If the judgment is not right , That can only be judged by font style and font label name . Search in the web source code  @font-face  and  myFont, Get the following figure , Here we find  file  The font appears again , It seems that the key to solving the problem has emerged .

No suffix found after downloading the file name , We can make up for one  .ttf  The suffix , Next drag to  FontCreator  in , Then look it up .![ Dare to see series ?Python The practice monk of the practical case of font anti climbing , Keep digging ](https://img-blog.csdnimg.cn/4230e0cd5c8e47f88e17d53a55503df6.png =600x) After refreshing the page twice , Get another  file  file , Check whether there is any coding change between the two .
Conclusion : Every time a font file is requested , The response obtained is unchanged .
Since there is no change , The subsequent font anti crawling actual combat coding becomes simple .

️  Internship   Actual code   monk

Parsing font files , Get encoding and characters .
from fontTools.ttLib import TTFont


font1 = TTFont('./fonts/file.ttf')
keys,values = [],[]
for k, v in font1.getBestCmap().items():
 print(k,v)

The results are as follows .
2 extra bytes in post.stringData array
120 x
57345 uni4E00
57360 uni77
57403 uni56
……

Then let's look at the data returned by the trainee monk site .
&#xf626&#xf395&#xf395-&#xf043&#xf395&#xf395

This involves the conversion of coding .
We got a coded text , As shown below .
&#xedb3&#xe4d0&#xe4d0&#xedb3&#xe12a&#xeb3d Sales practice &#xe595

Next, take a look at the text presented on the page
SaaS Software sales intern

among  &#xedb3  The corresponding is  S  character , Take another look at the encoding of this character in the font file , As shown below .

But from the results just now , I didn't get  edb3  Correlation value , But after converting the decimal code , Get the following results .

edb3  There is , Our case has also been completed .
  You are reading  【 Dream eraser 】  The blog of   Finished reading , You can praise it with a little hand   Find the error , Correct it in the direct comment area   The second part of the eraser  <font color=red>669</font>  Original blog


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved