Added self as tear_down_monitor argument *blush*
[pwnitter] / pwnitter.py
index 6995b0a..67d3f75 100755 (executable)
@@ -41,9 +41,11 @@ class Pwnitter(dbus.service.Object):
                          in_signature='', out_signature='')
     def Start(self, filename=None):
         # FIXME: Prevent double Start()
-        device = self.device
         if filename is None: # Then we do *not* want to read from a PCap file but rather a monitor device
             self.setup_monitor(device)
+            device = self.device
+        else: # We have given a filename, so let's make PCap read from the file
+            device = filename
         self.is_running = True
         try:
             self.cap = pcap.pcap(device)
@@ -81,7 +83,7 @@ class Pwnitter(dbus.service.Object):
         return self.status
 
 
-    def tear_down_monitor(device='mon0'):
+    def tear_down_monitor(self, device='mon0'):
         cmd = '/sbin/ifconfig mon0 down'.split()
         subprocess.call(cmd)
         cmd = '/usr/sbin/iw dev mon0 del'.split()