[工具]sqlmap初步了解(一)

靶场:SqliLabs

sqlmap 1.4.7

一、sqlmap的目标(Taget)和请求(Request)


// 用法: 运行python3 sqlmap [参数],或sqlmap [参数]

Usage: python3 sqlmap [options]


// 参数

Options:

// -h, --help: 打印帮助信息并退出

-h, --help            Show basic help message and exit

// 打印详细的帮助信息并退出

-hh                   Show advanced help message and exit

// 显示程序的版本号并退出

--version             Show program's version number and exit

// 显示信息的级别

  • 0:只显示python 错误和一些严重信息
  • 1:显示基本信息(默认)
  • 2:显示debug信息
  • 3:显示注入过程的payload
  • 4:显示http请求包
  • 5:显示http响应头
  • 7:显示http相应页面

-v VERBOSE            Verbosity level: 0-6 (default 1)

// 目标

// 必须至少提供其中一个选项来定义目标

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

// 指定URL

-u URL, --url=URL   Target URL (e.g. "http://www.site.com/vuln.php?id=1")

// sqlmap -u "http://192.168.23.204:8003/Less-1/?id=1"

// 连接数据库,提供数据库连接的连接字符串

-d DIRECT           Connection string for direct database connection

e.g. 'mysql://USER:PASSWORD@DBMS_IP:DBMS_PORT/DATABASE_NAME' or 'access://DATABASE_FILEPATH'

// sqlmap -d "mysql://admin:admin@192.168.23.204:3306/security" --dbs

// 日志文件,使用Burp或WebScarab代理的日志

// 例如: sqlmap -l log1.txt

-l LOGFILE          Parse target(s) from Burp or WebScarab proxy log file

// 文本文件中的多个目标

// 例如: sqlmap -m url.txt

-m BULKFILE         Scan multiple targets given in a textual file

// 从文件中加载HTTP请求,将一个post请求方式的数据包保存在一个txt中,使用sqlmap读取请求

// 例如:sqlmap post1.txt

-r REQUESTFILE      Load HTTP request from a file

// 使用google检索方式的网址,可以多目标检测

// 例如:sqlmap -g "inurl:.php?id=1"

-g GOOGLEDORK       Process Google dork results as target URLs

// 从配置INI文件加载选项

-c CONFIGFILE       Load options from a configuration INI file


// 请求

// 这些选项可用于指定如何连接到目标URL

Request:

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

// 指定User-Agent的值

-A AGENT, --user-agent  HTTP User-Agent header value

// 指定Header的值

-H HEADER, --headers  Extra header (e.g. "X-Forwarded-For: 127.0.0.1")

// sqlmap -u "http://192.168.23.204:8003/Less-1/?id=1" -H "X-Forwarded-For: 127.0.0.1"

// 指定请求方法

--method=METHOD     Force usage of given HTTP method (e.g. PUT)

// 指定POST发送的数据的参数名和值

--data=DATA         Data string to be sent through POST (e.g. "id=1")

// sqlmap -u "http://192.168.23.204:8003/Less-11/" --data "uname=1&passwd=2"

// 指定分隔参数的字符

--param-del=PARA..  Character used for splitting parameter values (e.g. &)

// 指定使用的cookie值

--cookie=COOKIE     HTTP Cookie header value (e.g. "PHPSESSID=a8d127e..")

// 指定cookie的参数分隔符

--cookie-del=COO..  Character used for splitting cookie values (e.g. ;)

// 载入cookie值,从Netscape或wget格式的cookie的文件

--load-cookies=L..  File containing cookies in Netscape/wget format

// 忽略响应中响应头的Set-Cookie的头,默认sqlmap会更新响应更新cookie的值

--drop-set-cookie   Ignore Set-Cookie header from response

// 通过HTTP UA模拟智能手机

--mobile            Imitate smartphone through HTTP User-Agent header

// 使用随机生成的User-Agent

--random-agent      Use randomly selected HTTP User-Agent header value

// 设置请求头Host的值

--host=HOST         HTTP Host header value

// 设置请求头Referer的值

--referer=REFERER   HTTP Referer header value

// 同-H,设置请求头的键值

--headers=HEADERS   Extra headers (e.g. "Accept-Language: fr\nETag: 123")

// HTTP身份验证类型(Basic, Digest, NTLM, PKI)

--auth-type=AUTH..  HTTP authentication type (Basic, Digest, NTLM or PKI)

// HTTP使用的验证,例如 --auth-cred "user,password"

--auth-cred=AUTH..  HTTP authentication credentials (name:password)

// 使用.PEM文件的进行认证

--auth-file=AUTH..  HTTP authentication PEM cert/private key file

// 无视指定的HTTP状态码

--ignore-code=IG..  Ignore (problematic) HTTP error code (e.g. 401)

// 忽视系统的默认代理(即忽视本地代理)

--ignore-proxy      Ignore system default proxy settings

// 忽视重定向跳转

--ignore-redirects  Ignore redirection attempts

// 忽视超时连接

--ignore-timeouts   Ignore connection timeouts

// 使用代理连接到目标URL, 例如:--proxy "127.0.0.1:8080"

--proxy=PROXY       Use a proxy to connect to the target URL

// 设置代理使用的验证,例如:--proxy-cred "uname:passwd"

--proxy-cred=PRO..  Proxy authentication credentials (name:password)

// 从文件中载入代理验证

--proxy-file=PRO..  Load proxy list from a file

// 使用匿名网络

--tor               Use Tor anonymity network

// 设置tor代理的端口

--tor-port=TORPORT  Set Tor proxy port other than default

// 设置tor代理的类型,可以为HTTP,SOCKS4,SOCKS5(默认)

--tor-type=TORTYPE  Set Tor proxy type (HTTP, SOCKS4 or SOCKS5 (default))

// 检测Tor代理是否正常使用

--check-tor         Check to see if Tor is used properly

// 发送请求包的延迟,也就是探测的延迟,例如:--delay 2.5,表示每个2.5s发送一个请求

--delay=DELAY       Delay in seconds between each HTTP request

// 设置连接超时等待的时间,默认时30

--timeout=TIMEOUT   Seconds to wait before timeout connection (default 30)

// 设置连接超时,重连的次数,默认重连3次

--retries=RETRIES   Retries when the connection timeouts (default 3)

// 随机修改提交参数的值

--randomize=RPARAM  Randomly change value for given parameter(s)

// 测试期间保持URL连接,每隔一段时间,发送一个数据包保持session

--safe-url=SAFEURL  URL address to visit frequently during testing

// 和--safe-url一样,只是使用POST方式提交数据

--safe-post=SAFE..  POST data to send to a safe URL

// 和--safe-url一样,从文件中读取HTTP请求提交

--safe-req=SAFER..  Load safe HTTP request from a file

// 使用正确和错误的包间隔发送,保持连接期间的seeion

--safe-freq=SAFE..  Regular requests between visits to a safe URL

// 跳过URL编码

--skip-urlencode    Skip URL encoding of payload data

// 保持防止CSRF的Token

--csrf-token=CSR..  Parameter used to hold anti-CSRF token

// 访问URL地址获取防止CSRF的Token

--csrf-url=CSRFURL  URL address to visit for extraction of anti-CSRF token

// 使用防止CSRF的Token访问页面期间,使用的方法

--csrf-method=CS..  HTTP method to use during anti-CSRF token page visit

// 防止CSRF的令牌检索的重试次数(默认为0)

--csrf-retries=C..  Retries for anti-CSRF token retrieval (default 0)

// 强制使用SSL/HTTPS

--force-ssl         Force usage of SSL/HTTPS

// 使用HTTP分块传输编码(POST)请求

--chunked           Use HTTP chunked transfer encoded (POST) requests

// 使用HTTP参数污染方法

--hpp               Use HTTP parameter pollution method

// 发送请求之前,执行一段指定的Python代码

--eval=EVALCODE     Evaluate provided Python code before the request (e.g.
                        "import hashlib;id2=hashlib.md5(id).hexdigest()")

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值