mirror of
https://github.com/kennethreitz-archive/macspoof.git
synced 2026-06-05 07:36:12 +00:00
Made small changes to incorporate the new notify feature.
This commit is contained in:
committed by
Kenneth Reitz
parent
dd26fa8982
commit
51a4f97184
@@ -3,4 +3,5 @@
|
||||
import cli
|
||||
import core
|
||||
import interfaces
|
||||
import generator
|
||||
import generator
|
||||
import log
|
||||
+10
-8
@@ -5,30 +5,32 @@ import opster
|
||||
import macspoof
|
||||
|
||||
|
||||
|
||||
|
||||
spoof_options = [
|
||||
('a', 'airport', False, 'treat interface as airport card'),
|
||||
]
|
||||
|
||||
@opster.command(usage='INTERFACE <mac>', options=spoof_options)
|
||||
|
||||
@opster.command(usage='INTERFACE <mac>', options=spoof_options)
|
||||
def spoof(interface, mac=None, **opts):
|
||||
"""spoofs mac address of given interface
|
||||
|
||||
|
||||
"""
|
||||
|
||||
if interface in macspoof.interfaces.list():
|
||||
message = macspoof.core.spoof(interface, mac)
|
||||
print message
|
||||
|
||||
|
||||
|
||||
else:
|
||||
print('Please specify a valid interface.')
|
||||
|
||||
|
||||
@opster.command(name='list|l|ls', usage='fukit')
|
||||
|
||||
@opster.command(name='list|l|ls', usage='fukit')
|
||||
def list(**opts):
|
||||
"""lists avaiable network interfaces"""
|
||||
_interfaces = macspoof.interfaces.fetch()
|
||||
for iface in _interfaces:
|
||||
print '%s (%s)' % (iface.id, iface.mac)
|
||||
|
||||
|
||||
def start():
|
||||
opster.dispatch()
|
||||
+1
-1
@@ -14,4 +14,4 @@ def spoof(interface, mac_address=None):
|
||||
interface = macspoof.interfaces.Interface(interface)
|
||||
|
||||
|
||||
interface.spoof(mac_address)
|
||||
macspoof.log.notify(interface.spoof(mac_address))
|
||||
|
||||
@@ -49,7 +49,7 @@ class Interface(object):
|
||||
|
||||
_status = os.system('sudo ifconfig %s ether %s' % (self.id, mac))
|
||||
|
||||
print 'Interface %s (%s) => (%s)' % (self.id, self.mac, mac)
|
||||
return 'Interface %s (%s) => (%s)' % (self.id, self.mac, mac)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user