数据包如下 POSThttps://osg-service.sgcc.com.cn:18600/osg-sfan0001/member/c6/f01 HTTP/1.1 version: 1.0 sr: h: y: 20200210160231 t: sh636c02a78ed7407082ebb9fa88a82d89 X-Bmob-Application-Id:edf3cbd1df8afb4bd183e0d18b7ea9b4 X-Bmob-REST-API-Key:ededa5af193d25754a58f325f240a398 UserId: c27e9243bf044a0c9afa9741cecf7044 timeStamp: 20200210160231555868236 AppGuid:000000005a18432c75343a540033c5870000000020200210160222977880 AppGuidNew:000000005a18432c75343a540033c5870000000020200210160231566501 wsgwType: android Content-Type: application/json;charset=utf-8 Content-Length: 516 Host: osg-service.sgcc.com.cn:18600 Connection: Keep-Alive Accept-Encoding: gzip User-Agent: okhttp/3.10.0 {"wsgw_sm2_encrypt":"~04b93cf63b3d0fb5546be021aae1df876394d5e57b274f680aa862a8b46f605f8caf42edc733bccc27b70c9aa539b985c65155f6873e158c030c31cfa3986443bdbe52c36628d7e992b7a868ec620f12a8f33c4b5441ffe292e67145f989fadbe4708d69b23af641c69f8da0cdc1d2eb515dc05fa2dcc734d53fd88b7f67693f828472bc6b1ed85b5d61cdac92c33e36272da04b7f68a13ff2aadbfb0aa28d15a46c37e5af3b69f74ee18e412c36765df0ea35532697f3e6542b57eb60f366d8b9b8cd60a13e86537fab98b73f7d813934","_md5":"1de012f68821b8615c5941b112de4db77bc94f3db2e6e68cc0628afb555eda70"} 发现两个可用的信息 wsgw_sm2_encrypt _md5 第一个参数 wsgw_sm2_encrypt 其实已经告诉我们了加密方式 sm2 国密SM2算法,非对称加密,和RSA类似,也是有公钥和私钥 还有个_md5 但是不像md5 老规矩脱裤定位代码 SM2的公钥就拿到了 044那一段 看看_md5 这一看函数名都出来了 国密SM3算法 摘要的算法 类似sha256 下面就差知道这个_md5参数传参了 动态调试了一下,结果出来了,上面的加密原文,也一样,动态调试一下,结果都有 SM3({"wsgw_sm2_encrypt":"~04b93cf63b3d0fb5546be021aae1df876394d5e57b274f680aa862a8b46f605f8caf42edc733bccc27b70c9aa539b985c65155f6873e158c030c31cfa3986443bdbe52c36628d7e992b7a868ec620f12a8f33c4b5441ffe292e67145f989fadbe4708d69b23af641c69f8da0cdc1d2eb515dc05fa2dcc734d53fd88b7f67693f828472bc6b1ed85b5d61cdac92c33e36272da04b7f68a13ff2aadbfb0aa28d15a46c37e5af3b69f74ee18e412c36765df0ea35532697f3e6542b57eb60f366d8b9b8cd60a13e86537fab98b73f7d813934","_md5":"1de012f68821b8615c5941b112de4db77bc94f3db2e6e68cc0628afb555eda70"}wsgwToken) 加密原文{"wsgw_sm2_encrypt":"~04b93cf63b3d0fb5546be021aae1df876394d5e57b274f680aa862a8b46f605f8caf42edc733bccc27b70c9aa539b985c65155f6873e158c030c31cfa3986443bdbe52c36628d7e992b7a868ec620f12a8f33c4b5441ffe292e67145f989fadbe4708d69b23af641c69f8da0cdc1d2eb515dc05fa2dcc734d53fd88b7f67693f828472bc6b1ed85b5d61cdac92c33e36272da04b7f68a13ff2aadbfb0aa28d15a46c37e5af3b69f74ee18e412c36765df0ea35532697f3e6542b57eb60f366d8b9b8cd60a13e86537fab98b73f7d813934","_md5":"1de012f68821b8615c5941b112de4db77bc94f3db2e6e68cc0628afb555eda70"}wsgwToken wsgwToken是登录token,不登录的时候,就填wsgwToken 收工了 如果模拟请求的话,这套算法不太好找,毕竟网络上面能找到的信息不多,关于这套 算法,可谓是定位算法三分钟,改JS算法三天
JS算法这里就不给了,做个简单的分析,做个一般的逆向思路
补充内容 (2020-3-11 10:33):
好像不能编辑帖子了 |