[JavaScript] 纯文本查看 复制代码
delete __dirname
delete __filename
function get_enviroment(proxy_array) {
for(var i=0; i<proxy_array.length; i++){
handler = '{\n' +
' get: function(target, property, receiver) {\n' +
' console.log("方法:", "get ", "对象:", ' +
'"' + proxy_array[i] + '" ,' +
'" 属性:", property, ' +
'" 属性类型:", ' + 'typeof property, ' +
// '" 属性值:", ' + 'target[property], ' +
'" 属性值类型:", typeof target[property]);\n' +
' return target[property];\n' +
' },\n' +
' set: function(target, property, value, receiver) {\n' +
' console.log("方法:", "set ", "对象:", ' +
'"' + proxy_array[i] + '" ,' +
'" 属性:", property, ' +
'" 属性类型:", ' + 'typeof property, ' +
// '" 属性值:", ' + 'target[property], ' +
'" 属性值类型:", typeof target[property]);\n' +
' return Reflect.set(...arguments);\n' +
' }\n' +
'}'
eval('try{\n' + proxy_array[i] + ';\n'
+ proxy_array[i] + '=new Proxy(' + proxy_array[i] + ', ' + handler + ')}catch (e) {\n' + proxy_array[i] + '={};\n'
+ proxy_array[i] + '=new Proxy(' + proxy_array[i] + ', ' + handler + ')}')
}
}
proxy_array = ['window', 'document', 'location', 'navigator', 'history','screen']
content = 'RbpmW6cofr7eyEOxPgGsWCOM.usmMcoTMGLjc_ZzfA3'
null_fuc = function () {
console.log(arguments)
}
window = global
window.top = window
window.addEventListener = function (res) {
console.log('window->addEventListener', res)
}
window.HTMLCanvasElement = null_fuc
window.name = ''
window.XMLHttpRequest = function (res) {
console.log('window->XMLHttpRequest', res)
return {
open: function (res) {
console.log('window->XMLHttpRequest->open', res)
},
send: function (res) {
console.log('window->XMLHttpRequest->send', res)
},
setRequestHeader: function (res) {
console.log('window->XMLHttpRequest->setRequestHeader', res)
}
}
}
setInterval = null_fuc
setTimeout = null_fuc
div = {
getElementsByTagName: function (res) {
console.log('div->getElementsByTagName', res)
if (res == 'i') {
console.log('div->getElementsByTagName->i', res)
return ''
}
},
}
script = {
0:{},
1:{},
}
document = {
getElementsByTagName: function (res) {
console.log('document->getElementsByTagName', res)
if (res == 'script') {
console.log('document->getElementsByTagName->script', res)
return script
}
if (res == 'base') {
console.log('document->getElementsByTagName->base', res)
return []
}
},
createElement: function (res) {
console.log('document->createElement', res)
if (res == 'div') {
return div
}
},
appendChild: function (res) {
console.log('document->appendChild', res)
console.log(arguments);
return {}
},
removeChild: null_fuc,
getElementById: function (res) {
console.log('document->getElementById', res)
},
addEventListener: function (res) {
console.log('document->addEventListener', res)
return {}
},
attachEvent: function (res) {
console.log('document->attachEvent', res)
return ''
},
}
meta = {
getAttribute: function (res) {
if (res === "r") {
return "m"
}
},
parentNode: {
removeChild: function (res) {
console.log('meta->parentNode', res)
}
},
content: content
}
location = {
"ancestorOrigins": {},
"href": "https://xxxxxxxxxx",
"origin": "https://XXXXXXX",
"protocol": "https:",
"host": "XXXX",
"hostname": "XXXXX",
"port": "",
"pathname": "/portal/",
"search": "",
"hash": "XXXXX"
}
navigator = {
appCodeName: "Mozilla",
appName: "Netscape",
appVersion: "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0",
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0",
}
get_enviroment(proxy_array)