I am trying to exploit the following sql (in SQL Server 2014):
declare @maliciousSQL nvarchar(max);
set @maliciousSQL = '???'
exec ('SELECT SUM(quantity) from mytable where id in ' + @maliciousSQL );
How can parameter @maliciousSQL be crafted to run any arbitrary sql? Assume the task is to execute command 'truncate table othertable' - is it doable?
Thanks to anyone for help