scan
Scan PHP files modified in the last 24 hours for common web-shell function calls, and — if a stored key exists — for the root password appearing in code
- Command:
/go/scan - Category: Security
- Required option: None
- Output: The matching lines, if any; otherwise
There are no new PHP shell files. - Last updated: 2026-11-21
On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also
Overview
/go/scan looks for two different things across every hosted account's recently changed PHP files, and emails and WhatsApps the administrator (not the hosting customer) when it finds something new:
- Possible web shells — any
.phpfile modified in the last 24 hours that contains one of a short list of function names commonly (but not exclusively) used by malicious scripts. - An exposed root password — the same recently modified files, checked against the server's own root password, if a key for it is saved at
/var/go/etc/go.key.
[!WARNING] The root-password check calls
openssl base64 -d -aes-128-cbc -d -pbkdf2 -nosalt -md md5 -in /var/go/etc/go.key -pass pass:"$MAC".openssl base64is OpenSSL's plain Base64 encode/decode tool — it does not accept-aes-128-cbc,-pbkdf2,-md, or-passat all (those belong toopenssl enc, a different subcommand). This looks like it should have beenopenssl enc -d -aes-128-cbc -a -pbkdf2 -nosalt -md md5 .... As written, this call is very likely to fail and leaveRemotePasswordempty. An empty value then becomes an empty search pattern (grep -ioE "()"), and an empty pattern ingrepmatches every line of every file it's given — so this is likely to send a false "ROOT Password Scanner" alert, containing arbitrary lines from whatever PHP files were recently touched, on every run wherego.keyexists and any PHP file anywhere was modified in the last 24 hours. Verify this before trusting this part of the command's output.
[!NOTE] The PHP-shell check looks for
base64_decode,proc_open,shell_exec,exec(,system(, andpassthru— all of them ordinary PHP functions used by plenty of legitimate code (encoding, image handling, build tooling, and so on), not something unique to malware. This is a plain, case-insensitive text search, not the "AI-powered... behavioral pattern" analysis the alert email describes itself as. Treat every match as something to look at, not as confirmed malicious code.
The call is appended to /var/log/go/scan.log.
Quick start
# Run it once, by hand
/go/scan
It's meant to run on a schedule (daily, from cron), since it only looks at the last 24 hours of changes each time.
Syntax
/go/scan
The command takes no arguments.
Options
None.
Output
/home/example.com/www/wp-content/uploads/x.php:eval(gzinflate(base64_decode($s)));
There are no new PHP shell files.
- The shell-scanner section prints every newly seen matching line (file path and matching line of code, with
(characters stripped — see Known issues), orThere are no new PHP shell files.if nothing new was found. - The root-password section, if it triggers, prints matching lines with any detected occurrence of the password replaced by asterisks.
Examples
# Run it manually
/go/scan
# Schedule it daily
/go/cron
# Clear the "already alerted" record for the shell scanner, to force re-alerting
sudo rm -rf /usr/local/goadmio/db/shell/*
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| You receive a "ROOT Password Scanner" alert that doesn't actually contain the root password | The decryption call is very likely broken (see the warning above), turning the search into an always-matches-everything pattern. | Treat these alerts as unreliable until the openssl command is corrected. |
| A flagged file turns out to be legitimate code | The scanner matches on common PHP function names with no behavioral analysis, despite what the alert email says. | Review the file yourself before taking action; false positives are expected. |
| The same web shell keeps getting flagged every day | Its line content changed (so it hashes differently), or its modification time keeps refreshing. | Expected; each distinct line is only alerted on once (see Details). |
| A web shell that was never cleaned up stops showing up in new alerts | Its file hasn't been modified in over 24 hours, so it's outside this command's scan window entirely — not because it's been resolved. | Don't rely on this command alone for ongoing detection of unchanged files; also run a full scanner such as clamav or antivirus. |
| The root-password check never runs at all | /var/go/etc/go.key doesn't exist on this server. |
Expected if that key was never generated here. |
| The root-password check used to work and now always fails (or always "finds" something) | The server has more than one network interface with a MAC address — for example, after installing Docker (which adds its own bridge interface) — so the MAC-derived passphrase no longer matches what was used when the secret was first encrypted. | Confirm with ifconfig | grep -c ether how many interfaces report a MAC address; this check assumes exactly one. |
ifconfig: command not found |
net-tools isn't installed; some modern distributions ship only ip by default. |
Install net-tools, or treat the root-password check as non-functional on this server. |
Details
PHP shell scanner
- Finds every
.phpfile under/home/*/wwwmodified in the last 1440 minutes (24 hours). - Greps each one, case-insensitively, for:
base64_decode,proc_open,shell_exec,exec(,exec (,system(,system (,passthru. - Keeps at most 25 matching lines, and removes every
(character from the result before anything else happens to it. - For each matching line, hashes the full file-path-plus-match text with MD5. If a marker file for that hash doesn't already exist under
/usr/local/goadmio/db/shell/, creates one and adds the line to this run's alert. - If anything new was found, emails and WhatsApps the administrator a templated security alert containing the new lines; a file whose matching line was already alerted on before is not alerted on again.
Because step 1 only looks at files modified in the last day, a file that was planted earlier and hasn't been touched since will not be examined by a later run — this command catches new or recently changed files, not everything on disk.
Root password scanner
Runs only if /var/go/etc/go.key exists:
- Derives a passphrase from the MAC address(es) reported by
ifconfig, Base64-encoded. - Attempts to decrypt
go.keywith that passphrase (see the warning above about the likely-brokenopensslinvocation) to recover the stored root password. - Searches the same set of recently modified PHP files for that exact string.
- If anything matches, redacts the password with asterisks in the output and sends an alert — with no deduplication, so a persistent match (true or false) re-alerts on every run.
Known issues
- The root-password decryption almost certainly fails as written (wrong
opensslsubcommand), which can turn the check into one that matches every line of every recently modified file. See the warning above. - The MAC-address passphrase assumes exactly one network interface reports a MAC. A server with more than one (bridges, containers, additional NICs) will derive a different passphrase than whatever was used to originally encrypt the secret.
- No periodic re-scan of unchanged files. The 24-hour modification window means a web shell that sits untouched is invisible to this command after its first day on disk.
- High false-positive rate by design. The function names searched for are common in legitimate PHP code; the alert's "AI-powered... behavioral pattern" language describes a plain keyword grep.
- Stripping
(from matched lines makes the reported code slightly harder to read (exec(becomesexec), for no apparent functional reason. - The root-password section has no deduplication, unlike the shell scanner, so a persistent (or falsely triggering) match repeats every run instead of alerting once.
See also
| Command | Description |
|---|---|
clamav |
Open-source antivirus engine for malware, viruses, trojans, and threats |
antivirus |
Built-in GoAdmio antivirus |
uploader |
Report file uploads or fingerprint a known file |
cron |
Set up main cron jobs in GoAdmio |
root |
Change the GoAdmio root password |
fail2ban |
Install and configure Fail2ban to ban brute-force sources against SSH, FTP, SMTP, and Dovecot |