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

http layer is not detected #36

Open
alext234 opened this issue Mar 24, 2018 · 4 comments
Open

http layer is not detected #36

alext234 opened this issue Mar 24, 2018 · 4 comments

Comments

@alext234
Copy link

alext234 commented Mar 24, 2018

web3_clientVersion.pcap.tar.gz

When I do a packet.show() with the attached pcap file, there is no HTTP layer shown.

@githubMerge
Copy link

This module parses the HTTP request which has sport or dport == 80.
please check https://github.com/invernizzi/scapy-http/blob/master/scapy_http/http.py#L260

Your pcap does not satisfy the condition.

@invernizzi: can you please comment how to parse HTTP protocol on non-standard ports?

@arglucas
Copy link

arglucas commented Aug 29, 2018

My code which adds a new destination and source port (5000) to parse the HTTP layer with is as follows:

from scapy.layers.inet import TCP
import scapy.all as scapy
from  scapy_http.http import *

scapy.packet.bind_layers(TCP, HTTP, dport=5000)
scapy.packet.bind_layers(TCP, HTTP, sport=5000)

packets = scapy.rdpcap('./capture.pcap')

You can then show an HTTP packet as per the docs.

@githubMerge
Copy link

@arglucas
Is it possible for you to check the common HTTP words like "GET, POST, HOST, HTTP/" in TCP payload and concur that it is HTTP flow and parse the packet?

This will work irrespective of the source and destination port.
If the user does not know the port information, we are back to square one.

@cr0hn
Copy link

cr0hn commented Dec 9, 2021

Hi! Maybe this could help:

https://gist.github.com/cr0hn/cfa4e6d04a20f6248a506c072ae0ba81

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

4 participants