当前位置:网站首页>猜JWT关键字
猜JWT关键字
2022-07-24 17:59:00 【划水小将军】
- 确定加密方式
- 使用的包(依赖)[authlib.jose,auth0.jwt]
- 破解sercet
写着玩的,没有什么价值,成功就和彩票一样,记录一下;
就是靠猜,哈哈哈~~
python
''' @Author: Jeff.zheng @Date : 2022/4/22 @Desc : '''
from authlib.jose import jwt
def bruteforce(token):
#这里是秘钥,可以挨着试,成功极低
easykeys = ["sercet1", "sercet2", "sercet3", "sercet5"]
for easykey in easykeys:
try:
jwt.decode(token.encode(encoding='utf-8'), easykey)
print("秘钥:", easykey)
except Exception as e:
pass
print("没有匹配到秘钥")
if __name__ == '__main__':
token = "token"
bruteforce(token)
java代码
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
/** * @author: Jeff.zheng * @description: * @date: 2022/7/20 15:02 * @version: 1.0.0 */
public class TestToken {
public static String token ="token";//这里放要破解的token
public static void main(String[] args) {
String [] mykeys = {
"sercet1","sercet2","sercet3","sercet4" };//这里放可能的秘钥
for (String mykey :mykeys ) {
if(forceToken(mykey)){
System.out.println("成功,key=》"+mykey);//成功的key
}else {
System.out.println("失败,key=》"+mykey);//失败的key
}
}
}
static Boolean forceToken(String secrete){
try {
JWTVerifier jwtVerifier = JWT.require(Algorithm.HMAC256(secrete)).build();
DecodedJWT verify = null;
verify = jwtVerifier.verify(token);
return true;
}catch (Exception e){
return false;
}
}
}
边栏推荐
- C语言自定义类型 — 枚举
- Getaverse, a distant bridge to Web3
- 213. 打家劫舍 II-动态规划
- Class bytecode file
- 船新 IDEA 2022.2 正式发布,新特性真香!
- C language programming training topics: K characters in left-handed string, little Lele and Euclidean, printing arrow pattern, civil servant interview, poplar matrix
- 0630~职业素养课
- Three ways of redis cluster
- awk从入门到入土(17)awk多行写法
- Awk from entry to earth (17) awk multiline writing
猜你喜欢

0625~<config>-<bus>

Interview assault 66: what is the difference between request forwarding and request redirection?

es(1)

C语言自定义类型讲解 — 联合体

Shengxin commonly used analysis graphics drawing 02 -- unlock the essence of volcano map!

生信常用分析图形绘制02 -- 解锁火山图真谛!

700. Search DFS method in binary search tree

Tensorflow introductory tutorial (38) -- V2 net

Internship report 1 - face 3D reconstruction method

Laravel笔记-用户登录时密码进行RSA加密(提高系统安全性)
随机推荐
Gan Development Series II (pggan, Singan)
What are the pitfalls from single architecture to distributed architecture?
1688/ Alibaba searches new product data by keyword API instructions
去不图床容量兑换
Codeforces Round #794 (Div. 2)(A.B.C)
Has polardb for PostgreSQL entered the list of Xinchuang database?
使用Prometheus+Grafana监控MySQL性能指标
Laravel notes - RSA encryption of user login password (improve system security)
0614~ holiday self study
C language programming training topics: K characters in left-handed string, little Lele and Euclidean, printing arrow pattern, civil servant interview, poplar matrix
Use Matplotlib to simulate linear regression
Can CSC open an account for domestic futures? Is it safe?
Win10 super good-looking mouse theme, you also try it
还在从零开始搭建项目?这款升级版快速开发脚手架值得一试!
深入解析著名的阿里云Log4j 漏洞
0629~SaaS平台设计~全局异常处理
Make good use of these seven tips in code review, and it is easy to establish your opposition alliance
mac数据库管理软件Navicat Premium Essentials Mac
1688/阿里巴巴按关键字搜索新品数据 API 使用说明
SV强制类型转换和常数