Pretty cool, right? Note that you can also extend that using sslstrip to be able to sniff HTTPS requests also!ĭISCLAIMER: Use this on a network you have permission to. Now let's try to run the http_filter.py script again: python3 http_sniffer.py -i wlan0 -show-rawĪfter browsing the internet on "192.168.1.100" (which is my Windows machine), I got this output (in my attacking machine): 192.168.1.100 Requested / with GET For more information, check this tutorial. Here is how you use it:Īt this moment, we are spoofing "192.168.1.100" saying that we are the router, so any packet that goes to or comes out of that target machine will flow to us first, then to the router. To do that, you need to arp spoof the target using this script. Well, you can sniff packets all over the network or a specific host when you are a man-in-the-middle. You may wonder now what is the benefit of sniffing HTTP packets on my local computer. Here is the output after browsing HTTP websites on my local machine: We've used the argparsemodule to parse arguments from the command line or terminal let's run the script now (I've named it http_filter.py): python3 http_sniffer.py -i wlan0 -show-raw Parser.add_argument("-show-raw", dest="show_raw", action="store_true", help="Whether to print POST raw data, such as passwords, search queries, etc.") Parser.add_argument("-i", "-iface", help="Interface to use, default is scapy's default interface") "It is suggested that you run arp spoof before you use this script, otherwise it'll sniff your personal packets") Parser = argparse.ArgumentParser(description="HTTP Packet Sniffer, this is useful when you're a man in the middle." \ Now let's implement the main code: if _name_ = "_main_": We're going to pass it into the script's arguments. ![]() Try to print the whole HTTP request packet using the packet.show() method, you'll see a tremendous amount of information you can extract there.ĭon't worry about the show_raw variable it is just a global flag that indicates whether we print POST raw data, such as passwords, search queries, etc. We are extracting the requested URL, the requester's IP, and the request method here, but don't be limited to that. Related: Build 24 Ethical Hacking Scripts
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |