Guide · ALFA web shell
ALFA_DATA or alfacgiapi folder on your site: what it is and what to do
You found a folder called ALFA_DATA, with alfacgiapi inside it and files ending in .alfa, on a WordPress site or somewhere in a hosting account — or a scanner reported it. That folder is written by the ALFA web shell, a PHP backdoor that has circulated publicly for years and gives whoever uses it a file manager, a command line and a database tool in the browser. The folder appears when the shell’s operator uses its features to run Perl, Python or shell commands through CGI. So it tells you two things: someone uploaded the shell, and someone used it. It does not tell you where the shell is, because the shell is a separate PHP file. This guide covers how to find that file and any copies, what the attacker could reach with it, and why deleting ALFA_DATA alone changes nothing.
Published Last reviewed
- What it is
- Working folders of the ALFA PHP web shell, created when its CGI features are used
- Typical contents
- .htaccess enabling CGI, scripts such as perl.alfa, py.alfa or bash.alfa
- What it proves
- A shell was uploaded and an operator used it on this account
- What it does not show
- Where the shell file is, or how it was uploaded
What it is
ALFA_DATA is the shell’s working folder, not the shell
ALFA is one of several PHP web shells that are traded and reused openly, alongside older families such as WSO, whose code is often recognisable by the default action name FilesMan. Once uploaded to a site, a web shell is a single PHP file that turns a browser into a remote control panel for the hosting account: browse and edit files, upload more, open the database with the credentials from wp-config.php, and run system commands. ALFA versions are usually labelled with the name ALFA TEaM in the panel, and the file itself is often obfuscated and password-protected so that it looks like noise to anyone who opens it.
Many hosts disable the PHP functions that run system commands. To get around that, ALFA can write small Perl, Python or Bash scripts and an .htaccess file that tells Apache or LiteSpeed to execute them as CGI programs. Security forums and host knowledge bases have reported the same layout for years: a folder named ALFA_DATA, a subfolder named alfacgiapi, an .htaccess with lines such as AddHandler cgi-script .alfa, and scripts named perl.alfa, py.alfa or bash.alfa. Variants differ, so treat the names as strong indicators rather than a complete list.
Because the folder is created on demand, its timestamp is useful: it records a moment when an operator was active on the account. The shell file was uploaded at or before that moment, and anything else written around the same time deserves a look.
Figure 1 · The folder is the trace
ALFA_DATA shows the shell was used. The shell itself is a PHP file elsewhere.
find ~ -type d \( -name ALFA_DATA -o -name alfacgiapi \)
/home/acct/public_html/wp-content/uploads/ALFA_DATA
/home/acct/public_html/wp-content/uploads/ALFA_DATA/alfacgiapi
ls -la --time-style=+%F wp-content/uploads/ALFA_DATA/alfacgiapi
-rw-r--r-- 1 acct acct 171 2026-11-09 .htaccess
-rwxr-xr-x 1 acct acct 1043 2026-11-09 perl.alfa
-rwxr-xr-x 1 acct acct 487 2026-11-09 py.alfa
find ~/public_html -name '*.php' -newermt 2026-11-08 ! -newermt 2026-11-10
/home/acct/public_html/wp-content/plugins/hello-dolly/readme-x.php
Find the shell
Read-only checks to find the PHP file that wrote it
Run these over SSH from the hosting account’s home folder, so every site in the account is covered. None of them change anything. Where a command needs a date, use the day ALFA_DATA was created.
- 01
Find every ALFA folder and .alfa file
Copies often exist in more than one site or folder:
find ~ \( -type d \( -name ALFA_DATA -o -name alfacgiapi \) -o -type f -name '*.alfa' \) -exec ls -ld --time-style=+'%F %T' {} + 2>/dev/nullNote the earliest date and time. That is your anchor for the next searches.
- 02
List PHP files written around that time
The shell, and anything uploaded with it, usually has a nearby modification time. Adjust the dates to a day either side of the anchor:
find ~ -type f \( -name '*.php*' -o -name '*.phtml' -o -name '*.phar' \) -newermt '2026-11-08' ! -newermt '2026-11-10' -ls 2>/dev/nullAttackers sometimes reset modification times. A file with an old date in a folder full of recent ones, or the reverse, is worth reading too.
- 03
Search for the shell’s own strings
Unobfuscated copies name themselves; many other shells share recognisable markers:
grep -rlIE 'ALFA_DATA|alfacgiapi|ALFA TEaM|FilesMan' ~ --include='*.php*' --include='*.phtml' 2>/dev/nullNo match does not clear the account: an obfuscated shell contains none of these strings in plain text.
- 04
Look for typical web-shell constructions
Files that execute decoded strings or pass request data to command functions:
grep -rlIE '(eval|assert)\s*\(\s*(base64_decode|gzinflate|gzuncompress|str_rot13)|(system|shell_exec|passthru|proc_open|popen)\s*\(\s*\$_(POST|GET|REQUEST|COOKIE)' ~/public_html --include='*.php*' 2>/dev/nullSome legitimate plugins match the first half. Read every hit before deciding; the snippet decoder below shows what an encoded block does without running it.
- 05
Read the access logs for requests to the shell
Paths under ALFA_DATA and POST requests to unfamiliar PHP files show when the shell was used and from where. Log locations vary by host; on cPanel the raw logs are usually under ~/access-logs or ~/logs:
zgrep -hE 'ALFA_DATA|alfacgiapi|\.alfa' ~/logs/* ~/access-logs/* 2>/dev/null | head -n 50 zgrep -h '"POST ' ~/logs/* ~/access-logs/* 2>/dev/null | grep -vE 'wp-cron\.php|admin-ajax\.php|wp-login\.php|xmlrpc\.php' | awk '{print $7}' | sort | uniq -c | sort -rn | head -n 30A PHP file that receives POST requests and is not part of WordPress, a plugin or a theme you can name is the prime suspect. The earliest request to it usually sits close to the upload, and the requests just before the upload often show how it got in.
- 06
Check WordPress core and WordPress.org plugins against checksums
Modified core files and files that should not exist inside core folders:
wp core verify-checksums wp plugin verify-checksums --allThe plugin check covers only plugins published on WordPress.org; premium plugins and themes need comparing against a fresh vendor download.
Scope
What an ALFA operator could reach from your account
A web shell has exactly the permissions of the user PHP runs as. On most shared and cPanel hosting that is the account user, which owns every site in the account, the mail folders, the backups stored in the home folder and any SSH keys there. So the question is not which WordPress site was hacked but which account was, and every site in it is in scope until checked.
From the database password in wp-config.php the operator could read and change the whole database: create administrators, inject scripts into posts and options, or copy customer data. Through the file manager they could add further backdoors in places a later cleanup tends to miss — must-use plugins, drop-ins, .user.ini directives, cron entries — so finding and deleting the one shell file is rarely the end of it.
ALFA also has features aimed at the server rather than the account, such as reading other accounts’ configuration files through symbolic links. On a well-isolated server — CloudLinux CageFS, per-user PHP-FPM pools and correct home-folder permissions — those fail. On a poorly isolated one, neighbouring accounts may have been read too, and the server administrator needs to know.
Remove it
Remove the shell, every copy and the way in, in this order
A web shell is an access path, so removal is about closing access, not deleting a folder. The order keeps evidence and stops the operator returning mid-cleanup.
- 01
Preserve
Copy the ALFA folders, the shell file, the logs and a full backup of files and database off the server, keeping timestamps. The logs on shared hosting rotate within days.
- 02
Cut the operator off
Put the site behind maintenance or a firewall rule that blocks requests to the shell and to ALFA_DATA, then remove the shell file and every copy found. Remove ALFA_DATA last, once it has been copied.
- 03
Sweep for what was added while the shell was live
Administrators, must-use plugins, drop-ins, .user.ini and .htaccess directives, cron entries on the server and in WP-Cron, and PHP files in uploads. Each of these survives the deletion of the shell.
- 04
Replace rather than edit
Reinstall WordPress core, plugins and themes from official sources instead of editing out injected lines. A copy you cleaned by hand may still carry a second loader.
- 05
Find the entry point
The access-log requests just before the shell first appeared usually show it: a vulnerable plugin’s upload endpoint, a stolen administrator login used to install a plugin, or an FTP or panel login. Close that, or the shell is back within days.
- 06
Rotate access from a clean device
Database password, WordPress salts and keys, every administrator password, hosting panel, FTP and SSH credentials, and any API keys stored in the account. Rotating before the shell is gone hands the new secrets to the operator.
- 07
Verify over several days
Re-run the searches above after a few days of normal traffic. A new ALFA_DATA folder or a new POST target in the logs means a copy or a second backdoor survived.
If you host several accounts
When ALFA_DATA appears on a server, not one site
If you administer the server, search every account home for ALFA folders, not only the one that was reported, and check whether the shell’s symlink features could have reached other accounts. On cPanel and WHM servers without CageFS or equivalent isolation, a shell in one account is a server incident.
Look also for processes running as the account user that you cannot name, and for outbound connections from PHP or Perl processes. A shell that could run commands could have started something that outlives the PHP request.
Common questions
Common questions about ALFA_DATA and the ALFA shell
Is ALFA_DATA part of WordPress, a plugin or my host?
No. Neither WordPress nor any mainstream plugin or host panel creates a folder with that name. It is written by the ALFA web shell when its operator uses the CGI features to run commands.
I deleted ALFA_DATA. Is the site clean now?
No. The folder is a by-product. The shell is a separate PHP file that can recreate the folder, and whatever the operator added while the shell was live is still there. Find the shell, sweep for persistence and close the entry point.
Our scanner found ALFA_DATA but nothing else. Can that be right?
Yes, if the shell file is obfuscated or was already removed. Scanners recognise the plain-text CGI scripts more easily than a packed PHP file. Use the timestamp of the folder to search for PHP files written around the same time and read the access logs.
Should I change passwords straight away?
Change them from a clean device once the shell and its copies are removed. While the shell is live, the operator can read wp-config.php and anything else in the account, so a new database password set before removal is exposed immediately.
Does this mean my host was hacked?
Usually not. Most ALFA uploads go through the site itself: a vulnerable plugin, a stolen WordPress or FTP login, or a file manager plugin. The host needs to know if the shell may have reached other accounts on the server.