Compliance

Phase 1, Phase 2, then keep it running

A fixed-price gap analysis, remediation through to your audit, and upkeep after it. All in a workspace you keep.

All compliance
Security

Find it before a buyer does

Testing, assessments and security leadership, run by the researcher who found the Mirai botnet kill switch.

All security
Industries

Prove you are secure

To the people you sell to, raise from or answer to.

All industries
Resources

Learn the space

Original research, free tools and plain-language guides, from a published security researcher.

Read the blog
Security

How to Find Backdoors in FiveM Resources and Leaked Scripts

On this page, 7 sections
  1. Where backdoors come from
  2. The patterns that give a backdoor away
  3. A review process for a real server
  4. Automated scanning and its limits
  5. If you find one
  6. Preventing the next one
  7. Common questions

To find backdoors in FiveM resources, read every script before it runs on your server and search for four things: code that fetches content from a remote address and executes it, obfuscated or encoded blocks with no reason to be hidden, commands or events that grant permissions without checking who asks, and secrets or webhooks that send data off your server. Leaked and resold scripts need the closest look.

A backdoor in a FiveM resource gives someone else control of your server. They can grant themselves admin, wipe or inflate your economy, read your database, or push new code whenever they like. The server owner usually sees only the result and assumes it was a cheater. This guide covers where backdoors come from, the patterns that give them away, and a review process that fits a real server with dozens of resources.

Where backdoors come from

FiveM servers run resources from many authors. Most are honest. The risk concentrates in a few places:

  • Leaked resources. Paid scripts redistributed for free. Every person who touched a leaked copy had the chance to add something, and some did, because a backdoor in a popular leaked script reaches hundreds of servers.
  • Resold or repackaged resources. Scripts bought from someone who is not the original author, sometimes with "fixes" or "optimizations" added.
  • Abandoned dependencies. Small helper resources that came bundled with something else and were never read.
  • Former staff and developers. Someone who had commit or file access and left a way back in.

When we built resource scanning for a FiveM anti-cheat provider, the known patterns left in leaked or resold resources were one of the categories it looked for specifically. Our FiveM anti-cheat case study describes the scanning alongside the rest of the engine.

The patterns that give a backdoor away

You are not looking for a single signature. Backdoors get renamed and re-obfuscated constantly. You are looking for behaviour that a legitimate script has no reason to show.

Remote code execution

The most dangerous pattern is a script that makes an HTTP request and then executes what comes back. In Lua resources, that usually means an HTTP request function whose response ends up passed to a function that compiles or runs a string as code. In JavaScript resources, the equivalent is a fetched response passed to an evaluator or a dynamically built function. A legitimate script almost never needs to run code it downloaded. Treat any such path as hostile until proven otherwise.

Obfuscation with no reason

Long strings of escaped bytes, base64 blobs decoded at runtime, variable names that are all random characters, and code built up from character codes are all ways to hide intent. Some paid scripts protect their logic legitimately, often through the platform's own asset protection. Obfuscation inside an otherwise readable free or leaked script is a red flag.

Hidden permission grants

Commands, chat triggers or server events that add a player to an admin group, change ACE permissions or set a staff flag, without checking who is asking. Some check for one hard-coded identifier, which is the author's way back in.

Data leaving the server

Requests that send your server's configuration, licence key, database credentials or player data to an outside address. Webhooks that post to channels you do not own. Any outbound request you did not expect deserves a question.

Unsafe data handling

Not every finding is malicious. Database queries built by joining player input into SQL, and passwords or API keys written in plain text in script files, are weaknesses rather than backdoors, but an attacker uses them the same way. They belong in the same review.

A review process for a real server

