Giter VIP home page Giter VIP logo

Comments (5)

eipiminus1 avatar eipiminus1 commented on June 16, 2024

Setting explicit = 1 does keep the content when converting via str() but somehow sendp() still does not send SSL layer content.
sendp(str(SSL('AAAAA'))) does work as a workaround.

from scapy-ssl_tls.

exploide avatar exploide commented on June 16, 2024

Settings explicit = 1 does not solve the problem entirely for me.

Example code (the get_payload function is from python-netfilterqueue but shouldn't be relevant here):

p = IP(pkt.get_payload())
if TLSClientHello in p:
    p.show2()

Without explicit = 1, this results in an output only containing IP and TCP header. If I apply your modification, it shows the SSL layer also. Fine so far.

But when I try to alter the packet, the SSL layer vanishes when using the show2 function. For example in

p = IP(pkt.get_payload())
if TLSClientHello in p:
    del(p.chksum)
    p.show2()

Some ideas?

from scapy-ssl_tls.

eipiminus1 avatar eipiminus1 commented on June 16, 2024

Should be fixed in #6.

from scapy-ssl_tls.

exploide avatar exploide commented on June 16, 2024

seems to work for me. nice! thanks

from scapy-ssl_tls.

tintinweb avatar tintinweb commented on June 16, 2024

merged #6 fixing this issue - thx eipiminus1.

  • some background information on the actual bug:
    the code did not take into account that by overriding scapy's default do_dissect() self.fields['records'] is never being initialized. Looking at scapy/packet.py::do_dissect() indicates that do_dissect() is responsible for this initialization. #6 fixes this inside the loop body as mentioned in the pr-comment it would be better to have this outside the loop.
  • in order to address this issue I've merged your pr and modified the code in order to feel more like the original scapy::do_dissect() even though it is a little bit more overhead and the fact that we only have one field in our fields_desc.

here's my testcase, it should read 'True' at the end:

p = TLSRecord()/TLSHandshake()/TLSClientHello(compression_methods=[0x00], 
                                              cipher_suites=[TLSCipherSuite.RSA_WITH_AES_128_CBC_SHA],
                                              random_bytes='R'*28,
                                              extensions=[TLSExtension()/TLSServerNameIndication(server_names=[TLSServerName()])])
sp = SSL(str(p))
print "--show--"
sp.show()
print "--show2--"
sp.show2()
print str(sp.show())==str(sp.show2())

from scapy-ssl_tls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.