首页 > 数据库 >sqlmap工具学习

sqlmap工具学习

时间:2023-03-30 22:44:38浏览次数:51  
标签:sqlmap DBMS database -- 数据库 学习 工具 options

tryhackme:sqlmap

github:https://github.com/sqlmapproject/sqlmap

kali集成

参数介绍

sqlmap -h

        ___
       __H__
 ___ ___[(]_____ ___ ___  {1.7.2#stable}
|_ -| . ["]     | .'| . |
|___|_  [']_|_|_|__,|  _|
      |_|V...       |_|   https://sqlmap.org

Usage: python3 sqlmap [options]

Options:
  -h, --help            Show basic help message and exit
  -hh                   Show advanced help message and exit
  --version             Show program's version number and exit
  -v VERBOSE            Verbosity level: 0-6 (default 1)

  Target:
    At least one of these options has to be provided to define the
    target(s)

    -u URL, --url=URL   Target URL (e.g. "http://www.site.com/vuln.php?id=1")
    -g GOOGLEDORK       Process Google dork results as target URLs

  Request:
    These options can be used to specify how to connect to the target URL

    --data=DATA         Data string to be sent through POST (e.g. "id=1")
    --cookie=COOKIE     HTTP Cookie header value (e.g. "PHPSESSID=a8d127e..")
    --random-agent      Use randomly selected HTTP User-Agent header value
    --proxy=PROXY       Use a proxy to connect to the target URL
    --tor               Use Tor anonymity network
    --check-tor         Check to see if Tor is used properly

  Injection:
    These options can be used to specify which parameters to test for,
    provide custom injection payloads and optional tampering scripts

    -p TESTPARAMETER    Testable parameter(s)
    --dbms=DBMS         Force back-end DBMS to provided value

  Detection:
    These options can be used to customize the detection phase

    --level=LEVEL       Level of tests to perform (1-5, default 1)
    --risk=RISK         Risk of tests to perform (1-3, default 1)

  Techniques:
    These options can be used to tweak testing of specific SQL injection
    techniques

    --technique=TECH..  SQL injection techniques to use (default "BEUSTQ")

  Enumeration:
    These options can be used to enumerate the back-end database
    management system information, structure and data contained in the
    tables

    -a, --all           Retrieve everything
    -b, --banner        Retrieve DBMS banner
    --current-user      Retrieve DBMS current user
    --current-db        Retrieve DBMS current database
    --passwords         Enumerate DBMS users password hashes
    --dbs               Enumerate DBMS databases
    --tables            Enumerate DBMS database tables
    --columns           Enumerate DBMS database table columns
    --schema            Enumerate DBMS schema
    --dump              Dump DBMS database table entries
    --dump-all          Dump all DBMS databases tables entries
    -D DB               DBMS database to enumerate
    -T TBL              DBMS database table(s) to enumerate
    -C COL              DBMS database table column(s) to enumerate

  Operating system access:
    These options can be used to access the back-end database management
    system underlying operating system

    --os-shell          Prompt for an interactive operating system shell
    --os-pwn            Prompt for an OOB shell, Meterpreter or VNC

  General:
    These options can be used to set some general working parameters

    --batch             Never ask for user input, use the default behavior
    --flush-session     Flush session files for current target

  Miscellaneous:
    These options do not fit into any other category

    --wizard            Simple wizard interface for beginner users

[!] to see full list of options run with '-hh'

基础命令

-u URL, --url=URL          目标URL,比如 "http://www.site.com/vuln.php?id=1"

--data=DATA                通过 POST 发送的数据字符串,比如 "id=1"

--random-agent             使用随机选择的 HTTP User-Agent 标头值

-p TESTPARAMETER           可测试参数(parameter)

--level=LEVEL              要执行的测试级别(1-5,默认 1)

--risk=RISK                执行测试的风险等级(1-3,默认 1)

枚举命令

-a, --all                  检索所有内容

-b, --banner               检索DBMS(数据库管理系统,常见的有MySql等)的banner(横幅)

--current-user             检索DBMS当前用户

--current-db               检索DBMS当前数据库

--passwords                枚举DBMS的用户密码哈希

--dbs                      枚举DBMS所有数据库

--tables                   枚举DBMS数据库中的表

--columns                  枚举DBMS数据库中表的列

--schema                   枚举DBMS的schema(模式、架构)

--dump                     转储DBMS的数据库中的表的条目

--dump-all                 转储DBMS的数据库中所有表的条目

--is-dba                   检测DBMS的当前用户是否为DBA(数据库管理员)

-D <DB NAME>               指定要枚举的DBMS数据库——指定数据库

-T <TABLE NAME>            指定要枚举的DBMS数据库中的表——指定表名

-C COL                     指定要枚举的DBMS数据库中的表的列——指定列名

用于操作系统

--os-shell                 获取交互式的操作系统shell

--os-pwn                   获取一个OOB shell:Meterpreter会话 或者 VNC(Virtual Network Console); OOB是指 out-of-band,带外数据

--os-cmd=OSCMD             执行操作系统命令

--priv-esc                 数据库进程用户提权

--os-smbrelay              一键获取一个OOB shell、Meterpreter会话 或者 VNC(Virtual Network Console)

请求方式

get

sqlmap -u https://testsite.com/page.php?id=7 --dbs

直接修改想要请求的参数即可

post

只要修改参数部分即可

1. sqlmap -u https://testsite.com/page.php? --data "id=1" --dbs

2.使用bp抓包,保存到文件中,假设保存文件中post参数为id,文件为sql.txt
sqlmap -r sql.txt -p id --dbs

通用

--current-db   //爆破当前正在使用数据库,假设为database
-D database --tables //爆破当前数据库中的表 假设有table

-D database -T table --columns //爆破表的列名 假设为column
-D database -T table -C column --dump //获取当前字段的值

-D database --dump-all //转储DBMS的数据库中所有表的条目

标签:sqlmap,DBMS,database,--,数据库,学习,工具,options
From: https://www.cnblogs.com/-Lucky-/p/17274625.html

相关文章

  • Docker 轻量级可视化工具 Portainer
    1.概述Portainer是一款轻量级的应用,它提供了图形化界面,用于方便地管理Docker环境,包括单机环境和集群环境。官网:https://www.portainer.io/2.在Docker镜像仓库查找Portainer镜像dockerhub镜像仓库3.拉取Portainer镜像#拉取nginx镜像dockerpullportainer......
  • 苏格拉底学习法
    苏格拉底教学法(Socraticmethod)是一种以提问为基础的教学方法,其名称来源于古希腊哲学家苏格拉底。这种教学法的主要原则是通过提问来引导学生思考和探究问题,而不是直接告诉他们答案。通过这种方式,学生可以更深入地理解问题,并在思考的过程中形成自己的观点和见解。苏格拉底教学法......
  • 农业研究领域的R包工具
    爱达荷大学的统计学顾问JuliaPiaskowski总结的关于R包在农业研究领域应用的一个概括。关于JuliaPiaskowski:https://jpiaskowski.gitlab.io/来自agstats_2022_poster更多信息:https://agstats.io/events/presentations/agstats-conference-2022/......
  • 3.30软件工程学习总结
    今天由于课程较多,没有较多的时间学代码,但也有点时间基本上完成了团队外包杯项目的简单的展示页面设计制作。今天还思考了,觉得自己差的还是挺多的,以后在完成了团队内我能完成的任务后,在可利用的时间里还是要学习更多的内容,学习别人做的部分。......
  • 文件的简单学习
    文件输入输出:用>和<做重定向,>是把输入写进另一个文件,<是从文件中获取1FILE*fopen(constchar*resrictpath,constchar*restrictmode);2intfclose(FILE*stream);3fscanf(FILE*,...)打开文件的标准代码:1FILE*fp=fopen("file","r");2if(fp){3fscanf(......
  • Doker学习
    一、安装官网:www.docker.com安装步骤(CenteOS7)yum包更新到最新yumupdate安装需要的软件包,yum-util提供yum-config-manager功能,另外两个是devicemapper驱动依赖的#-y:意思是需要输入Y运行下一步的自动帮我们键入Yyuminstall-yyum-utilsdevice-mapper-persistent......
  • 又一款眼前一亮的Linux终端工具!
    大家好,我是良许。最近二舅视频刷爆了全网,大家有没去看呢?强烈推荐大家观看一波,也就11分钟,保证会触动你的泪点。不过今天不讲二舅哈,还是来聊聊技术。今天给大家介绍一款最近发现的功能十分强大,颜值非常高的一款终端工具。这个神器我是在其他公众号文章上看到的,但他们都没把它的......
  • MATLA 5G工具箱---无线通信入门之旅
    基于MATLABR2022b版软件学习!官方提供正版的无线通信入门教程:无线通信入门之旅(mathworks.com)B站也有官方相应的通信视频:MATLAB中国的个人空间_哔哩哔哩_bilibili......
  • 密码学SAT入门003——关于流密码入门算法A5-1的学习
      电子科技大学《现代密码学》慕课截图——感谢聂旭云、廖永建、熊虎等几位老师的讲解                                         算法code A5_1.algprogramdescribe......
  • m基于FC全卷积网络和kalman的遮挡车辆跟踪算法matlab仿真,用matconvnet-1.0-beta20工
    1.算法描述1.1全卷积神经网络全卷积神经网络(FullyConvolutionalNetworks,FCN)是JonathanLong等人于2015年在FullyConvolutionalNetworksforSemanticSegmentation一文中提出的用于图像语义分割的一种框架,是深度学习用于语义分割领域的开山之作。我们知道,对于一个各层参数结......