Most servers run more resources than anyone has time to read line by line. A process that works:

  • Inventory first. List every resource, where it came from, who supplied it and when it was added. Anything with no known source goes to the top of the list.
  • Search before you read. Search the whole resources folder for HTTP request calls, functions that execute strings as code, encoded blobs, permission changes and outbound webhooks. This narrows hundreds of files to a few dozen worth reading.
  • Read the hits in context. Decide for each whether it has a legitimate purpose. A version check that downloads a number and compares it is fine. A version check that downloads code and runs it is not.
  • Check server event handlers. Every handler that changes money, items or permissions should validate who is calling and what they send. Handlers that trust the client are not backdoors, but they are just as exploitable.
  • Record what you found. The file, the line, why it matters and how to fix it. In the anti-cheat engagement, every finding came with exactly that, so a server owner could act on it rather than just worry about it.
  • Gate new resources. Nothing reaches the live server without the same review. Test on a copy first.

The same supply chain thinking applies to any software that pulls in third-party code. Our post on supply chain security for npm covers it for web applications.

Free weekly email

Get The Compliance Brief every Tuesday

One email a week from Jacob Masse: the security and compliance stories that changed something that week, and what each one means if you sell software to enterprise buyers. Five stories, a take on each, five minutes to read.

Free. Unsubscribe in one click, and replies reach Jacob directly. Read the latest issue or browse the archive.

Automated scanning and its limits

A scanner that knows the common patterns is a big time saver. It reads every file, never gets bored and flags the line. What it cannot do is decide intent. A scanner will flag a legitimate update checker and miss a backdoor written in a way it has not seen. Use scanning to decide where a person reads, not to replace the reading.

Good scan output gives you the exact location, the reason it was flagged and what to do about it. Output that says only "suspicious resource" leaves you where you started.

If you find one

Finding a backdoor means someone may already have used it. Removing the file is only the first step:

  • Take the resource out of the live server and keep a copy for investigation.
  • Rotate everything the server could reach: database passwords, server licence key, management panel passwords, webhook URLs, API tokens and any bot tokens.
  • Review admin and ACE permissions for entries nobody remembers adding.
  • Check other resources for the same pattern. Backdoors are often planted in more than one place so that removing one is not enough.
  • Look at your database and logs for changes in money, items or permissions that no legitimate process explains.
  • Tell your players if their data may have been exposed. Identifiers and chat logs are personal information.

Our general guide on what to do after a data breach walks through the wider response, and the advice on secrets management covers rotating credentials properly.

Preventing the next one

Buy from original authors where you can. Avoid leaked scripts entirely. Keep resources in version control so you can see exactly what changed and when. Give developers access to the files they need and remove it when they leave. Keep secrets in server configuration rather than script files. Review every update, not just every new resource, because an update is the easiest way to slip in a change.

Common questions

Are leaked FiveM scripts safe to use?

Treat them as unsafe. A leaked script has passed through unknown hands and backdoors in popular leaks are a known problem. If you must run one, read every file first, and prefer buying from the original author.

Can an anti-cheat detect a backdoored resource?

Not by watching players. A backdoor is server-side code your server chose to run, so it needs to be found by scanning and reviewing resources. Some anti-cheat products include resource scanning for this reason.

Is obfuscated code always a backdoor?

No. Some paid scripts protect their code legitimately. Obfuscation in a script that has no reason to hide anything, especially around HTTP requests or permission changes, is what should worry you.

What should I rotate after removing a backdoor?

Every secret the server could reach: database credentials, server licence key, management panel logins, webhook URLs, API keys and bot tokens. Assume the attacker read them.

If you would like your server's resources reviewed by someone who has built this kind of scanning, book a free call. We will tell you where to look first.

Not sure what your scripts are hiding? Penetration testing starts from $3,500 for one app or API.

See penetration testingOr book a free call

Before you go

Want the rest of this by email?

If this was useful, I send a few short notes on security posture. Unsubscribe in one click, and replies reach me directly.

From Jacob Masse, Principal of TrazTech: the files by email, then a few short notes over the next month. No spam, unsubscribe in one click.