tintinweb / scapy-ssl_tls

SSL/TLS layers for scapy the interactive packet manipulation tool
GNU General Public License v2.0
419 stars 156 forks source link

Name Error with TLSSocket #42

Closed ch4174nya closed 9 years ago

ch4174nya commented 9 years ago

Hi, I tried executing the full_rsa_connection_with_application_data.py file given in the examples directory, with a correct server and port as command line arguments, but ended up receiving a Name Error, stating "global name 'TLSSocket' is not defined". I am not clear as to what am I missing here? Any ideas? Besides, I am able to run the other files-client_hello_valid.py without any issues.

Thanks,

alexmgr commented 9 years ago

Hi Chaitanya,

Thanks for reporting this. Some assumptions where made in the import statement. It should be fixed in master with commit 8c9be769e95d373bd0bfe60c94a744a4b4c45d52. Could you clone master and give it a try?

ch4174nya commented 9 years ago

I had installed scapy-ssl_tls with pip, and had cloned the repo's examples directory as a reference/tutorial. As you mentioned above, I tried the recent version of the python file and it still gives the same error. Will I have to reinstall scapy-ssl_tls, and from source this time?

alexmgr commented 9 years ago

Ah, I may get what's happening. You may have an outdated version of scapy-ssl_tls installed through pip. Could you try and upgrade it? I believe that should fix your issue. Otherwise yes, you will have to do a git clone https://github.com/tintinweb/scapy-ssl_tls and run the examples from there. Currently you may be running the examples against an older version of scapy-ssl_tls. TLSSocket was integrated in 1.2 which was released just a few days ago.

ch4174nya commented 9 years ago

Spot on! That fixed that. But I have an NotImplementedError being reported now. I am trying to reach a lighttpd ssl server, wherein I get this error. I guess it could be that lighttpd doesn't support the cipher suites that the python file is using. Any suggestions where I could tweak?

scapy-ssl_tls

alexmgr commented 9 years ago

Cool. You're getting a TLS Alert back from your server. This means that something went wrong during the handshake. As you mentioned it may be the cipher-suite offered by the python client, the TLS version requested, or a number of other things.

You can change the version and cipher_suites in tls_hello() and give it a try.

As you see, the examples are only just that, and need tweaking and error checking to achieve what you wish. Good luck and thanks for using the tool!