Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does sqlmap quit when SSL connection fails after changing a proxy? #2665

Closed
Ekultek opened this issue Aug 22, 2017 · 3 comments
Closed
Assignees
Milestone

Comments

@Ekultek
Copy link
Contributor

Ekultek commented Aug 22, 2017

I've been working on a site for a couple days now and have noticed that everytime an SSL connection fails after changing a proxy, sqlmap will quit instead of attempting to change the proxy again (usually it happens with an HTTP proxy):


[10:55:39] [CRITICAL] connection timed out to the target URL or proxy. sqlmap is going to retry the request(s)
[10:55:50] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:56:01] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:56:01] [WARNING] changing proxy
[10:56:01] [INFO] loading proxy 'socks5://<PROXY>' from a supplied proxy list file
[10:56:01] [DEBUG] setting the HTTP/SOCKS proxy for all HTTP requests
[10:56:01] [DEBUG] creating HTTP requests opener object
[10:56:22] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:56:44] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:57:03] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:57:03] [WARNING] changing proxy
[10:57:03] [INFO] loading proxy 'socks5://<PROXY>' from a supplied proxy list file
[10:57:03] [DEBUG] setting the HTTP/SOCKS proxy for all HTTP requests
[10:57:03] [DEBUG] creating HTTP requests opener object
[10:57:14] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:57:25] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:57:35] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:57:35] [WARNING] changing proxy
[10:57:35] [INFO] loading proxy 'socks5://<PROXY>' from a supplied proxy list file
[10:57:35] [DEBUG] setting the HTTP/SOCKS proxy for all HTTP requests
[10:57:35] [DEBUG] creating HTTP requests opener object
[10:57:46] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:58:04] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:58:15] [DEBUG] connection timed out to the target URL or proxy. sqlmap is going to retry the request
[10:58:15] [WARNING] changing proxy
[10:58:15] [INFO] loading proxy 'http://<PROXY>' from a supplied proxy list file
[10:58:15] [DEBUG] setting the HTTP/SOCKS proxy for all HTTP requests
[10:58:15] [DEBUG] creating HTTP requests opener object
[10:58:20] [DEBUG] SSL connection error occurred ('''')
[10:58:31] [DEBUG] SSL connection error occurred ('_ssl.c:645: The handshake operation timed out')
[10:58:41] [DEBUG] SSL connection error occurred ('_ssl.c:645: The handshake operation timed out')
[10:58:52] [DEBUG] SSL connection error occurred ('_ssl.c:645: The handshake operation timed out')
[10:58:52] [CRITICAL] can't establish SSL connection

[*] shutting down at 10:58:52

baal@baal-Aspire-5733Z:~/bin/python/sqlmap$ 

So my question being, is it possible for sqlmap to attempt to change the proxy (if a proxy file is given) instead of quitting after the SSL connection has failed. I'm aware that quitting due to this, is probably a good idea instead of looping around like a dumb dumb and trying to reconnect. But if the --proxy-file flag is provided, and it hits a proxy that can't establish an SSL connection, then can we just try to change the proxy until we get one that works, instead of ending the session?

This way the user won't have to find the proxy that failed and delete it, saves everyone some trouble..

@Ekultek
Copy link
Contributor Author

Ekultek commented Aug 23, 2017

Sweet, only thing is it tries to connect 9 times before changing the proxy, if you want I think three or four would be enough:


[09:05:52] [INFO] loading proxy 'http://85.91.207.91:53281' from a supplied proxy list file
[09:05:52] [DEBUG] setting the HTTP/SOCKS proxy for all HTTP requests
[09:05:52] [DEBUG] creating HTTP requests opener object
[09:06:02] [DEBUG] SSL connection error occurred ('timed out')
[09:06:12] [DEBUG] SSL connection error occurred ('timed out')
[09:06:22] [DEBUG] SSL connection error occurred ('timed out')
[09:06:32] [DEBUG] SSL connection error occurred ('timed out')
[09:06:32] [CRITICAL] unable to connect to the target URL ('can't establish SSL connection'). sqlmap is going to retry the request
[09:06:42] [DEBUG] SSL connection error occurred ('timed out')
[09:06:52] [DEBUG] SSL connection error occurred ('timed out')
[09:07:02] [DEBUG] SSL connection error occurred ('timed out')
[09:07:12] [DEBUG] SSL connection error occurred ('timed out')
[09:07:12] [CRITICAL] unable to connect to the target URL ('can't establish SSL connection'). sqlmap is going to retry the request
[09:07:22] [DEBUG] SSL connection error occurred ('timed out')
[09:07:32] [DEBUG] SSL connection error occurred ('timed out')
[09:07:42] [DEBUG] SSL connection error occurred ('timed out')
[09:07:52] [DEBUG] SSL connection error occurred ('timed out')
[09:07:52] [CRITICAL] unable to connect to the target URL ('can't establish SSL connection'). sqlmap is going to retry the request
[09:07:52] [WARNING] changing proxy
[09:07:52] [INFO] loading proxy 'socks5://179.218.136.119:40962' from a supplied proxy list file
[09:07:52] [DEBUG] setting the HTTP/SOCKS proxy for all HTTP requests
[09:07:52] [DEBUG] creating HTTP requests opener object
[09:07:52] [DEBUG] unable to connect to the target URL ('Connection refused') or proxy. sqlmap is going to retry the request
[09:07:52] [DEBUG] unable to connect to the target URL ('Connection refused') or proxy. sqlmap is going to retry the request
there seems to be a continuous problem with connection to the target. Are you sure that you want to continue with further target testing? [y/N] 

stamparm added a commit that referenced this issue Aug 28, 2017
@stamparm
Copy link
Member

@Ekultek with latest revision there will be less connection attempts

@Ekultek
Copy link
Contributor Author

Ekultek commented Aug 28, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants