Results 1 to 4 of 4

Thread: Issues with sqlmap, burp and SSL

  1. #1
    Join Date
    2013-Mar
    Posts
    1

    Issues with sqlmap, burp and SSL

    Hi everybody,

    in the process of slowly getting acquainted with Kali, I was running across a weird issue today when using sqlmap via burp on an https connection. It happened that the SSL handshake ran into an error:

    Code:
    # sqlmap -u https://a.b.c/test.aspx --proxy=http://localhost:8080 -v 3
    
        sqlmap/1.0-dev - automatic SQL injection and database takeover tool
        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 12:23:53
    
    [12:23:53] [DEBUG] cleaning up configuration parameters
    [12:23:53] [DEBUG] setting the HTTP timeout
    [12:23:53] [DEBUG] setting the HTTP method to GET
    [12:23:53] [DEBUG] setting the HTTP/SOCKS proxy for all HTTP requests
    [12:23:53] [DEBUG] creating HTTP requests opener object
    [12:23:53] [INFO] testing connection to the target url
    [12:23:53] [DEBUG] SSL connection error occured ('[Errno 1] _ssl.c:504: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error')
    The reason for this seems to be an issue with openssl when connecting to SSLv3 systems.

    I was able to fix it with a rather dirty hack and would love to hear about more decent solutions.

    This is what I did:

    Code:
    vi /usr/share/sqlmap/lib/request/httpshandler.py
    Remove ssl.PROTOCOL_SSLv23 from the _protocols list:

    Code:
    #_protocols = [ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1]
    _protocols = [ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1]
    Compile httpshandler.py:

    Code:
    python -m compileall /usr/share/sqlmap/lib/request/httpshandler.py
    After this, the handshake between sqlmap and burp works like a charm.

    But, I'd be very much interested in solutions that address the root cause of the issue.

    Cheerz,
    TC

  2. #2
    Join Date
    2013-Mar
    Posts
    3
    Great workaround! thanks tcf. There is need for forcing the SSL version to get this working.

    Same issue here using sqlmap 1.0-dev, burp 1.5.11, and OpenSSL 1.0.1e 11 Feb 2013. I get the following error:
    Code:
    [DEBUG] SSL connection error occured ('[Errno 1] _ssl.c:504: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error')

  3. #3
    Join Date
    2014-Sep
    Posts
    10

    Angry

    anyone a good solution for patching python requests lib in general?

    I keep getting an error when I want to use requests to post to burp https proxy:

    Code:
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<stdin>", line 6, in gogo
      File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 60, in get
        return request('get', url, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 49, in request
        return session.request(method=method, url=url, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 457, in request
        resp = self.send(prep, **send_kwargs)
      File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
        r = adapter.send(request, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 420, in send
        raise SSLError(e, request=request)
    requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error
    Last edited by xychix; 2014-11-12 at 12:16.

  4. #4
    root@kali:~# pip install requests[security]
    root@kali:~# pip install requests[security] --upgrade

    https://urllib3.readthedocs.org/en/latest/contrib.html

Similar Threads

  1. Burp Suite can't add webpage exception...
    By Mike9876 in forum General Archive
    Replies: 2
    Last Post: 2019-11-02, 01:49
  2. Burp Kali Java 8 and JYTHON
    By quarinteen in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2019-05-14, 19:59
  3. How do I burp style web form tamper with Nethunter?
    By Asynchronous in forum NetHunter General Questions
    Replies: 0
    Last Post: 2016-05-13, 00:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •