Coder Social home page Coder Social logo

htbbusinessctf2022_chromeminer's Introduction

ChromeMiner - (Reversing)

Description

Discurd has filed a DMCA violation regarding a popular browser extension claiming to be conducting VIP giveaways on the company's product. The addon store has since taken down the extension to prevent any potential browser cryptomining malware from being distributed in the marketplace. Could you investigate what the 'Discurd Nitro Giveaway' addon does exactly?

There was one file attached, DiscurdNitru.crx

Writeup

Begin

Unpacking .crx with the online tool (https://crxextractor.com/) gives us background.js (and icons + manifest, but let's focus on the code)

backgrounds.js

Deobfuscation

The code was obfuscated, but again, an online tool comes with help (https://deobfuscate.io/)

deobfuscated.js

Sanitization

After the deobfuscation, we still need to sanitize the file to get rid of the q array.

My first try was to manually sanitize the strings from the array q with python just copy pasting q[462] + q[847] + q[39] + q[539]... word after word, but there were plenty of them, so automated it...

Some C# code (Sanitizer.csx)...

Running: dotnet script .\Sanitizer.csx

And we have sanitized strings from the array q

sanitized.js

JavaScript looks awful, I don't understand what's going on here, but we can see there is a code looking like encryption.

Also, there we can finally see some meaningful strings:

  • _NOT_THE_SECRET_
  • E242E64261D21969F65BEDF954900A995209099FB6C3C682C0D9C4B275B1C212BC188E0882B6BE72C749211241187FA8
  • AES-CBC

Decryption

So it looks like we have the encryption method AES-CBC, the encrypted message E242E642... and something that actually looks like the secret _NOT_THE_SECRET.

So another online tool comes with help (https://www.devglan.com/online-tools/aes-encryption-decryption):

  • Encrypted message: E242E64261D21969F65BEDF954900A995209099FB6C3C682C0D9C4B275B1C212BC188E0882B6BE72C749211241187FA8 (Hex)
  • Cipher Mode: CBC with key size 128 bits
  • Secret key: _NOT_THE_SECRET_

Gives Base64: FxoNLwALJRwAJRc6DSojEV9DSFIwbWVfTTFOM1JfX30=

Which gives: ��/�%�%�:*#�_CHR0me_M1N3R__}

Well... half of the flag captured. But what about the first half? The secret key must be valid or else we wouldn't find anything.

But AES-CBC has something like initialization vector, so let's try using the same secret key as the IV as well

  • IV: _NOT_THE_SECRET_

Gives Base64: SFRCe19fbVlfdlJ5X293Tl9DSFIwbWVfTTFOM1JfX30=

Which gives flag: HTB{__mY_vRy_owN_CHR0me_M1N3R__}

htbbusinessctf2022_chromeminer's People

Contributors

norberto5 avatar

Stargazers

Neoma Fong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.