Add intercept packets script
This commit is contained in:
parent
04be4f610d
commit
d828243927
27
python-ofensivo/15_hacking/06_intercept.py
Normal file
27
python-ofensivo/15_hacking/06_intercept.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import scapy.all as scapy
|
||||||
|
|
||||||
|
|
||||||
|
def process_packet(packet):
|
||||||
|
"""
|
||||||
|
Procesa los paquetes que llegan a la cola 0
|
||||||
|
"""
|
||||||
|
|
||||||
|
if packet.haslayer(scapy.DNSRR):
|
||||||
|
|
||||||
|
qname = packet[scapy.DNSQR].qname
|
||||||
|
|
||||||
|
# print(qname)
|
||||||
|
|
||||||
|
if "hack4u.io" in qname.decode() or "vergaracarmona.es" in qname.decode():
|
||||||
|
|
||||||
|
print(
|
||||||
|
f"\n------------------\n{packet.show()}\n------------------\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
scapy.sniff(
|
||||||
|
iface="wlo1", filter="udp and port 53",
|
||||||
|
store=False, prn=process_packet
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user