This is the end of phishing. The Order of the Overflow is introducing the ultimate authentication factor, the most important one, the final one. To help the web transition to this new era of security, we are introducing a 3FA tool for testing your webpages completely isolated on our admin's browser.
There are few files but only background_script.js and content_script.js are important.
background_script.js:
// Put all the javascript code here, that you want to execute in background.
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(sender.tab ?
"from a content script:" + sender.tab.url :
"from the extension");
if (request.getflag == "true")
sendResponse({flag: "OOO{}"});
}
);
It's apparently a Chrome extension so I loaded and I tried to beautify the code because it's easier for me to debug.
After loaded the Chrome extension and opened a random page, it crash after few seconds. I spent about 1 hour until I realized it's because of the beautify. There is a self-protected mechanism to prevent such behavior.
The web page loaded successfully after I change it back to original content, and there is an error on the console:
Uncaught TypeError: Cannot read property 'querySelectorAll' of null
The goal is clear, we need to let nodesadded = 5, nodesdeleted = 3, attrcharsadded = 23 and domvalue = 2188. After all requirements are fulfilled, we can get flag via thirdfactooor.value.
It's not hard to find out that the values are related to the MutationObserver. So we need to manipulate the DOM including add, update attributes and delete the elements for certain times.
threefactooorx
Description
This is the end of phishing. The Order of the Overflow is introducing the ultimate authentication factor, the most important one, the final one. To help the web transition to this new era of security, we are introducing a 3FA tool for testing your webpages completely isolated on our admin's browser.
Files:
3factooorx.crx
Writeup
I used CRX Viewer to open the crx file.
There are few files but only background_script.js and content_script.js are important.
background_script.js:
The content of content_script is obfuscated by JavaScript Obfuscator Tool.
It's apparently a Chrome extension so I loaded and I tried to beautify the code because it's easier for me to debug.
After loaded the Chrome extension and opened a random page, it crash after few seconds. I spent about 1 hour until I realized it's because of the beautify. There is a self-protected mechanism to prevent such behavior.
The web page loaded successfully after I change it back to original content, and there is an error on the console:
The error throw by this part of code:
We can set a breakpoint and reload, when the debugger has been triggered, we can use console to help us see the real value:
So the deobfuscated code is:
_0x1e6746
is null so the browser throws an error.Let's find out what is
_0x1e6746
:We can use the same technique to know the original code:
So we can add an element with id
3fa
.After refresh the page, another error shown:
There is something wrong in this line:
Set a breakpoint and use console to see the value, we can transform the code above into this:
_0x2c0eff['hJFjw']
is just a function to compare it's parameters:ƒ (_0x410572,_0x33660a){return _0x410572==_0x33660a;}
So it's actually:
We can add a new input element with id:
thirdfactooor
Now, there is no more error.
Search for the flag
Then, I searched the keyword:
flag
to see if I can get some useful information. I found this part:We can also set a breakpoint and deobfuscate ourselves by executing those small function and get value via console.
We can ignore
console.log
because it has been replaced with an empty function.The goal is clear, we need to let nodesadded = 5, nodesdeleted = 3, attrcharsadded = 23 and domvalue = 2188. After all requirements are fulfilled, we can get flag via
thirdfactooor.value
.It's not hard to find out that the values are related to the MutationObserver. So we need to manipulate the DOM including add, update attributes and delete the elements for certain times.
It's my solution in the end:
Submit the HTML file and I got the image with the flag(but no request to the server so I just type the flag myself):