Sql Injection Fundamentals - ErrCode 13 then trying to right shell php to file

Hi all,

I’m working through the SQL Injection Fundamentals, and at the section entitled “Writing Files”.

As per the documentation on the page, I’ve been able to confirm the database is root, has ‘FILE’ privileges and that the ‘secure_file_prive’ is blank (NOT Null!).

However, when I trying to upload the payload of cn’ union select “”,‘<?php system($_REQUEST[0]); ?>’, “”, “” into outfile ‘/var/www/html/shell.php’ I get an error of “Can’t create/write to file ‘/var/www/html/shell.php’ (Errcode: 13 “Permission denied”)”.

Has anyone had this issue. Not entirely sure where I’m going wrong. The only thing I can think of is if root (I’ve confirmed we’re running MariaDB as root) doesn’t have access to that folder…

Any help would be appreciated. Many thanks, all.

For anyone having same issue and finding this on Google:

This situation was ‘resolved’ by refreshing the target IP/Box. My guess is that the box needing resetting as something just became broken.