目标网站
aHR0cDovL3d3dy55bmdwLmNvbS8=
1.呈现状态
2.分析网站
先复制请求链接的curl看看打印出的结果
打印出的结果不正常,来看看请求头,里面有一个'$Cookie',转场到请求连接的cookies中看看,xincaigou这个值大概就是我们想要的
往上看其他请求,找xincaigou从哪冒出来,在第二个链接请求时由服务器返回
第二个链接请求,需要第一个链接请求时重定向给它
3.获取answer
先无参数请求第一个链接,得到下图将eval函数复制到脚本片段中,打上断点,并在控制台中打印出参数p的值
复制p值到js脚本中将‘\\’换成‘\’,如下
var _$ = ['\x23\x63\x68\x61\x6c\x6c\x65\x6e\x67\x65',
'\x23\x77\x61\x66\x5f\x61\x6e\x73\x77\x65\x72', '\x23\x43\x68\x61\x6c\x6c\x65\x6e\x67\x65\x46\x6f\x72\x6d'
];
$(_$[0])["\x73\x68\x6f\x77"]();
$(function () {
setTimeout(function () {
var x06dd1a = {};
var x0fcad9;
var x08c924 = 0x0f;
var x01c264 = navigator["\x75\x73\x65\x72\x41\x67\x65\x6e\x74"]["\x74\x6f\x4c\x6f\x77\x65\x72\x43\x61\x73\x65"]();
x08c924 = x08c924 * 0x1d;
(x0fcad9 = x01c264["\x6d\x61\x74\x63\x68"](/msie ([\d.]+)/)) ? x06dd1a["\x69\x65"] = x0fcad9[0x1]
: (x0fcad9 = x01c264["\x6d\x61\x74\x63\x68"](/firefox\/([\d.]+)/))? x06dd1a["\x66\x69\x72\x65\x66\x6f\x78"] = x0fcad9[0x1]
: (x0fcad9 = x01c264["\x6d\x61\x74\x63\x68"](/chrome\/([\d.]+)/))? x06dd1a["\x63\x68\x72\x6f\x6d\x65"] = x0fcad9[0x1]
: (x0fcad9 = x01c264["\x6d\x61\x74\x63\x68"](/opera.([\d.]+)/)) ? x06dd1a["\x6f\x70\x65\x72\x61"] = x0fcad9[0x1]
: (x0fcad9 = x01c264["\x6d\x61\x74\x63\x68"](/version\/([\d.]+).*safari / ))? x06dd1a["\x73\x61\x66\x61\x72\x69"] = x0fcad9[0x1]
: 0x0;
x08c924 = x08c924 + 0x63;
if (x06dd1a["\x69\x65"] || x06dd1a["\x66\x69\x72\x65\x66\x6f\x78"] || x06dd1a["\x63\x68\x72\x6f\x6d\x65"] || x06dd1a["\x6f\x70\x65\x72\x61"] || x06dd1a["\x73\x61\x66\x61\x72\x69"]) {
x08c924 = (x08c924 * 0x3 + 0x7);
if (x08c924 < 0x7b) x08c924 = x08c924 + 0x929;
var x0b515d = $(_$[1]);
if (x08c924 > 0x929) x08c924 = Math["\x66\x6c\x6f\x6f\x72"](x08c924 / 0x7b);
x0b515d["\x76\x61\x6c"](x08c924);
$(_$[2])["\x73\x75\x62\x6d\x69\x74"]()
}
}, 0x3e8)
});
再将上面代码复制到AST中去解码
var _$ = ["#challenge", "#waf_answer", "#ChallengeForm"];
$(_$[0])["show"]();
$(function () {
setTimeout(function () {
var x06dd1a = {};
var x0fcad9;
var x08c924 = 15;
var x01c264 = navigator["userAgent"]["toLowerCase"]();
x08c924 = x08c924 * 29;
(x0fcad9 = x01c264["match"](/msie ([\d.]+)/)) ? x06dd1a["ie"] = x0fcad9[1] : (x0fcad9 = x01c264["match"](/firefox\/([\d.]+)/)) ? x06dd1a["firefox"] = x0fcad9[1] : (x0fcad9 = x01c264["match"](/chrome\/([\d.]+)/)) ? x06dd1a["chrome"] = x0fcad9[1] : (x0fcad9 = x01c264["match"](/opera.([\d.]+)/)) ? x06dd1a["opera"] = x0fcad9[1] : (x0fcad9 = x01c264["match"](/version\/([\d.]+).*safari /)) ? x06dd1a["safari"] = x0fcad9[1] : 0;
x08c924 = x08c924 + 99;
if (x06dd1a["ie"] || x06dd1a["firefox"] || x06dd1a["chrome"] || x06dd1a["opera"] || x06dd1a["safari"]) {
x08c924 = x08c924 * 3 + 7;
if (x08c924 < 123) {
x08c924 = x08c924 + 2345;
}
var x0b515d = $(_$[1]);
if (x08c924 > 2345) {
x08c924 = Math["floor"](x08c924 / 123);
}
x0b515d["val"](x08c924);
$(_$[2])["submit"]();
}
}, 1000);
});
然后再复制解码后的代码到js脚本中,删掉有关JQuery的操作,反复测试,找到需要传参的值,再删掉其他无用代码,最后形成如下代码
function get_answer(a, b, c) {
a = a * b;
a = a + c;
a = a * 3 + 7;
if (a < 123) { a = a + 2345;}
if (a > 2345) {a = Math["floor"](a / 123);}
return a
}
将图中三个参数转化一下传入get_answer中便会得到answer
4.获取xincaigou
带上参数answer请求第一个链接便可以获取到服务器返回的xincaigou,期间保持会话维持,将cookies的值更新到session中,请求数据链接就可以得到答案
标签:x0fcad9,cookies,x08c924,x06dd1a,x61,反爬,x65,x72,采购网 From: https://www.cnblogs.com/gouqizi/p/18076662