Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #51626
    Avatarencryptedn00b
    Participant

    When I run the packet sniffer nothing shows on the terminal, yes I am sniffing on the localhost and the sites I am testing on are the dictionary.com site used in the lecture and steamylogin.com
    I was paying attention to the lecture and even checked the code multiple times. Maybe I’m just tired I don’t know.
    Here is my 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_sniffed_packet)

    def process_sniffed_packet(packet):
    if packet.haslayer(http.HTTPRequest):
    if packet.haslayer(scapy.Raw):
    load = packet[scapy.Raw].load
    if “username” in load:
    print(load)

    sniff(“eth0”)

    #51673
    diegodiego
    Moderator

    Hi!
    Can you share your code with the porper indentation? Otherwise I can’t tell if there’s anything wrong with it.
    Also don’t use dictiorary.com as it uses https now a days. Please try it with http sites first, like this:

    http://testphp.vulnweb.com/

    Later on the course you’ll learn to bypass https.

    Let me know how it goes!
    Diego

    #51703
    Avatarencryptedn00b
    Participant

    For some reason I can’t copy and paste my code with proper indentation and I tried with the website you gave me and it still did not work. So I assume something is wrong with the indentation then.

    #51721
    diegodiego
    Moderator

    Hi!
    You can copy it and use the code button to keep indentation, or upload it to pastebin and share the link here.
    Greetings!
    Diego

    #51735
    Avatarencryptedn00b
    Participant

    https://pastebin.com/bzYb9JtC

    #51761
    diegodiego
    Moderator

    Hi!
    Are you trying it in kali itself right? Can you cahnge username for uname in your code? Then try it again.

    Let me know how it goes!
    Diego

    #51801
    Avatarencryptedn00b
    Participant

    That works thank you

    #51832
    diegodiego
    Moderator

    Hi!
    Cool you got it!
    Diego

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.