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
    Moderator

    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
    Moderator

    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.