blob: 4d1aa66d4131a3cb9b5cdb181dd8c68e7f105e0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/usr/bin/python
from scapy.all import *
conf.verb = 0
for ip in range(100, 255):
#packet = IP(dst="192.168.2." + str(ip), ttl=20)/ICMP()
#on peut aussi en profiter pour envoyer un flag (ctf)
MESSAGE = "code=01234"
packet = IP(dst="192.168.2." + str(ip), ttl=20)/ICMP()/MESSAGE
reply = sr1(packet, timeout=1)
if not (reply is None):
print(reply.src, "is online")
|