diff options
| author | jerome <jerome@xlinfo.fr> | 2025-06-20 14:17:15 +0200 |
|---|---|---|
| committer | jerome <jerome@xlinfo.fr> | 2025-06-20 14:17:15 +0200 |
| commit | 34b5518fa596845b557639fea86a3b59cdff5d2d (patch) | |
| tree | 0e6e2dd994eb7c4995848d448009a3a1a1e9541b /scapy/spoof_ip.py | |
| parent | ae8ae69ce17974dc7a1d26ca02d7c0ba1f7f2515 (diff) | |
| download | python-34b5518fa596845b557639fea86a3b59cdff5d2d.tar.gz python-34b5518fa596845b557639fea86a3b59cdff5d2d.zip | |
scapy
Diffstat (limited to 'scapy/spoof_ip.py')
| -rw-r--r-- | scapy/spoof_ip.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scapy/spoof_ip.py b/scapy/spoof_ip.py new file mode 100644 index 0000000..7f85786 --- /dev/null +++ b/scapy/spoof_ip.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python
+
+import sys
+from scapy.all import *
+
+def spoof_ip(spoofed_ip,dest_ip):
+ send(IP(src=spoofed_ip,dst=dest_ip)/ICMP(),count=10)
+
+if __name__ == "__main__":
+ try:
+ spoof_ip(sys.argv[1],sys.argv[2])
+ except PermissionError:
+ print(f"{sys.argv[0]} nécessite les droits root")
|
