Closed eipiminus1 closed 9 years ago
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.
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?
Should be fixed in #6.
seems to work for me. nice! thanks
merged https://github.com/tintinweb/scapy-ssl_tls/pull/6 fixing this issue - thx eipiminus1.
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())
When trying to resend a captured SSL-Packet I lose all data in SSL layer. The reason seems to be some problem in the build process.
results in
while
results in
I tried to dig in deeper and found that in the
Packet
class in thedo_build
function:the call to
self.__iter__().next()
kills the content of the SSL layer. I don't yet understand the meaning of theexplicit
attribute but setting it to 1 helps here :)