Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #40113
    Peter Queen
    Participant

    Hello, when i run this code:

    #!/usr/bin/env python
    import scapy.all as scapy
    from scapy.layers import http
    
    def sniff(interface):
        scapy.sniff(iface=interface, store=False, prn=process_sniff_packet)
    
    def process_sniff_packet(packet):
        if packet.haslayer(http.HTTPRequest):
            if packet.haslayer(scapy.Raw):
                print(packet[scapy.Raw].load)
    
    sniff("eth0")
    

    i get this:

    root@kali:~/PycharmProjects/packet_sniffer# python packet_sniffer1.py

    0R0P0N0L0J0 +�BF0�’��p���s�_f8����n�ϛ�`���} �+���x��CU

    0R0P0N0L0J0 +�BF0�’��p���s�_f8����n�ϛ�`���} �+�lh�(m�CU%

    0R0P0N0L0J0 +�BF0�’��p���s�_f8����n�ϛ�`���} �+���x��CU

    0Q0O0M0K0I0 +�BF0�’��p���s�_f8����n�ϛ�`���} �+/w�[_)�CU

    0R0P0N0L0J0 +��cR�I�

    �{�����;��{��2]�7r��\�&�Gy��k� U��� ��%

    Before importing “from scapy.layers import http” it was working fine.

    Can you please help?

    #40154
    Diego PérezDiego Pérez
    Participant

    Hi!
    Are you testing in the local host?
    Which sites are you using for the tests?

    Let me know.
    Diego

    #40481
    Peter Queen
    Participant

    Hi Diego I sorted it thanks!

    #40508
    Diego PérezDiego Pérez
    Participant

    Hi Peter!
    Cool you got it!
    Diego

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Privacy Overview
ZSecurity logo featuring a stylized red letter Z

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

3rd Party Cookies

This website uses Google Analytics and Linkedin to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping these cookies enabled helps us to improve our website.