Last updated
Last updated
To be able to write files to the back-end server using a MySQL database, three things are required:
User with FILE
privilege enabled
MySQL global secure_file_priv
variable not enabled
Write access to the location we want to write to on the back-end server
To write a web shell, we must know the base web directory for the web server (i.e. web root). One way to find it is to use load_file
to read the server configuration, like Apache's configuration found at /etc/apache2/apache2.conf
, Nginx's configuration at /etc/nginx/nginx.conf
, or IIS configuration at %WinDir%\System32\Inetsrv\Config\ApplicationHost.config
, or we can search online for other possible configuration locations. Furthermore, we may run a fuzzing scan and try to write files to different possible web roots, using or . Finally, if none of the above works, we can use server errors displayed to us and try to find the web directory that way.