Author: Geoffrey Njogu
Description
This file was found among some files marked confidential but my pdf reader cannot read it, maybe yours can.You can download the file from here.
2024年12月19日大约 2 分钟
Author: Geoffrey Njogu
This file was found among some files marked confidential but my pdf reader cannot read it, maybe yours can.You can download the file from here.
ssh username@adress -p password yes
通过抓包我们了解了本体JWT的构造:
有效载荷:
发现有一本flag书,但是只有admin才可以查看
然后分析java代码
利用grep递归搜索JWT可以发现
JwtService.java是关键的
随后看到在这里进行JWT的密钥创建,需要研究密钥的生成规则
随后查看secretGenerator类的源代码
发现他会从本地读取密钥,如果本地密钥不存在就会使用固定字符串1234
还不知道userId和email字段生成规则
随后grep搜索admin的,发现adminRole(admin角色)的java文件,浏览源代码可以发现userid越大,权限越高
adminrole.java::
在grep中还发现了setEmail("字段")
推测是email的值为admin
构造JWT
最后再修改本地存储中的JWT——auth-token和token-payload即可