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

Connection reset by peer? (Tested on Exchange 2013, Server 2008) #13

Open
anonuser78 opened this issue Feb 4, 2019 · 9 comments
Open

Comments

@anonuser78
Copy link

I am having the problem on Windows

File "privexchange.py", line 221, in
main()
File "privexchange.py", line 140, in main
session.request("POST", ews_url, POST_BODY % (args.exchange_version, attacker_url), headers)
File "/usr/lib/python2.7/httplib.py", line 1042, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.7/httplib.py", line 1082, in _send_request
self.endheaders(body)
File "/usr/lib/python2.7/httplib.py", line 1038, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 882, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 844, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1263, in connect
server_hostname=server_hostname)
File "/usr/lib/python2.7/ssl.py", line 369, in wrap_socket
_context=self)
File "/usr/lib/python2.7/ssl.py", line 617, in init
self.do_handshake()
File "/usr/lib/python2.7/ssl.py", line 846, in do_handshake
self._sslobj.do_handshake()
socket.error: [Errno 104] Connection reset by peer

Any thoughts?

@anonuser78 anonuser78 changed the title Connection reset by peer? Connection reset by peer? (Tested on Exchange 2013, Server 2008) Feb 4, 2019
@alghammariosmah
Copy link

alghammariosmah commented Feb 7, 2019

I am having the same issue as I am testing on my local network from Ubuntu OS, did you solve it somehow?

@dirkjanm
Copy link
Owner

dirkjanm commented Feb 7, 2019

This seems to be SSL related and I can't really investigate this since I'm not in your environment.
It might be useful to see what openssl mentions when it connects to the same port with s_client:
openssl s_client -connect exchangeserver.local:443

@alghammariosmah
Copy link

I guess there were some broken packets with openssl in my current linux Kernel. So, what I did is just reinstall openssl using 'apt-get install --reinstall openssl' and it worked somehow.
Thanks for your quick response @dirkjanm

@anonuser78
Copy link
Author

anonuser78 commented Feb 11, 2019

that's what I've got :

CONNECTED(00000003)
write:errno=104

no peer certificate available

No client certificate CA names sent

SSL handshake has read 0 bytes and written 313 bytes
Verification: OK

New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)

Reinstalling openssl didn't solve the problem*

Is firewall blocking it?

@alghammariosmah
Copy link

@anonuser78 I don't which operating system you're using, but for me, I am using Ubuntu. I installed another Ubuntu in a Vrtualbox and somehow it works there, while it didn't work on my physical host Ubuntu. I thought it could be due to Openssl dependencies or maybe binaries. So that's why I reinstalled Openssl on my machine. It somehow worked

@anonuser78
Copy link
Author

anonuser78 commented Feb 11, 2019

@alghammariosmah I run it on a Kali Linux VM

@melid404
Copy link

I have had the same problem and fixed it by changing the following first line and adding the second and the third ones.

uv_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
uv_context.verify_mode = ssl.CERT_NONE
uv_context.check_hostname = False

Credit goes to https://twitter.com/den_n1s/status/1091502994351374337

@anonuser78
Copy link
Author

I have had the same problem and fixed it by changing the following first line and adding the second and the third ones.

uv_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
uv_context.verify_mode = ssl.CERT_NONE
uv_context.check_hostname = False

Credit goes to https://twitter.com/den_n1s/status/1091502994351374337

Can you, please, show me where/how to change it? Thank you!

@bu9brains
Copy link

bu9brains commented Aug 29, 2019

Tried as mentioned by @erkanaksoy and @alghammariosmah but still facing below error. Could you please help to resolve this?

#openssl s_client -connect xxxxx.xxx.xxxx:443

CONNECTED(00000003)
write:errno=104

no peer certificate available

No client certificate CA names sent

SSL handshake has read 0 bytes and written 311 bytes
Verification: OK

New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)

conne

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

No branches or pull requests

5 participants