remove not working sniffing
This commit is contained in:
parent
275b5b1cdf
commit
dea351db13
1 changed files with 7 additions and 11 deletions
|
|
@ -1,14 +1,14 @@
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from scapy.all import ICMP, IP, Dot1Q, Ether, sendp, AsyncSniffer, wrpcap
|
from scapy.all import ICMP, IP, Dot1Q, Ether, sendp, AsyncSniffer, wrpcap, conf
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
a = AsyncSniffer(iface="enp5s0d1", filter="icmp")
|
conf.pcap = True
|
||||||
b = AsyncSniffer(iface="enp2s0", filter="icmp")
|
|
||||||
a.start()
|
|
||||||
b.start()
|
|
||||||
|
|
||||||
for i in tqdm(range(0, 4095)):
|
a = AsyncSniffer(iface=[ "enp5s0d1" ])
|
||||||
|
a.start()
|
||||||
|
|
||||||
|
for i in tqdm(range(1, 4095)):
|
||||||
sendp(
|
sendp(
|
||||||
Ether(dst="00:02:c9:27:10:73", src="00:f0:cb:ef:e0:3b")
|
Ether(dst="00:02:c9:27:10:73", src="00:f0:cb:ef:e0:3b")
|
||||||
/ Dot1Q(vlan=i)
|
/ Dot1Q(vlan=i)
|
||||||
|
|
@ -21,7 +21,6 @@ print("Wrapping up and waiting for last packets")
|
||||||
sleep(1)
|
sleep(1)
|
||||||
|
|
||||||
plist = a.stop()
|
plist = a.stop()
|
||||||
plist_ingress = b.stop()
|
|
||||||
|
|
||||||
seen = [False for i in range(4095)]
|
seen = [False for i in range(4095)]
|
||||||
icmpid = [False for i in range(4095)]
|
icmpid = [False for i in range(4095)]
|
||||||
|
|
@ -77,12 +76,9 @@ shutil.copy(Path(sys.argv[0]), log_dir / sys.argv[0])
|
||||||
|
|
||||||
print(" - [x] script.py")
|
print(" - [x] script.py")
|
||||||
|
|
||||||
with open(log_dir / "egress.pcap", "wb") as file:
|
with open(log_dir / "capture.pcap", "wb") as file:
|
||||||
wrpcap(file, plist)
|
wrpcap(file, plist)
|
||||||
|
|
||||||
with open(log_dir / "ingress.pcap", "wb") as file:
|
|
||||||
wrpcap(file, plist_ingress)
|
|
||||||
|
|
||||||
print(" - [x] pcap")
|
print(" - [x] pcap")
|
||||||
|
|
||||||
cmd_config = ["ssh", "-o", "StrictHostKeyChecking=no", "root@192.168.42.6", "cli show config"]
|
cmd_config = ["ssh", "-o", "StrictHostKeyChecking=no", "root@192.168.42.6", "cli show config"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue