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

Missing os import #153

Closed cve-reporting closed 3 years ago

cve-reporting commented 5 years ago

When running program using scapy-ssl_tls following error occurs:

Traceback (most recent call last):

  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
...
    from scapy.layers.ssl_tls import DTLSRecord as DTLS
  File "/usr/local/lib/python2.7/dist-packages/scapy-2.4.3rc1.dev5-py2.7.egg/scapy/layers/ssl_tls.py", line 712, in <module>
    class TLSClientHello(PacketNoPayload):
  File "/usr/local/lib/python2.7/dist-packages/scapy-2.4.3rc1.dev5-py2.7.egg/scapy/layers/ssl_tls.py", line 716, in TLSClientHello
    StrFixedLenField("random_bytes", os.urandom(28), 28),
NameError: name 'os' is not defined

After adding "import os" at the beginning of ssl_tls.py works correct.

My environment: python --version Python 2.7.12

Scapy version: Version 2.4.3rc1.dev5

scapy-ssl_tls - just taken from repository