Untitled
unknown
plain_text
a year ago
1.4 kB
15
Indexable
import os
import socket
import subprocess
from scapy.all import ARP, Ether, srp
def scan_network(network):
"""
Yerel ağı tarayarak aktif cihazları bulur.
"""
print(f"Ağ taranıyor: {network}")
devices = []
arp = ARP(pdst=network)
ether = Ether(dst="ff:ff:ff:ff:ff:ff")
packet = ether / arp
result = srp(packet, timeout=3, verbose=0)[0]
for sent, received in result:
devices.append({'ip': received.psrc, 'mac': received.hwsrc})
return devices
def attempt_spread(target_ip):
"""
Hedef IP adresine yayılma girişimini simüle eder.
"""
try:
print(f"{target_ip} adresine bağlanmaya çalışılıyor...")
# Kötü niyetli yük gönderimi simülasyonu
subprocess.run(["ping", "-c", "1", target_ip], capture_output=True)
print(f"{target_ip} adresine başarıyla gönderildi!")
except Exception as e:
print(f"{target_ip} adresine bağlanılamadı: {e}")
def main():
# Yerel ağ aralığını tanımla
network = "192.168.1.0/24"
devices = scan_network(network)
print("Ağda bulunan cihazlar:")
for device in devices:
print(f"IP: {device['ip']}, MAC: {device['mac']}")
# Her cihaza yayılma girişimini simüle et
attempt_spread(device['ip'])
if __name__ == "__main__":
main()
Editor is loading...
Leave a Comment