mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-24 12:31:11 +00:00
21 lines
374 B
Python
21 lines
374 B
Python
import scapy.all as scapy
|
|
from scapy.layers import http
|
|
|
|
|
|
def sniffing(interface):
|
|
scapy.sniff(iface=interface,
|
|
storage=False, prn=process_packet, filter='tcp')
|
|
|
|
|
|
def process_packet(packet):
|
|
if packet.haslayer(http.HTTPRequest):
|
|
print(packet[http.HTTPRequest].Host)
|
|
|
|
|
|
def main():
|
|
sniffing("Wi-Fi")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|