厂长预处理.js 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. rule_fetch_params.headers.Cookie = '68148872828e9f4d64e7a296f6c6b6d7=5429da9a54375db451f7f9e4f16ce0ea';
  2. let new_host = 'https://czspp.com';
  3. let new_html = request(new_host);
  4. if(/正在进行人机识别/.test(new_html)){
  5. let new_src = pd(new_html,'script&&src',new_host);
  6. log(new_src);
  7. let hhtml = request(new_src,{withHeaders:true});
  8. let json = JSON.parse(hhtml);
  9. let html = json.body;
  10. let key = html.match(new RegExp('var key=\"(.*?)\"'))[1];
  11. let avalue = html.match(new RegExp('value=\"(.*?)\"'))[1];
  12. // log(html.indexOf('var key='));
  13. // log(key);
  14. // log(avalue);
  15. let c = ''
  16. for(let i=0;i<avalue.length;i++){
  17. let a = avalue[i];
  18. let b = a.charCodeAt();
  19. c += b;
  20. }
  21. let value = md5(c);
  22. log(value);
  23. let yz_url = 'https://czspp.com/a20be899_96a6_40b2_88ba_32f1f75f1552_yanzheng_ip.php?type=96c4e20a0e951f471d32dae103e83881&key='+key+'&value='+value;
  24. log(yz_url);
  25. hhtml = request(yz_url,{withHeaders:true});
  26. json = JSON.parse(hhtml);
  27. let setCk = Object.keys(json).find(it=>it.toLowerCase()==='set-cookie');
  28. let cookie = setCk?json[setCk].split(';')[0]:'';
  29. // let cookie = setCk?json[setCk]:'';
  30. log('cookie:'+cookie);
  31. rule_fetch_params.headers.Cookie = cookie;
  32. setItem(RULE_CK,cookie);
  33. }