I have some free time so I'm testing various local vulnerable machines. In one particular lab machine, you first have to gain administration panel, and then use the available "insert" command and write a textual file to the directory. The service in the background is checking is file written.
I did find administration panel password but not by using SQL injection over SELECT statement but through connecting to a network with port that resolve the username and password. Now, as far as I know, if there was SQL injection vulnerability over SELECT, I could easily INTO OUTFILE particular column to the data file, but this time, I'll have to use INSERT as the input is sent through admin panel to the mysql query. I'm interested is there equivalent command or payload to INTO OUTFILE using INSERT or any other way around. I'm thinking about using MySQL LOAD DATA but I can't wrap my head around it.
The call shall be made like this:
LOAD DATA INFILE 'foo.txt' INTO TABLE t FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (name, address, city, @skip, state, @skip, ...) [ SET col = <expr>, ... ]
One more thing, I successfully loaded the file from the file system using load_file('filename') so I have granted user account at least for reading.
Machine: Linux RS x11 CERT UTIC (Testing lab)
Database: MySQL 5.x
Application language: PHP
Thanks and kind regards.