当前位置:网站首页>JS逆向字体反爬,某供应商平台反爬实践
JS逆向字体反爬,某供应商平台反爬实践
2022-08-04 11:31:00 【InfoQ】
️ 实战场景
aHR0cHM6Ly9jbi5jaGluYS5jbg==




️ 供应商字体反爬 实战场景
font
import re
from fontTools.ttLib import TTFont
from hashlib import md5
font = TTFont('./fonts/112.woff')
font.saveXML('./112.xml')



<span class="secret">𐃎𐃏𐃏 𐃏𐃏𐃎𐃐 𐃐𐃑𐃒𐃒</span>
import re
from fontTools.ttLib import TTFont
from hashlib import md5
# font = TTFont('./fonts/112.woff')
# font.saveXML('./112.xml')
# 读取字体文件
font = TTFont('./fonts/112.woff')
# 读取 cmap
cmap = font.getBestCmap()
with open('./112.xml','r',encoding='utf8') as f:
ret = f.read()
ret = ret.replace('\n','').replace(' ','')
# print(ret)
for i in cmap:
# 查询目标数据
data = re.findall(f'<CharStringname="{cmap[i]}">(.*?)</CharString>', ret)[0]
# print(data)
# 将查询到的结果进行 md5 编码
char_md5 = md5(data.encode('utf8')).hexdigest()
print(char_md5)

边栏推荐
- God Space - the world's first Web3.0-based art agreement creative platform, broadening the boundaries of multi-art integration
- 数字知识库及考学一体化平台
- Leetcode刷题——543. 二叉树的直径、617. 合并二叉树(递归解决)
- [Flight Control Development Advanced Course 7] Crazy Shell Open Source Formation UAV - Formation Flight
- 【Qt】解决 “由于找不到Qt5Cored.dll,无法继续执行代码”(亲测有效)
- MySQL不提供数组,只能做成表吗?
- 【LeetCode】1403.非递增顺序的最小子序列
- 六石编程学:编程中的直线思维与自然思维
- 【LeetCode】653. 两数之和 IV - 输入 BST
- 数据库对象
猜你喜欢
Learn to use the basic interface of set and map
【机器学习】:如何对你的数据进行分类?
深度学习------pytorch-gpu环境搭建
【黄啊码】MySQL入门—2、使用数据定义语言(DDL)操作数据库
使用函数
The use of DDR3 (Naive) in Xilinx VIVADO (2) Read and write design
200PLC转以太网与研华webaccess modbusTCP客户端在空调机上应用配置案例
God Space - the world's first Web3.0-based art agreement creative platform, broadening the boundaries of multi-art integration
【地平线旭日X3派试用体验】从开机到点灯(第一节)
The use of DDR3 (Naive) in Xilinx VIVADO (3) simulation test
随机推荐
Oracle中对临时表空间执行shrink操作
IBM Q复制启动停止查看状态
【目标检测】YOLOv4特征提取网络——CSPDarkNet53结构解析及PyTorch实现
MySQL 45 讲 | 11 怎么给字符串字段加索引?
winform 在Datatable插入一笔数据
北京大学,新迎3位副校长!其中一人为中科院院士!
将博客搬至CSDN
Disc burning steps
什么是 DevOps?看这一篇就够了!
使用.NET简单实现一个Redis的高性能克隆版(二)
面试蚂蚁(P7)竟被MySQL难倒,奋发图强后二次面试入职蚂蚁金服
mysqldump远程备份数据库
Leetcode Brush Questions - Path Sum
Leetcode刷题——二叉搜索树相关题目(98. 验证二叉搜索树、235. 二叉搜索树的最近公共祖先、1038. 从二叉搜索树到更大和树、538. 把二叉搜索树转换为累加树)
上帝空间——全球首个基于Web3.0的艺术协议创意平台,拓宽多元艺术融合边界
IBM Q复制ALTER ADD COLUMN
职责链模式(responsibilitychain)
入门MySql表的增删查改
终于有人把分布式机器学习讲明白了
ESP8266-Arduino编程实例-MQ3酒精传感器驱动