RatOrNot
All guides

Analysis

How malicious mods hide from scanners

Last updated November 16, 2026

Malicious mods hide by scrambling the strings that give them away, calling methods indirectly, packing code inside other files and waiting before they act. Attackers know people scan files, so they try to make the code harder to read, but most of these tricks leave tell-tale traces.

String hiding

Words like a web address or a folder name are stored as scrambled data and rebuilt only when the code runs. That defeats a simple text search for discord.com/api/webhooks or leveldb. Common variants:

  • Splitting. The text is cut into pieces and joined with StringBuilder or string concatenation at run time.
  • Character arrays. The text is stored as numbers and converted back into characters.
  • XOR tables and small keys. Every character is combined with a key. A helper method reverses it each time a string is needed.
  • Encrypted strings. A real cipher such as AES is used, with the key stored next to the data, so the protection is only against casual reading.
  • Compiler tricks. Modern Java compiles string concatenation through invokedynamic, and some tools abuse that machinery to hide values or calls.

Because the decoding routine is part of the jar, the original text can be recovered without ever running the malware. That is what the deobfuscation step does.

Reflection and indirect calls

Instead of calling a method directly, the code looks it up by name at run time, with Class.forName and Method.invoke, or with method handles. The names themselves are often hidden strings. This hides what the code does from simple searches, but the lookup is a visible signal, and recovered names can be matched against the same rules as direct calls. Reflection is also normal in compatibility code, so it counts for little on its own. See false positives.

Layered packaging

  • Nested jars. A jar can contain another jar. Mod loaders support this officially (Fabric uses META-INF/jars/, Forge-family loaders use a jarjar folder), so a nested jar is not suspicious alone, but its contents still need to be checked.
  • Disguised files. A class can be stored under a misleading extension such as .png and loaded from bytes later.
  • Polyglot and odd archives. Extra bytes at the start of the file, or headers that disagree with each other, make some tools fail to open the archive. Strict readers can miss these; tolerant ones can find them.

Delayed or conditional behaviour

Some samples wait minutes or hours before doing anything, check for debugger arguments such as a debug agent, look for virtual machines or analysis tools, compare the user name with known sandbox names, or only act on certain operating systems. This defeats short dynamic sandbox runs, because the sandbox never sees the bad behaviour. It does not help against static analysis, since the checks themselves are in the code. See evasion.

Fetching the real payload later

The cleanest trick is to have nothing bad in the jar at all. A small loader downloads the real program from a server and runs it, so what you scan is innocent-looking and the payload can change at any time. The loader still has to download and execute something, and that is detectable. See downloaders and loaders.

How static analysis helps

Static analysis reads the bytecode without running it. RatOrNot evaluates common string-decoding routines with a value interpreter that cannot run arbitrary code, recovers hidden values and then applies its behaviour rules to the result. Recovered values are marked as decoded in the evidence so you can tell what was hidden. Read how it works for the pipeline.

What it cannot do

A new or heavily customised scheme may not be recognised, and a payload that is only downloaded later is visible only as the loader. This is why RatOrNot reports evidence and confidence rather than promising safety.

Obfuscation alone does not mean a mod is malicious. Many legitimate mods are shrunk or renamed to protect their code. What counts is what the code does once it is revealed.