projects
/
pwnitter
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c27cce5
)
Added StartFromFile to DBus Interface to call Pwnitter with a PCap file
author
Tobias Mueller
<tobiasmue@gnome.org>
Wed, 12 Jan 2011 12:56:14 +0000
(13:56 +0100)
committer
Tobias Mueller
<tobiasmue@gnome.org>
Wed, 12 Jan 2011 12:56:14 +0000
(13:56 +0100)
pwnitter.py
patch
|
blob
|
history
diff --git
a/pwnitter.py
b/pwnitter.py
index
a0860be
..
6d0defa
100755
(executable)
--- a/
pwnitter.py
+++ b/
pwnitter.py
@@
-38,9
+38,10
@@
class Pwnitter(dbus.service.Object):
@dbus.service.method(NAME,
in_signature='', out_signature='')
@dbus.service.method(NAME,
in_signature='', out_signature='')
- def Start(self):
+ def Start(self, filename=None):
# FIXME: Prevent double Start()
# FIXME: Prevent double Start()
- self.setup_monitor(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(self.device)
self.is_running = True
try:
self.cap = pcap.pcap(device)
self.is_running = True
try:
self.cap = pcap.pcap(device)
@@
-50,6
+51,12
@@
class Pwnitter(dbus.service.Object):
self.cap.setfilter('dst port 80')
cap_fileno = self.cap.fileno()
self.source_id = gobject.io_add_watch(cap_fileno, gobject.IO_IN, self.cap_readable_callback, device)
self.cap.setfilter('dst port 80')
cap_fileno = self.cap.fileno()
self.source_id = gobject.io_add_watch(cap_fileno, gobject.IO_IN, self.cap_readable_callback, device)
+
+ @dbus.service.method(NAME,
+ in_signature='s', out_signature='')
+ def StartFromFile(self, filename):
+ return self.Start(filename=filename)
+
def cap_readable_callback(self, source, condition, device):
return self.pwn(device, self.MessageSent)
def cap_readable_callback(self, source, condition, device):
return self.pwn(device, self.MessageSent)