summaryrefslogtreecommitdiff
path: root/scapy/ping.py
diff options
context:
space:
mode:
Diffstat (limited to 'scapy/ping.py')
-rw-r--r--scapy/ping.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/scapy/ping.py b/scapy/ping.py
new file mode 100644
index 0000000..4d1aa66
--- /dev/null
+++ b/scapy/ping.py
@@ -0,0 +1,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")