当前位置:   article > 正文

国家税务总局全国增值税发票查验平台网站js逆向分析及全逆向算法还原_“http://inv—veri.chinatax.gov.cn/”

“http://inv—veri.chinatax.gov.cn/”

本文教程针对的是2021年7月2日时国税查验平台的js分析,其中版本号为V2.0.06_009。主要分析内容为key9和flwq39以及fplx这3个参数的算法,其中key9分为获取验证码阶段和查验阶段,算法有所区别,flwq39同理。

教程开始:

一、官方网址

国家税务总局全国增值税发票查验平台

二、请求分析

国税查验平台请求共分为2个,第一个请求获取验证码,第二个请求为输入验证码后查验数据并返回发票详细信息。

第一步:安装证书

基础:谷歌浏览器

首先需要安装证书,建议选择自动安装,在某些教程中可能选择手动安装,以便于使用ast工具挂代理找内存数据,但是这里我们采用一种新的方法来解决js逆向问题,因此那种方便用那种。

第二步:抓包

基础:谷歌浏览器+开发者工具+js基础知识

我们使用开发者工具或按F12打开谷歌浏览器的开发者工具,请注意尽量在网页加载完成后打开开发者工具,界面如下:

官方很给力,直接debug了,至于如何去掉断点,可以参考百度上的其他教程,这里给出一个办法,上图中点击数据1所处位置,使其颜色为蓝色,点击2或者点击上方的debug恢复按钮。此时,我们成功绕过了debug,但是特别注意尽量关闭其他无用软件或者网页,因为在后面的操作中,会感到特别卡顿。

我们在发票代码输入框和发票号码中输入合法的数据,并在开发者工具模块,观察所发送的请求包:

https://fpcy.anhui.chinatax.gov.cn/NWebQuery/yzmQuery?callback=jQuery11020854931324645166_1625223145135&fpdm=034012000211&fphm=12345678&r=0.28901229909781767&v=V2.0.06_009&nowtime=1625223446708&publickey=1625223446708&key9=ec213f1e1aa579511f5d58f09a01a5a2&_=1625223145136&flwq39=LdjaQwXUtzKjxpXQ%2FmD7KCBtBMP7lqfc7uBJNuxAumYpT9mjp90BloLfM4V6KKuD4GWdYCxRLLjJX9a1YrNy7Bs95NmSWQmpc1VAibkeG3HydXc0r9xsRc%2BkIsPWeHrFk3PYAP6k8tAcTJzoIdlhctD8wOUVXOUwczcMJW6WiF0%3D

在这个请求中,分为url的网址前缀部分和尾部参数,其中尾部参数如下:

  1. callback=固定值
  2. fpdm=发票代码
  3. fphm=发票号码
  4. r=随机数
  5. V=版本号
  6. nowtime=当前时间减去1分钟
  7. publickey=当前时间减去1分钟
  8. key9=加密参数
  9. _=可为固定值
  10. flwq39=加密参数

如果你观察过会发现,不同地区的发票,请求的地址不同,如这里是anhui。该请求的前缀部分在一个js文件中,如图:

但是,很不幸,当你打开这个文件时,你会发现混淆了,不过很容易发现是sojson的样子,这并不影响我们逆向,我们使用http://tool.yuanrenxue.com/decode_obfuscator这个网站可以解密这些js代码,尽管解密的代码看着很头疼,但是已经比原始的好太多了。

解密后可以得到各个地区的ip和网址以及对应的地区代码:

  1. 0: {code: "1100", sfmc: "北京", Ip: "https://fpcy.beijing.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.beijing.chinatax.gov.cn:443"}
  2. 1: {code: "1200", sfmc: "天津", Ip: "https://fpcy.tjsat.gov.cn:443/NWebQuery", address: "https://fpcy.tjsat.gov.cn:443"}
  3. 2: {code: "1300", sfmc: "河北", Ip: "https://fpcy.hebei.chinatax.gov.cn/NWebQuery", address: "https://fpcy.hebei.chinatax.gov.cn"}
  4. 3: {code: "1400", sfmc: "山西", Ip: "https://fpcy.shanxi.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.shanxi.chinatax.gov.cn:443"}
  5. 4: {code: "1500", sfmc: "内蒙古", Ip: "https://fpcy.neimenggu.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.neimenggu.chinatax.gov.cn:443"}
  6. 5: {code: "2100", sfmc: "辽宁", Ip: "https://fpcy.liaoning.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.liaoning.chinatax.gov.cn:443"}
  7. 6: {code: "2102", sfmc: "大连", Ip: "https://sbf.dalian.chinatax.gov.cn:8402/NWebQuery", address: "https://sbf.dalian.chinatax.gov.cn:8402"}
  8. 7: {code: "2200", sfmc: "吉林", Ip: "https://fpcy.jilin.chinatax.gov.cn:4432/NWebQuery", address: "https://fpcy.jilin.chinatax.gov.cn:4432"}
  9. 8: {code: "2300", sfmc: "黑龙江", Ip: "https://fpcy.heilongjiang.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.heilongjiang.chinatax.gov.cn:443"}
  10. 9: {code: "3100", sfmc: "上海", Ip: "https://fpcy.shanghai.chinatax.gov.cn:1001/NWebQuery", address: "https://fpcy.shanghai.chinatax.gov.cn:1001"}
  11. 10: {code: "3200", sfmc: "江苏", Ip: "https://fpcy.jiangsu.chinatax.gov.cn:80/NWebQuery", address: "https://fpcy.jiangsu.chinatax.gov.cn:80"}
  12. 11: {code: "3300", sfmc: "浙江", Ip: "https://fpcy.zhejiang.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.zhejiang.chinatax.gov.cn:443"}
  13. 12: {code: "3302", sfmc: "宁波", Ip: "https://fpcy.ningbo.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.ningbo.chinatax.gov.cn:443"}
  14. 13: {code: "3400", sfmc: "安徽", Ip: "https://fpcy.anhui.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.anhui.chinatax.gov .cn:443"}
  15. 14: {code: "3500", sfmc: "福建", Ip: "https://fpcy.fujian.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.fujian.chinatax.gov.cn:443"}
  16. 15: {code: "3502", sfmc: "厦门", Ip: "https://fpcy.xiamen.chinatax.gov.cn/NWebQuery", address: "https://fpcy.xiamen.chinatax.gov.cn"}
  17. 16: {code: "3600", sfmc: "江西", Ip: "https://fpcy.jiangxi.chinatax.gov.cn:82/NWebQuery", address: "https://fpcy.jiangxi.chinatax.gov.cn:82"}
  18. 17: {code: "3700", sfmc: "山东", Ip: "https://fpcy.shandong.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.shandong.chinatax.gov.cn:443"}
  19. 18: {code: "3702", sfmc: "青岛", Ip: "https://fpcy.qingdao.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.qingdao.chinatax.gov.cn:443"}
  20. 19: {code: "4100", sfmc: "河南", Ip: "https://fpcy.henan.chinatax.gov.cn/NWebQuery", address: "https://fpcy.henan.chinatax.gov.cn"}
  21. 20: {code: "4200", sfmc: "湖北", Ip: "https://fpcy.hubei.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.hubei.chinatax.gov.cn:443"}
  22. 21: {code: "4300", sfmc: "湖南", Ip: "https://fpcy.hunan.chinatax.gov.cn:8083/NWebQuery", address: "https://fpcy.hunan.chinatax.gov.cn:8083"}
  23. 22: {code: "4400", sfmc: "广东", Ip: "https://fpcy.guangdong.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.guangdong.chinatax.gov.cn:443"}
  24. 23: {code: "4403", sfmc: "深圳", Ip: "https://fpcy.shenzhen.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.shenzhen.chinatax.gov.cn:443"}
  25. 24: {code: "4500", sfmc: "广西", Ip: "https://fpcy.guangxi.chinatax.gov.cn:8200/NWebQuery", address: "https://fpcy.guangxi.chinatax.gov.cn:8200"}
  26. 25: {code: "4600", sfmc: "海南", Ip: "https://fpcy.hainan.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.hainan.chinatax.gov.cn:443"}
  27. 26: {code: "5000", sfmc: "重庆", Ip: "https://fpcy.chongqing.chinatax.gov.cn:80/NWebQuery", address: "https://fpcy.chongqing.chinatax.gov.cn:80"}
  28. 27: {code: "5100", sfmc: "四川", Ip: "https://fpcy.sichuan.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.sichuan.chinatax.gov.cn:443"}
  29. 28: {code: "5200", sfmc: "贵州", Ip: "https://fpcy.guizhou.chinatax.gov.cn:80/NWebQuery", address: "https://fpcy.guizhou.chinatax.gov.cn:80"}
  30. 29: {code: "5300", sfmc: "云南", Ip: "https://fpcy.yunnan.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.yunnan.chinatax.gov.cn:443"}
  31. 30: {code: "5400", sfmc: "西藏", Ip: "https://fpcy.xztax.gov.cn:81/NWebQuery", address: "https://fpcy.xztax.gov.cn:81"}
  32. 31: {code: "6100", sfmc: "陕西", Ip: "https://fpcy.shaanxi.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.shaanxi.chinatax.gov.cn:443"}
  33. 32: {code: "6200", sfmc: "甘肃", Ip: "https://fpcy.gansu.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.gansu.chinatax.gov.cn:443"}
  34. 33: {code: "6300", sfmc: "青海", Ip: "https://fpcy.qinghai.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.qinghai.chinatax.gov.cn:443"}
  35. 34: {code: "6400", sfmc: "宁夏", Ip: "https://fpcy.ningxia.chinatax.gov.cn:443/NWebQuery", address: "https://fpcy.ningxia.chinatax.gov.cn:443"}
  36. 35: {code: "6500", sfmc: "新疆", Ip: "https://fpcy.xj-n-tax.gov.cn:443/NWebQuery", address: "https://fpcy.xj-n-tax.gov.cn:443"}

回到抓包中,我们观察到这时发送了一个获取验证码的请求:

注意到通过分析这个url,我们发现请求来自如下图,我们注意到getyzmxx这个函数,来自eab23.js这个文件里,我们提取这个文件使用ob解密。

ob解密后的数据如下:

  1. var _0x14658c = function () {
  2. var _0x2253f1 = true;
  3. return function (_0x41c5d5, _0x508a27) {
  4. var _0x47fbda = _0x2253f1 ? function () {
  5. if (_0x508a27) {
  6. var _0x6b4e27 = _0x508a27["apply"](_0x41c5d5, arguments);
  7. _0x508a27 = null;
  8. return _0x6b4e27;
  9. }
  10. } : function () {};
  11. _0x2253f1 = false;
  12. return _0x47fbda;
  13. };
  14. }();
  15. var _0x59e564 = _0x14658c(this, function () {
  16. var _0x595419 = function () {
  17. return "dev";
  18. },
  19. _0x4c5231 = function () {
  20. return "window";
  21. };
  22. var _0x1842a8 = function () {
  23. var _0x21d015 = new RegExp("\\w+ *\\(\\) *{\\w+ *['|\"].+['|\"];? *}");
  24. return !_0x21d015["test"](_0x595419["toString"]());
  25. };
  26. var _0x113bb3 = function () {
  27. var _0x326224 = new RegExp("(\\\\[x|u](\\w){2,4})+");
  28. return _0x326224["test"](_0x4c5231["toString"]());
  29. };
  30. var _0x185d70 = function (_0x4ac461) {
  31. var _0x557ade = 0;
  32. if (_0x4ac461["indexOf"](false)) {
  33. _0x3cbd92(_0x4ac461);
  34. }
  35. };
  36. var _0x3cbd92 = function (_0x2bb9d8) {
  37. var _0x5f4806 = 3;
  38. if (_0x2bb9d8["indexOf"]("true"[3]) !== _0x5f4806) {
  39. _0x185d70(_0x2bb9d8);
  40. }
  41. };
  42. if (!_0x1842a8()) {
  43. if (!_0x113bb3()) {
  44. _0x185d70("ind\u0435xOf");
  45. } else {
  46. _0x185d70("indexOf");
  47. }
  48. } else {
  49. _0x185d70("ind\u0435xOf");
  50. }
  51. });
  52. _0x59e564();
  53. var yzmWait = 2;
  54. var retrycount = 0;
  55. $(document)["ready"](function () {
  56. $("#fpdm")["blur"](function () {
  57. retrycount = 0;
  58. });
  59. });
  60. function yzmTime(_0x5c47fb) {
  61. if (yzmWait == 0) {
  62. $("#yzm_unuse_img")["hide"]();
  63. $("#yzm_img")["show"]();
  64. yzmWait = 60;
  65. } else {
  66. if (yzmWait == 2) {
  67. $("#yzm_unuse_img")["show"]();
  68. $("#yzm_img")["hide"]();
  69. }
  70. yzmWait--;
  71. setTimeout(function () {
  72. yzmTime(_0x5c47fb);
  73. }, 1000);
  74. }
  75. }
  76. function getYzmXx() {
  77. $["pricode"]["clearA"]();
  78. show_yzm = "1";
  79. var _0x31767b = $("#fpdm")["val"]()["trim"]();
  80. var _0x4dfb9 = getSwjg(_0x31767b, 0);
  81. var _0x3297c1 = _0x4dfb9[1] + "/yzmQuery";
  82. var _0x41afd2 = showTime()["toString"]();
  83. var _0x1912a2 = $("#fpdm")["val"]()["trim"]();
  84. var _0x478041 = $("#fphm")["val"]()["trim"]();
  85. var _0x1a5014 = $("#kjje")["val"]()["trim"]();
  86. var _0x70138f = Math["random"]();
  87. var _0x1d5629 = _0x4dfb9[2];
  88. var _0x18c20a = {
  89. "fpdm": _0x1912a2,
  90. "fphm": _0x478041,
  91. "r": _0x70138f,
  92. "v": VVV,
  93. "nowtime": _0x41afd2,
  94. "area": _0x1d5629,
  95. "publickey": _0x41afd2,
  96. "key9": $["nnyd"]["yzm"](_0x1912a2, _0x478041, _0x41afd2)
  97. };
  98. $["ajaxSetup"]({
  99. "cache": false
  100. });
  101. yzmFlag = 1;
  102. $["ajax"]({
  103. "type": "post",
  104. "url": _0x3297c1,
  105. "data": _0x18c20a,
  106. "dataType": "jsonp",
  107. "jsonp": "callback",
  108. "success": function (_0x135eb2) {
  109. if (_0x135eb2["hasOwnProperty"]("data")) {
  110. _0x135eb2 = _0x135eb2["data"];
  111. _0x135eb2 = replaceStr(_0x135eb2, _0x41afd2);
  112. _0x135eb2 = Base64["decode"](_0x135eb2);
  113. _0x135eb2 = eval("(" + _0x135eb2 + ")");
  114. }
  115. delayFlag = "1";
  116. var _0x2651d3 = _0x135eb2["key1"];
  117. var _0x1a96a9 = _0x135eb2["key2"];
  118. var _0x2b0c56 = _0x135eb2["key3"];
  119. var _0x1769c2 = _0x135eb2["key4"];
  120. var _0x483079 = _0x135eb2["key5"];
  121. var _0x2e8ee0 = _0x135eb2["key6"];
  122. if (_0x483079 == "2") {
  123. oldweb = 2;
  124. } else {
  125. if (_0x483079 == "1") {
  126. oldweb = 1;
  127. }
  128. }
  129. if (_0x2651d3 == "003") {
  130. jAlert("\u9A8C\u8BC1\u7801\u8BF7\u6C42\u6B21\u6570\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF71\u5206\u949F\u540E\u518D\u8BD5\uFF01", "\u8B66\u544A");
  131. $("#yzm_img")["hide"]();
  132. } else {
  133. if (_0x2651d3 == "005") {
  134. jAlert("\u975E\u6CD5\u8BF7\u6C42!", "\u8B66\u544A");
  135. } else {
  136. if (_0x2651d3 == "010") {
  137. jAlert("\u7F51\u7EDC\u8D85\u65F6\uFF0C\u8BF7\u91CD\u8BD5\uFF01(01)", "\u8B66\u544A");
  138. } else {
  139. if (_0x2651d3 == "fpdmerr") {
  140. jAlert("\u8BF7\u8F93\u5165\u5408\u6CD5\u53D1\u7968\u4EE3\u7801!", "\u8B66\u544A");
  141. } else {
  142. if (_0x2651d3 == "024") {
  143. jAlert("24\u5C0F\u65F6\u5185\u9A8C\u8BC1\u7801\u8BF7\u6C42\u592A\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF01", "\u8B66\u544A");
  144. $("#yzm_img")["hide"]();
  145. } else {
  146. if (_0x2651d3 == "016") {
  147. jAlert("\u670D\u52A1\u5668\u63A5\u6536\u7684\u8BF7\u6C42\u592A\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\uFF01", "\u8B66\u544A");
  148. $("#yzm_img")["hide"]();
  149. } else {
  150. if (_0x2651d3 == "020") {
  151. jAlert("\u7531\u4E8E\u67E5\u9A8C\u884C\u4E3A\u5F02\u5E38\uFF0C\u6D89\u5ACC\u8FDD\u89C4\uFF0C\u5F53\u524D\u65E0\u6CD5\u4F7F\u7528\u67E5\u9A8C\u670D\u52A1\uFF01", "\u63D0\u793A");
  152. } else {
  153. if (_0x2651d3 == "errv") {
  154. jAlert("\u5F53\u524D\u9875\u9762\u7248\u672C\u8F83\u4F4E\uFF0C\u8BF7\u6309CTRL-F5\u5237\u65B0\u9875\u9762\uFF01", "\u63D0\u793A");
  155. } else {
  156. if (_0x2651d3 != "") {
  157. setTimeout(function () {
  158. $("#yzm_img")["attr"]("src", "data:image/png;base64," + _0x2651d3);
  159. $("#yzm_unuse_img")["attr"]("src", "data:image/png;base64," + _0x2651d3);
  160. if (_0x1769c2 == "00") {
  161. $("#yzminfo")["text"]("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\u6587\u5B57");
  162. } else {
  163. if (_0x1769c2 == "01") {
  164. $("#yzminfo")["html"]("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\u56FE\u7247\u4E2D<font color=\"red\" size=\"4\" style=\"background:#C0C0C0\">\u7EA2\u8272</font>\u6587\u5B57");
  165. } else {
  166. if (_0x1769c2 == "02") {
  167. $("#yzminfo")["html"]("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\u56FE\u7247\u4E2D<font color=\"yellow\" size=\"4\" style=\"background:#C0C0C0\">\u9EC4\u8272</font>\u6587\u5B57");
  168. } else {
  169. if (_0x1769c2 == "03") {
  170. $("#yzminfo")["html"]("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801\u56FE\u7247\u4E2D<font color=\"blue\" size=\"4\" style=\"background:#C0C0C0\">\u84DD\u8272</font>\u6587\u5B57");
  171. }
  172. }
  173. }
  174. }
  175. yzmSj = _0x1a96a9;
  176. jmmy = _0x2b0c56;
  177. key6 = _0x2e8ee0;
  178. }, 500);
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. },
  189. "timeout": 5000,
  190. "error": function (_0x11ade1, _0x2c42b8, _0x3a7f30) {
  191. if (retrycount == 9) {
  192. jAlert("\u7CFB\u7EDF\u7E41\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5!", "\u63D0\u793A");
  193. } else {
  194. retrycount = retrycount + 1;
  195. getYzmXx();
  196. }
  197. }
  198. });
  199. yzmWait = 2;
  200. yzmTime($("#yzm_img"));
  201. }
  202. function showTime() {
  203. var _0x229b47 = new Date();
  204. var _0x2be691 = _0x229b47["getTime"]();
  205. return _0x2be691;
  206. }

我们注意到key9值的位置,

$["nnyd"]["yzm"](_0x1912a2, _0x478041, _0x41afd2)

这里需要知道$["nnyd"]["yzm"]的具体函数,分析后如下:

  1. _0x4abed0["prototype"]["yzm"] = function (_0x4a04f9, _0x1fcc0a, _0x4473d7) {
  2. var _0x3a01ad = new Array(3);
  3. _0x3a01ad[0] = _0x4a04f9 + _0x1fcc0a;
  4. _0x3a01ad[1] = _0x4a04f9 + _0x1fcc0a + _0x1fcc0a + _0x4a04f9;
  5. _0x3a01ad[2] = _0x4a04f9 + _0x4a04f9 + _0x1fcc0a + _0x4a04f9 + _0x1fcc0a + _0x4a04f9;
  6. var _0x155fec = _0x3a01ad[0]["substring"](0, 8);
  7. var _0x32d768 = _0x3a01ad[0]["substring"](8);
  8. var _0x559889 = _0x1e3a12(_0x155fec);
  9. var _0x5a173e = _0x559889["length"];
  10. for (var _0x2e3884 = 0; _0x2e3884 < _0x5a173e; _0x2e3884++) {
  11. for (var _0x39a07a = _0x2e3884 + 1; _0x39a07a < _0x5a173e; _0x39a07a++) {
  12. if (_0x559889[_0x2e3884] > _0x559889[_0x39a07a]) {
  13. _0x3f015b(_0x559889, _0x2e3884, _0x39a07a);
  14. }
  15. }
  16. }
  17. _0x155fec = _0x328421(_0x559889);
  18. var _0x3cf5d7 = _0x1e3a12(_0x32d768);
  19. var _0x5a173e = _0x3cf5d7["length"];
  20. var _0x38743f = 0;
  21. for (var _0x2e3884 = 0; _0x2e3884 < _0x5a173e; _0x2e3884++) {
  22. _0x38743f = _0x2e3884;
  23. for (var _0x39a07a = _0x2e3884 + 1; _0x39a07a < _0x5a173e; _0x39a07a++) {
  24. if (_0x3cf5d7[_0x38743f] > _0x3cf5d7[_0x39a07a]) {
  25. _0x38743f = _0x39a07a;
  26. }
  27. }
  28. _0x3f015b(_0x3cf5d7, _0x2e3884, _0x38743f);
  29. }
  30. _0x32d768 = _0x328421(_0x3cf5d7);
  31. var _0x8300db = _0x205ff1["encrypt"](_0x155fec) + _0x32d768;
  32. var _0x15339a = _0x3a01ad[1]["substring"](0, 9);
  33. var _0x3c7f1d = _0x3a01ad[1]["substring"](9, 17);
  34. var _0x1dd08a = _0x3a01ad[1]["substring"](17);
  35. var _0x591ade = _0x1e3a12(_0x15339a);
  36. var _0x5a173e = _0x591ade["length"];
  37. var _0x41c5e3 = 0;
  38. for (var _0x2e3884 = 0; _0x2e3884 < _0x5a173e; _0x2e3884++) {
  39. _0x41c5e3 = _0x2e3884;
  40. for (var _0x39a07a = _0x2e3884 + 1; _0x39a07a < _0x5a173e; _0x39a07a++) {
  41. if (_0x591ade[_0x41c5e3] > _0x591ade[_0x39a07a]) {
  42. _0x41c5e3 = _0x39a07a;
  43. }
  44. }
  45. _0x3f015b(_0x591ade, _0x2e3884, _0x41c5e3);
  46. }
  47. _0x15339a = _0x328421(_0x591ade);
  48. var _0x185cf9 = _0x1e3a12(_0x3c7f1d);
  49. var _0x2fa209 = _0x185cf9["length"];
  50. _0x3ad848["yzmdelay"](_0x4a04f9, _0x1fcc0a, _0x4473d7);
  51. console["log"]("\u9A8C\u8BC1\u7801\u9ED8\u8BA4\u5EF6\u65F6:312");
  52. for (var _0x2e3884 = 0; _0x2e3884 < _0x2fa209; _0x2e3884++) {
  53. for (var _0x39a07a = _0x2e3884 + 1; _0x39a07a < _0x2fa209; _0x39a07a++) {
  54. if (_0x185cf9[_0x2e3884] > _0x185cf9[_0x39a07a]) {
  55. _0x3f015b(_0x185cf9, _0x2e3884, _0x39a07a);
  56. }
  57. }
  58. }
  59. _0x3c7f1d = _0x328421(_0x185cf9);
  60. var _0x30d382 = _0x1e3a12(_0x1dd08a);
  61. var _0x3a8185 = _0x30d382["length"];
  62. for (var _0x2e3884 = 1; _0x2e3884 < _0x3a8185; _0x2e3884++) {
  63. for (var _0x39a07a = _0x2e3884; _0x39a07a > 0; _0x39a07a--) {
  64. if (_0x30d382[_0x39a07a] < _0x30d382[_0x39a07a - 1]) {
  65. _0x3f015b(_0x30d382, _0x39a07a, _0x39a07a - 1);
  66. } else {
  67. break;
  68. }
  69. }
  70. }
  71. _

这里只展示了部分数据,同时注意到一个参数,后面用得到:

0x5ecc18["setPublicKey"]("MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCjrcnzPya+QS6i5QND2EsIcrsP3/NRwgcYoaNyowpuIzQGDIySfhifm/+j41vJqwKd0D5Otjn6lF5mpUz0zvgMlVco5YytXIbBR8n7WfJ/1W4kTWYr9PM/sT3P23fS3xt13NHln7XgEjP7juv6z52OQOKxYKL/LFxoLkhQpUydWQIBEQ==");

如果有经验,你会知道可能和RSA加密相关,事实也是如此,上面已经对key9的算法位置分析清楚了,下面对flwq39进行分析,实际上,flwq39也是在这个文件中,我使用vscode对解密后的js代码进行了格式化,并查找了flwq39这个关键字,发现如图:

因此,我们继续分析会发现该参数是在请求前拼接完成的,并且关键字本身被替换了:

 反向找到调用的函数就会发现最终是调用了RSA加密算法,其中PublicKey就是

MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCjrcnzPya+QS6i5QND2EsIcrsP3/NRwgcYoaNyowpuIzQGDIySfhifm/+j41vJqwKd0D5Otjn6lF5mpUz0zvgMlVco5YytXIbBR8n7WfJ/1W4kTWYr9PM/sT3P23fS3xt13NHln7XgEjP7juv6z52OQOKxYKL/LFxoLkhQpUydWQIBEQ==

在验证码获取后返回包如下:

jQuery11020854931324645166_1625223145135({"key1":"iVBORw0KGgoAAAANSUhEUgAAAHgAAAAyCAIAAAAYxYiPAAARwElEQVR42uVbCVgUV7auXmi6AaFl32WJIIhIgyyCuCHigiiICAqIyipIBFeQuKCSRIlGY9S4RpNRdKJmIqNoNDJuUaPPjGYM0RgUcUE0cRl9L1Fm3t99oCy6m2ZrzNbf/fq7dftW1b3/Pec//7lVzVy88fXvvTx54/02n+uwerFWxpDfuU5t+9PD3ajCtPMGX1Wdac/pU7J+6qBiJ/BpSbectGoUzX0s/I3aPx6mnShbvLCY8Cjx2M3yVwCx04rR2l2MeYkX/sswvwjFFbZ9O27JtQA0ypHqw3GPY6V1RimPkk/ePK70a/Sy86/GijfNe9LaU2ZNvgqU1w3fjvrx7kmPJWYdC7T38Mpm0czqvZcq/w4Qq+1w8FZZ1JMoaZ0062HmlzdPdjRRVMh2cQ+vpd1s7RUyMx8A5ZJ+xagviP9qbtI3B3xnPBMZtn9stmfyO8SiueXvt/aF/3u48Qvj3J9ylLibbuYquqJmBD+f1Dx060lLWjvbaRELNXf4X5HB33rPQ2V+wnkgjnLJYfBnAQV1PMGMlMq2QbwxfXZbqCN/4aC2wX3J/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rfhb8epux0Omep31835j+G7XoB6dPaoUo4gIrfx8Wzfviyp8q3C1LWvEH5OiqyV6/zXB35ljz7FG6dl4brvz/c2htg3097vIAAAAASUVORK5CYII=","key2":"2021-07-02 18:34:48","key3":"43017c78ec891a4b9406501694f0b479","key4":"01","key5":"2","key6":"402887f17a53027c017a66d4d62d72d0"})

 其中key1是经过base64编码的图片数据,key2是验证码的时间,另外注意到key3和key4及key6。

其中key4分为4种情况分别为输入全部、黄色、红色、蓝色,对应00,01,02,03。余下的参数在验证阶段用到。

同理,在查验阶段,请求如下:

https://fpcy.anhui.chinatax.gov.cn/NWebQuery/vatQuery?callback=jQuery11020854931324645166_1625223145135&key1=034012000211&key2=12345678&key3=20210702&key4=123456&fplx=10&yzm=MK&yzmSj=2021-07-02+18%3A34%3A48&index=43017c78ec891a4b9406501694f0b479&key6=402887f17a53027c017a66d4d62d72d0&publickey=2021-07-02+18%3A34%3A48&key9=ac558f9ae05a94c21dc504f5d8882b9d&_=1625223145137&flwq39=Ky8pYUqln7zaEZcxF9XZw3fAsiOM%2F92RmTxy%2BNAtDo4f1h3c1yHQJZNESl5Nz9Xq5Mu7bEeBkFlPgerOBnR1pnLviLn4WLkMTtzsLy%2BMe2wPu%2B%2FFaiszckIGS%2F1Z5YZ4zusosj68YLZ0hRk53UWbrWz9xg%2BC3XRGwEWyqbzg0XE%3D

这里注意到

  1. key1=发票代码
  2. key2=发票号码
  3. key3=发票日期
  4. key4=校验码或者不含税的金额
  5. fplx=发票类型,一个函数
  6. yzm=验证码
  7. yzmsj=获取验证码请求的返回包里的key2
  8. index=获取验证码请求的返回包里的Key3
  9. key6=获取验证码请求的返回包里的Key6
  10. publickey=验证码时间
  11. key9=加密参数
  12. flwq39=加密参数

这里的key9和flwq39在

$["nnyd"]["cy"]

这个对应的函数中,key9和flwq39算法和上面的类似。

此外注意到fplx这种参数,也在这几个js文件中,这里给出具体的函数名:

  1. var code=["144031539110", "131001570151", "133011501118", "111001571071"];
  2. function alxd(a) {
  3. var b;
  4. var c = "99";
  5. if (a.length == 12) {
  6. b = a.substring(7, 8);
  7. for (var i = 0; i < code.length; i++) {
  8. if (a == code[i]) {
  9. c = "10";
  10. break
  11. }
  12. }
  13. if (c == "99") {
  14. if (a.charAt(0) == '0' && a.substring(10, 12) == '11') {
  15. c = "10"
  16. }
  17. if (a.charAt(0) == '0' && (a.substring(10, 12) == '04' || a.substring(10, 12) == '05')) {
  18. c = "04"
  19. }
  20. if (a.charAt(0) == '0' && (a.substring(10, 12) == '06' || a.substring(10, 12) == '07')) {
  21. c = "11"
  22. }
  23. if (a.charAt(0) == '0' && a.substring(10, 12) == '12') {
  24. c = "14"
  25. }
  26. }
  27. if (c == "99") {
  28. if (a.substring(10, 12) == '17' && a.charAt(0) == '0') {
  29. c = "15"
  30. }
  31. if (c == "99" && b == 2 && a.charAt(0) != '0') {
  32. c = "03"
  33. }
  34. }
  35. } else if (a.length == 10) {
  36. b = a.substring(7, 8);
  37. if (b == 1 || b == 5) {
  38. c = "01"
  39. } else if (b == 6 || b == 3) {
  40. c = "04"
  41. } else if (b == 7 || b == 2) {
  42. c = "02"
  43. }
  44. }
  45. return c
  46. }

通过使用php的v8js拓展,我们可以实现接口编写:

二者结果一致。

至此,全部参数已经解密部分完毕。

第三步,算法的完全还原,脱离js环境,这里我使用C#实现算法还原和脱离

首先,我们需要知道的是在核心的算法中,源代码使用了ob进行了混淆,我们使用第三方软件进行初次还原时,也只能还原一部分,核心的内容基本会被还原,但是生成的代码还是无法完全被理解阅读,基于此,需要二次还原,这里注意到Ob混淆的核心思想,是一个大数组和若干个解密函数,后续的代码里不断的调用解密函数进行解密。

设计如下:通过分析可以注意到解密函数的前缀是_开头的,后续是)]或其他的组合,因此,我们需要使用提取函数名,在调用时,才能知道那些函数可以还原,同时在提取时也随同获取调用的参数,如果参数中包含变量,则直接忽略,并在调用成功后进行替换。

  1. string[] ret = getBValueT(djm, "_", "\\)");
  2. if (ret != null && ret.Count() > 0)
  3. {
  4. foreach (string s in ret)
  5. {
  6. if (s.IndexOf("=") == -1 && s.IndexOf(":") == -1 && s.IndexOf(",") != -1)
  7. {
  8. listBox1.Items.Add("_" + s + ")");
  9. listBox1.Items.Add("_" + s + "))");
  10. File.AppendAllText("function.txt", "_0x" + s + ")" + ";\r\n");
  11. }
  12. }
  13. }
  14. //第二种情况
  15. ret = getBValueT(djm, "_", "\\]");
  16. if (ret != null && ret.Count() > 0)
  17. {
  18. foreach (string s in ret)
  19. {
  20. if (s.IndexOf(",") != -1)
  21. {
  22. listBox1.Items.Add("_" + s + "]");
  23. listBox1.Items.Add("_" + s + "");
  24. File.AppendAllText("function.txt", "_" + s + ")" + ";\r\n");
  25. }
  26. }
  27. }
  28. //第三种情况
  29. ret = getBValueT(djm, "\\[_", "\\]");
  30. if (ret != null && ret.Count() > 0)
  31. {
  32. foreach (string s in ret)
  33. {
  34. if (s.IndexOf(",") != -1)
  35. {
  36. listBox1.Items.Add("[_" + s + "]");
  37. listBox1.Items.Add("_" + s + "");
  38. File.AppendAllText("function.txt", "_" + s + ")" + ";\r\n");
  39. }
  40. }
  41. }
  42. //第四种情况
  43. ret = getBValueT(djm, "\\(_", "\\)");
  44. if (ret != null && ret.Count() > 0)
  45. {
  46. foreach (string s in ret)
  47. {
  48. if (s.IndexOf(",") != -1)
  49. {
  50. listBox1.Items.Add("(_" + s + ")");
  51. listBox1.Items.Add("(_" + s + "))");
  52. File.AppendAllText("function.txt", "_" + s + ")" + ";\r\n");
  53. }
  54. }
  55. // label3.Text = "匹配到" + listBox1.Items.Count + "个函数";
  56. }
  1. try
  2. {
  3. List<string> ret = new List<string>();
  4. Regex regex = new Regex("(?<=(" + sStr + "))0x[0-9a-z]{4,6}[\\[|\\(][.\\s\\S]*?(?=(" + eStr + "))", RegexOptions.Singleline|RegexOptions.Multiline);
  5. MatchCollection mc = regex.Matches(str);
  6. for (int i = 0; i < mc.Count; i++)
  7. {
  8. ret.Add(mc[i].Value);
  9. }
  10. return ret.ToArray();
  11. }
  12. catch
  13. {
  14. return new string[] { };
  15. }

 通过上述操作,我们就能最大程度还原出原始的代码段。

接着,彻底逆向还原使用其他语言改写,如果你看过本文,并对相关js有分析,你大概会知道,核心部分就是涉及几个加密算法,如md5和移位的一些操作。但其核心的算法如下:

第一个是Gen函数

第二个是key9

 其他的类似。部分代码如下图:


 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/389922
推荐阅读
相关标签
  

闽ICP备14008679号