-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathARP-Poisoning.py
36 lines (23 loc) · 966 Bytes
/
ARP-Poisoning.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
"""Custom topology example
One switche plus 3 host :
Adding the 'topos' dict with a key/value pair to generate our newly defined
topology enables one to pass in '--topo=mytopo' from the command line.
This topo used to test ARP poisoning
"""
from mininet.topo import Topo
class MyTopo( Topo ):
"Simple topology example."
def __init__( self ):
"Create custom topo."
# Initialize topology
Topo.__init__( self )
# Add hosts and switches
maliciousHost = self.addHost( 'h1',ip='10.0.0.2' , mac = '00:00:00:00:00:02')
leftHost = self.addHost( 'h2',ip='10.0.0.3' , mac = '00:00:00:00:00:03')
rightHost = self.addHost( 'h3',ip='10.0.0.4' , mac = '00:00:00:00:00:04')
switch = self.addSwitch( 's1')
# Add links
self.addLink( leftHost, switch)
self.addLink( rightHost, switch)
self.addLink( maliciousHost, switch)
topos = { 'mytopo': ( lambda: MyTopo() ) }