A blast from the past
A shared hosting platform had a world-writable php-fpm socket and an outdated suPHP setuid binary. An attacker could use the socket to run as nobody, then abuse suPHP and BASH_ENV to execute code as a support user, and finally use sudo to gain root.
In this article we will showcase how we used a long forgotten binary to gain root access on the machine, as part of a bug bounty program. No kitties were harmed in the making of this article.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This is a bug bounty case study in which the authors used a long forgotten setuid binary, suPHP, to gain root on a shared web hosting machine. The report opens with the definition of the tool:
suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.
The latest release, suPHP 0.7.2, dates from 2013 and patched a security vulnerability. A community fork exists at lightsey/mod_suphp but no releases were created from it. suPHP used to be a major component of shared hosting providers, built on the premise that one customer should not be able to read or modify another customer's files.
Setup
The starting point was a regular Linux user on a shared web hosting platform. The main binary lives at /usr/sbin/suphp with these permissions:
- the user
rootowns the file and can read (r) and write (w) it, and the setuid flag is present (s); - the group
nobodycan read (r) and execute (x) the binary; - no one else can read, write or invoke suPHP.
The behaviour of the binary is governed by /etc/suphp.conf. The most restrictive security options are:
; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
These four options prevent script execution from a file or directory that is writeable by a large set of users, since that would let anyone run custom scripts.
; Minimum UID
min_uid=100
; Minimum GID
min_gid=100
suPHP uses file ownership information to decide who is running the binary. The min_{g,u}id options stop malicious users from running most Linux binaries, which are conveniently owned by root. Being able to simply run /bin/bash as root would have made the task much easier.
suPHP also refuses to execute scripts outside the docroot directory. In this case it was set to /; setting it to /home/ would not have helped much either.
Finally, at compile time it is possible to enable PARANOID mode. When enabled, the web server tells suPHP which user is expected to own the script, and suPHP exits with an error on a mismatch.
The configuration file then defines the supported handlers, which is how a single Apache instance was backed by multiple PHP versions:
[handlers]
;Handler for php-scripts
x-httpd-php="php:/usr/bin/php"
;Handler for CGI-scripts
x-suphp-cgi="execute:!self"
The PHP handlers invoke PHP and only support loading .php files. The x-suphp-cgi handler is the interesting one: it will run any file with the +x flag set. It does not allow specifying command line arguments, but environment variables that are not one of the following can be overridden:
LD_PRELOADLD_LIBRARY_PATHPHPRC
and more suPHP specific variables. These variables are commonly abused to inject code into setuid binaries, but not in this case.

The image is a reaction GIF captioned "Not today, satan!", placed right after the point that the usual setuid injection variables are blocked.
Finding it
A lot of daemons reduce their footprint by running as the presumed unprivileged user nobody. On this host the authors found a UNIX socket for php-fpm with the o+w permission, meaning they could send requests through it and execute arbitrary PHP code. That let them downgrade their UID/GID to nobody.
With those privileges they could invoke suPHP directly. Because suPHP is meant to be invoked by Apache as a CGI, options are passed through environment variables:
SUPHP_HANDLER=x-suphp-cgi \
SUPHP_USER=user \
SUPHP_GROUP=group \
SCRIPT_FILENAME=/tmp/hello \
DOCUMENT_ROOT=/ \
/sbin/suphp
Here SUPHP_HANDLER selects a handler defined in the configuration file (x-suphp-cgi), SCRIPT_FILENAME points at the command to execute, and SUPHP_{USER,GROUP} are set to values matching the ownership information of the binary so that suPHP does not reject it. To confirm that nobody could run binaries as their own user, the authors created a hello world executable at /tmp/hello and had suPHP execute it. It worked.
Exploitation
Step 1: enumerate target users
The goal was to gain new privileges. The first step was listing the users that could be targeted, using getent:
nobody@my-party# getent passwd | awk -F: '$3 > 100 {print $1}'
serviceA
serviceB
serviceC
[..snip..]
supportA
supportB
supportC
[..snip..]
customerA
customerB
customerZ
[..snip..]
The names in the report were replaced with dummy values. The output shows three categories: services, support users and customers. Support users are meant to troubleshoot issues on company services and are the most likely to be able to execute commands as root, which makes them an interesting target.
Step 2: look for executables owned by those users
Using more CLI magic, the authors searched for executable files owned by each service or support user:
nobody@my-party# find / -user serviceA -executable -exec ls -ldb {} \; 2>/dev/null
[..snip..]
This produced no results, which was expected because the contents of support users' home directories cannot be listed. Through a bit of brute force, digging through the /var/log journals and some luck, they found a bash script in a support person's home directory. One script is all that is needed.
Step 3: inject code through BASH_ENV
The remaining task was to inject code into the process running as someone else. The bash documentation describes the mechanism:
When bash is started non-interactively, to run a shell script, for example, it looks for the variable
BASH_ENVin the environment, expands its value if it appears there, and uses the expanded value as the name of a file to read and execute. Bash behaves as if the following command were executed:if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fibut the value of thePATHvariable is not used to search for the file name.
The proof of concept was a bash script at /tmp/pwn.sh:
$ /tmp/pwn.sh
id >> /tmp/knock-knock
Prepending BASH_ENV=/tmp/pwn.sh to the suPHP invocation and pointing SCRIPT_FILENAME at the support user's script worked: code could now run as that user. The final invocation, performed over FastCGI, was:
BASH_ENV=/tmp/pwn.sh \
SUPHP_HANDLER=x-suphp-cgi \
SUPHP_USER=user \
SUPHP_GROUP=group \
SCRIPT_FILENAME=/home/supportA/myawesomescript.sh \
DOCUMENT_ROOT=/ \
/sbin/suphp
Because the target script is a bash script, bash reads BASH_ENV when it starts non-interactively and sources the file named there before running the script, so the attacker's code executes in the context of the support user.
Step 4: escalate to root
As expected, running sudo -l as the new identity showed that it could run commands such as gdb, strace and tail with the highest level of privileges and without a password. The final escalation was then straightforward:
$ sudo -u root strace -o /dev/null /bin/id
uid=0(root) gid=0(root) groups=0(root)
Root cause
The chain relies on several design properties of suPHP rather than a single coding mistake. The x-suphp-cgi handler executes any file with the +x flag, and suPHP passes the caller's environment through, filtering only a small set of variables (LD_PRELOAD, LD_LIBRARY_PATH, PHPRC and suPHP specific ones). BASH_ENV is not among them, so a caller can make bash source an arbitrary file when it runs a target script. The min_{g,u}id checks and the writeable-file and directory checks do not prevent this, because the target script is owned by a legitimate user and the injected file is only referenced through the environment. The docroot setting was /, so scripts anywhere on the filesystem were inside it. Whether PARANOID mode was enabled is not stated.
The escalation from the support user to root then depended on that user's sudo configuration, which allowed passwordless execution of gdb, strace and tail as root.
Impact
In this case, an attacker who could reach the writeable php-fpm socket ran code as nobody, then used suPHP to run a support user's script. In this case that led to a support user, and from there to root through the sudo rights granted to that user. The report notes that the names of the users were replaced with dummy values.
Fix
The report does not describe a patch applied to suPHP. Its recommendation is to stop using it: while a fork is still maintained on GitHub, there is no real reason to keep suPHP in 2020. PHP-FPM can be configured with UID-isolated pools of processes, which avoids the risk of running code as an unintended user. In this case study suPHP was only a residue of previous deployments and was no longer necessary. If you do not use it, remove it.
Variants to test
- Look for setuid or setgid helper binaries that pass the caller's environment to an interpreter. A positive result is that a variable such as
BASH_ENV,ENV,PERL5OPTorPYTHONSTARTUPsurvives into the child process and its file is sourced or executed. - Check for world-writeable UNIX sockets belonging to
php-fpmor similar daemons. A positive result is that you can send FastCGI requests through the socket and execute PHP code. - Enumerate users with
getent passwdand search for executables they own withfind / -user <name> -executable. A positive result is any script owned by a more privileged user that the helper will execute. - Run
sudo -las each reachable identity. A positive result is passwordless rights to run interpreters or debugging tools such asgdb,straceortailas root. - Review the helper's configuration for a permissive
docrootand for handlers that execute arbitrary files, and check whetherPARANOIDmode is enabled. A positive result is adocrootof/combined with anexecute:!selfstyle handler.
What happened, in plain words
A group of security researchers was taking part in a bug bounty programme. A bug bounty is an arrangement where a company invites outside people to try to break into its systems and pays them for reporting what they find, instead of prosecuting them. The target was a shared web hosting platform: one physical server that hosts websites for many different customers at the same time.
The researchers started with only a normal, low-privilege account on that machine. By the end they had become the most powerful user on the system, root, which can do anything. They did it by abusing a piece of software called suPHP, an old tool that most people had forgotten was still installed.
This article walks through the whole chain slowly, for readers who have never done this kind of work. Every command and configuration snippet is copied exactly as it appeared, and each one is explained line by line.
A blast from the past
The report begins by defining the tool at the centre of the story:
suPHP is a tool for executing PHP scripts with the permissions of their owners. It consists of an Apache module (mod_suphp) and a setuid root binary (suphp) that is called by the Apache module to change the uid of the process executing the PHP interpreter.
That definition is dense, so let us unpack it. PHP is a programming language used to build websites. A PHP script is a file of PHP code that the web server runs to produce a page. Apache is one of the most common web server programs: the software that receives a visitor's request from a browser and sends back a page. A module is an optional add-on that plugs into Apache to give it extra abilities; mod_suphp is that add-on.
A binary is a compiled program, a file the computer can run directly. A setuid binary is special: when you run it, it does not run with your permissions but with the permissions of the person who owns the file. If the owner is root, the program runs with root's power, even if the person who launched it is an ordinary user. Think of a setuid binary as a signed authorisation letter: you hand it to a clerk, and the clerk acts with the authority written on the letter rather than with your own.
A uid is a user identifier, the number the system uses internally to tell users apart. So suPHP's job is: when a customer's PHP script needs to run, run it as that customer, not as the web server's own account. That is what makes shared hosting safe, because one customer's script cannot touch another customer's files.
The latest version of suPHP, 0.7.2, was released in 2013 to fix a security vulnerability. A community fork was started at lightsey/mod_suphp, though no releases were created. A fork is a copy of a project that someone else takes over and continues separately. suPHP used to be a major component of shared hosting providers, built on the idea that a customer should not be able to read or modify another customer's files.
The permissions on the binary
The main binary lives at /usr/sbin/suphp. Its permissions are described as follows:
- root (the user) owns this file and can read (
r) and write (w) it. The setuid flag is also present (s). - nobody (the group) can read (
r) and execute (x) this binary. - no one else can read, write, or invoke suPHP.
Linux permissions are usually shown as a short string of letters. r means read, w means write, x means execute (run the file as a program), and s in the place where x would normally be means the setuid flag is set. A group is a collection of user accounts that share permissions. Here the group is called nobody, which is a conventional name for an account with almost no rights. The important point is that only the nobody group can read and execute suPHP, and the setuid flag is present.
The configuration file
The suPHP configuration file living at /etc/suphp.conf controls how paranoid suPHP should be before executing scripts. A configuration file is a plain text file of settings that a program reads when it starts. The report starts with the most restrictive options:
; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
Line by line:
; Security optionsis a comment. The semicolon tells the program to ignore the rest of the line; it is there for humans.allow_file_group_writeable=falsesays suPHP will refuse to run a script file that members of its group are allowed to modify.allow_file_others_writeable=falsesays it will refuse a script file that anyone else on the system is allowed to modify.allow_directory_group_writeable=falseandallow_directory_others_writeable=falseapply the same rule to the folder the script sits in.
These four options are there to prevent script execution from a file or directory that is writeable by a large set of users, as that would allow anyone to run custom scripts. In other words, if many people can edit a file, one of them could slip in malicious code, so suPHP simply refuses.
The next settings are:
; Minimum UID
min_uid=100
; Minimum GID
min_gid=100
A gid is a group identifier, the group equivalent of a uid. suPHP uses the file ownership information to determine who is running the binary. The min_{g,u}id option prevents malicious users from running most Linux binaries which are (conveniently) owned by root. Being able to just run /bin/bash as root would have made the task much easier, the authors note with a smiley. In plain terms: the min_{g,u}id option prevents malicious users from running most Linux binaries, which are owned by root.
suPHP will also refuse to execute scripts that are not in the docroot directory. The docroot is the folder that is allowed to contain web content. In this case it was set to /, the very top of the filesystem, which means every folder on the machine qualified. Setting it to /home/ would not have helped much either, the authors note.
Finally, at compile time it is possible to enable the PARANOID mode. Compile time means when the program is built from its source code, before it is installed. When enabled, the web server tells suPHP which user is expected to be the owner. In case of a mismatch, suPHP exits with an error message.
The configuration file goes on to define a list of supported handlers, which the web server picks. A handler is a rule that says "when you see this kind of request, run it this way". This is how one Apache instance was backed by multiple PHP versions:
[handlers]
;Handler for php-scripts
x-httpd-php="php:/usr/bin/php"
;Handler for CGI-scripts
x-suphp-cgi="execute:!self"
Line by line:
[handlers]opens a section of the file named handlers.;Handler for php-scriptsis a comment describing the next line.x-httpd-php="php:/usr/bin/php"defines a handler calledx-httpd-phpthat runs PHP using the program at/usr/bin/php.;Handler for CGI-scriptsis another comment.x-suphp-cgi="execute:!self"defines a handler calledx-suphp-cgithat executes a file directly. CGI stands for Common Gateway Interface, an old standard way for a web server to hand a request to a separate program and get its output back.
The PHP handlers invoke PHP and only support loading .php files. The x-suphp-cgi handler is magic, in the authors' words, and will run any file with the +x flag set, meaning any file marked as executable. This handler does not let you specify command line arguments, the extra words you would normally type after a program name to change its behaviour. But you can override the environment variables that are not one of:
LD_PRELOADLD_LIBRARY_PATHPHPRC
and more suPHP specific variables.
Environment variables are named values that a program receives from whatever launched it, a bit like the settings and notes a courier hands over with a parcel. LD_PRELOAD and LD_LIBRARY_PATH tell the system to load extra code before a program starts, and PHPRC tells PHP where to find its configuration. Those three are blocked because they are classic ways to sneak code into a setuid program. Fellow infosec engineers will recognise these variables are commonly abused to inject code into setuid binaries, but not today, the authors write.

The image is a reaction GIF captioned "Not today, satan!", placed right after the point that the usual setuid injection variables are blocked. It is the authors' joke about the obvious attack being closed off.
À l'attaque
We started with a regular Linux user on a shared web hosting platform. A lot of daemons try to reduce their footprint by running as the (presumed!) unprivileged user nobody. A daemon is a program that runs in the background without anyone sitting in front of it, such as a web server or a database. Running as nobody is a safety measure: if the daemon is compromised, the attacker only gets the rights of an almost powerless account.
In this case, the researchers found a UNIX socket for php-fpm with the o+w permission. A UNIX socket is a special file that two programs on the same machine use to talk to each other, like a private letterbox inside the computer. php-fpm is a program that runs PHP scripts on behalf of the web server. The permission o+w means "others can write": anyone on the machine is allowed to drop messages into that letterbox. Since we can send requests through it and execute arbitrary PHP code, the researchers could run their own PHP. That let them downgrade their UID/GID to nobody, that is, deliberately drop to the least powerful account.
Using our new privileges, we can now invoke suPHP as follows:
SUPHP_HANDLER=x-suphp-cgi \
SUPHP_USER=user \
SUPHP_GROUP=group \
SCRIPT_FILENAME=/tmp/hello \
DOCUMENT_ROOT=/ \
/sbin/suphp
Line by line:
SUPHP_HANDLER=x-suphp-cgiselects the handler from the configuration file that runs any executable file.SUPHP_USER=userandSUPHP_GROUP=grouptell suPHP which user and group own the script, so it will accept it.SCRIPT_FILENAME=/tmp/hellois the file to run./tmpis a scratch folder that every user can write to.DOCUMENT_ROOT=/sets the allowed content folder to the top of the filesystem, matching the permissive setting in the configuration./sbin/suphpis the program being launched.- The backslashes at the end of each line simply mean "the command continues on the next line"; they are a formatting convenience, not part of the values.
suPHP being meant to be invoked by Apache as a CGI, environment variables are used to pass options. We used a handler defined in the configuration file (x-suphp-cgi), filled SCRIPT_FILENAME with the command we want to execute, and set SUPHP_{USER,GROUP} with a value matching the ownership information for this binary, so suPHP won't reject it. The curly braces are shorthand meaning "both SUPHP_USER and SUPHP_GROUP".
We confirmed nobody could run binaries as our user by creating a hello world executable at /tmp/hello and having suPHP execute it. It worked. A hello world program is the simplest possible program, used to prove that the machinery works before trying anything ambitious.
Finding an executable file to run
Now, we would like to gain new privileges. Let's start by looking at the list of users we can target using getent:
nobody@my-party# getent passwd | awk -F: '$3 > 100 {print $1}'
serviceA
serviceB
serviceC
[..snip..]
supportA
supportB
supportC
[..snip..]
customerA
customerB
customerZ
[..snip..]
Line by line:
nobody@my-party#is the shell prompt: it shows the current user (nobody), the machine name (my-party) and a#meaning the command is being typed. The prompt is not part of the command.getent passwdasks the system for its list of user accounts.getentis a standard tool for looking things up in system databases.- The
|symbol is a pipe: it takes the output of the command on its left and feeds it to the command on its right. awk -F: '$3 > 100 {print $1}'is a small text-processing program.-F:says fields are separated by colons, which is how the user list is formatted.$3 > 100keeps only lines whose third field, the uid, is greater than 100.{print $1}prints the first field, the username.- The output lines are usernames.
[..snip..]marks where the report cut out further names.
Note: the names were replaced with dummy values. From this we learned that we can try to run commands as a service, as a support user or as a customer. Support users are intended to be able to troubleshoot issues on company services, and are most likely to be able to execute commands as root, which makes them an interesting target for us. The reasoning is simple: a support person needs broad powers to fix things, so their account is the most valuable one to borrow.
Using more CLI magic, we try to find executable files that are owned by each service or support person. CLI means command line interface, the text-only way of controlling a computer by typing commands.
nobody@my-party# find / -user serviceA -executable -exec ls -ldb {} \; 2>/dev/null
[..snip..]
Line by line:
find /searches the whole filesystem, starting at the top folder/.-user serviceAkeeps only files owned by the accountserviceA.-executablekeeps only files that can be run as programs.-exec ls -ldb {} \;runs thelscommand on each match to show its details.{}is replaced by the file name, and\;marks the end of the command to run.2>/dev/nullthrows away error messages. The2refers to the error output, and/dev/nullis a special file that discards anything written to it. Without this, the screen would fill with "permission denied" lines.
With no luck, which was to be expected as we can't list the files contained in support-users' home directories. A home directory is the personal folder of an account, and on a shared host it is normally private.
Using a bit of brute force, digging through the /var/log journals, and a bit of luck, we found a script in a support person's home, written using bash. Brute force means trying many possibilities systematically rather than being clever. /var/log is the folder where the system keeps its logs, the running records of what happened. Bash is the standard command-line shell on Linux, the program that reads and runs typed commands and scripts. And that's okay, we only need one, the authors add: a single executable script owned by a support user is enough.
Injecting code into the process
All that's left for us is to inject our own code into this process running as someone else. This is actually easier to do than it sounds, and if you read the formidable documentation of bash you'll find the following paragraph:
When bash is started non-interactively, to run a shell script, for example, it looks for the variable
BASH_ENVin the environment, expands its value if it appears there, and uses the expanded value as the name of a file to read and execute. Bash behaves as if the following command were executed:if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fibut the value of thePATHvariable is not used to search for the file name.
In plain words: when bash runs a script automatically, without a human typing at it, it first checks whether an environment variable called BASH_ENV exists. If it does, bash treats its value as the name of a file and runs that file first. The quoted command is the logic in shell syntax: if BASH_ENV is set and non-empty, source it. Sourcing means reading the file and running its contents as if they had been typed. PATH is the list of folders the system searches for programs; the note says bash does not use it here, so the value must be a full path.
We created a bash script in /tmp/pwn.sh, as a proof-of-concept. A proof of concept is a minimal demonstration that an attack works, without doing any real damage.
$ /tmp/pwn.sh
id >> /tmp/knock-knock
Line by line:
$ /tmp/pwn.shshows the script being run. The$is a generic prompt symbol.id >> /tmp/knock-knockis the content of the script.idis a command that prints who you are: your uid, gid and groups.>>means append the output to a file instead of printing it on screen. So the script quietly records the identity it ran under into/tmp/knock-knock. The file name is a joke: it is the attacker knocking to see who answers.
We prepend our suPHP invocation with BASH_ENV=/tmp/pwn.sh, provided the script to execute, and it worked. We can now run code as this user. Here is the final incantation, performed over FastCGI. FastCGI is the protocol used to talk to php-fpm through its socket.
BASH_ENV=/tmp/pwn.sh \
SUPHP_HANDLER=x-suphp-cgi \
SUPHP_USER=user \
SUPHP_GROUP=group \
SCRIPT_FILENAME=/home/supportA/myawesomescript.sh \
DOCUMENT_ROOT=/ \
/sbin/suphp
Line by line:
BASH_ENV=/tmp/pwn.shis the new part. It tells bash, when it starts to run the target script, to first run the attacker's file.SUPHP_HANDLER=x-suphp-cgiagain selects the handler that runs any executable file.SUPHP_USER=userandSUPHP_GROUP=groupare set to match the ownership information for the binary so suPHP accepts it.SCRIPT_FILENAME=/home/supportA/myawesomescript.shpoints at the script found in the support user's home directory.DOCUMENT_ROOT=/keeps the content folder at the top of the filesystem./sbin/suphplaunches suPHP.
Because the target script is a bash script, bash reads BASH_ENV when it starts non-interactively and sources the file named there before running the script, so the attacker's code executes in the context of the support user. The key insight is that suPHP blocks a few dangerous variables but not BASH_ENV.
Privilege escalation
Privilege escalation means moving from a less powerful account to a more powerful one. As we expected, we ran sudo -l and noticed that our new identity was able to run commands like gdb, strace, tail with the highest level of privileges and without having to provide a password. sudo is the standard Linux tool for running a command as another user, usually root. sudo -l lists what the current user is allowed to run through sudo. gdb is a debugger, strace traces system calls, and tail shows the end of a file; all three are ordinary diagnostic tools, but any of them can be told to run another program.
The final privilege escalation is easy then as pie:
$ sudo -u root strace -o /dev/null /bin/id
uid=0(root) gid=0(root) groups=0(root)
Line by line:
$is the prompt.sudo -u rootmeans run the following command as the user root.strace -o /dev/nullruns the tracing tool and sends its own output to/dev/null, so the screen stays clean./bin/idis the program strace is told to run. Because strace itself is running as root, the program it launches also runs as root.- The output
uid=0(root) gid=0(root) groups=0(root)is the proof: uid 0 is root, and the command reports it is running as root with root's group. The escalation is complete.
Conclusion
While a fork is still maintained on GitHub, there isn't really any reason to keep using suPHP in 2020. PHP-FPM can be configured with UID-isolated pools of processes, completely avoiding the risk of running code as an unintended user. A pool is a group of worker processes; isolating them by uid means each customer's scripts run under their own account by design, without an old setuid helper in the middle.
In our case study, suPHP was only a residue of previous deployments and was not necessary anymore. If you don't use it, remove it. The authors' advice is simple: if you do not use suPHP, remove it.
Glossary
- Apache: a widely used web server program that receives browser requests and returns web pages.
- API: an interface that lets one program ask another program to do something, without needing to know how it works inside.
- Bash: the standard Linux command-line shell, which reads and runs typed commands and scripts.
- BASH_ENV: an environment variable that tells bash to run a named file before a non-interactive script.
- Binary: a compiled program file that the computer can run directly.
- Bug bounty: a programme where a company rewards outside researchers for finding and reporting security problems.
- CGI: Common Gateway Interface, an old standard for a web server to pass a request to a separate program.
- CLI: command line interface, controlling a computer by typing text commands.
- Compile time: the moment a program is built from source code, before installation.
- Configuration file: a plain text file of settings that a program reads when it starts.
- Daemon: a program that runs in the background without a person operating it.
- Docroot: the folder allowed to contain web content that a server will execute.
- Environment variable: a named value passed to a program by whatever launched it.
- FastCGI: a protocol for a web server to send requests to a separate program such as
php-fpm. - Fork: a copy of a software project continued separately by someone else.
- GID: group identifier, the number the system uses to identify a group.
- Group: a collection of user accounts that share permissions.
- Handler: a rule in a server configuration saying how to process a particular kind of request.
- Home directory: the personal folder belonging to a user account.
- LD_LIBRARY_PATH: an environment variable that tells the system where to find extra code libraries.
- LD_PRELOAD: an environment variable that tells the system to load extra code before a program starts.
- Module: an optional add-on that plugs into a larger program to add features.
- o+w: a permission meaning "others can write", so anyone on the machine may modify or send to it.
- PARANOID mode: a suPHP build option that makes it check the expected owner of a script and refuse on mismatch.
- PHP: a programming language used to build websites.
- php-fpm: a program that runs PHP scripts on behalf of a web server.
- PHPRC: an environment variable that tells PHP where to find its configuration.
- Pipe (
|): a shell symbol that feeds the output of one command into another. - Privilege escalation: moving from a less powerful account to a more powerful one.
- Proof of concept: a minimal demonstration that an attack works.
- Root: the most powerful user on a Linux system, able to do anything.
- Setuid: a flag on a program that makes it run with the permissions of its owner rather than the caller.
- Shared hosting: one server hosting websites for many customers at once.
- Shell: the program that reads and runs typed commands.
- Socket: a special file that programs on the same machine use to exchange messages.
- Source (a file): to read a file and run its contents as if they had been typed.
- sudo: the standard Linux tool for running a command as another user, usually root.
- suPHP: an old tool that runs PHP scripts with the permissions of their owners, using a setuid root binary.
- UID: user identifier, the number the system uses to identify a user.
- UNIX socket: a socket used for communication between programs on the same machine.
- Web server: software that receives browser requests and sends back web pages.