Skip to content

IndexError: Layer [IP] not found #3

@sp1thas

Description

@sp1thas

Hi Jack, thank you for sharing this script, it's really useful!

Although the script captures the http requests, I'm getting the following error:

$ sudo python3 http_request_capture.py --iface wlp0s20f3 --port 80
Sun, 04 Apr 2021 19:57:03 +0300: sniffing http requests on port 80 using network interface wlp0s20f3
Sun, 04 Apr 2021 19:58:39 +0300: www.secdev.org/projects/scapy/
Sun, 04 Apr 2021 19:58:39 +0300: www.secdev.org/.well-known/http-opportunistic
Traceback (most recent call last):
  File "http_request_capture.py", line 56, in <module>
    sniff(
  File "/usr/local/lib/python3.8/dist-packages/kamene/sendrecv.py", line 608, in sniff
    r = prn(p)
  File "http_request_capture.py", line 33, in parse_http_request
    if pkt[IP].ack == last_ack:
  File "/usr/local/lib/python3.8/dist-packages/kamene/packet.py", line 820, in __getitem__
    raise IndexError("Layer [%s] not found" % lname)
IndexError: Layer [IP] not found

Python: 3.8.5
OS: Pop!_OS 20.04 LTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions