def __init__(self, netzob): super(NetworkCapturer, self).__init__("NETWORK CAPTURER", netzob) # create logger with the given configuration self.bpfFilter = None self.importLayer = 4 self._payloadDict = {} self.envDeps = EnvironmentalDependencies()
def __init__(self, netzob): AbstractImporter.__init__(self, "THIRD PARTY IMPORT") self.netzob = netzob # create the environmental dependancy object self.envDeps = EnvironmentalDependencies() # create logger with the given configuration self.log = logging.getLogger('netzob.Import.ThirdPartyImporter.py') self.messages = [] ospyImporter = OSpy() # Creates the list of third parties self.thirdParties = [ospyImporter] self.plugins = [] # Load plugins for plugin in self.thirdParties: self.plugins.append(plugin) self.init() self.dialog = Gtk.Dialog(title=_("Import data from third parties"), flags=0, buttons=None) self.dialog.show() self.dialog.vbox.pack_start(self.getPanel(), True, True, 0) self.dialog.set_size_request(1000, 600)
def __init__(self, netzob): super(DelimiterSeparatedImporter, self).__init__("FILE IMPORT", netzob) self.log = logging.getLogger('netzob.Import.FileImporter.py') # create the environmental dependancy object self.envDeps = EnvironmentalDependencies() self.importedFiles = [] self.messageSeparator = "" self.messageSeparatorStrategy = None
def __init__(self, netzob): super(IpcCapturer, self).__init__("IPC CAPTURER", netzob) self.netzob = netzob self.pid = None self.sniffOption = None self.stracePid = None self.aSniffThread = None self.doSniff = False self._payloadDict = {} self.envDeps = EnvironmentalDependencies() self.selected_fds = set()
def init(self): # create the environmental dependancy object self.envDeps = EnvironmentalDependencies() # Default line separator is <CR> self.fileName = "" # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Main panel # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ self.panel = Gtk.Table(rows=10, columns=8, homogeneous=True) self.panel.show() # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Select a file # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ but = Gtk.Button(_("Select file(s)")) but.show() entry_filepath = Gtk.Entry() # entry_filepath.set_width_chars(50) entry_filepath.set_text("") entry_filepath.show() but.connect("clicked", self.selectFiles, entry_filepath) self.panel.attach( but, 0, 2, 0, 1, xoptions=Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, yoptions=Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, xpadding=5, ypadding=5) self.panel.attach( entry_filepath, 2, 6, 0, 1, xoptions=Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, yoptions=Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, xpadding=5, ypadding=5) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Extracted data # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scroll2 = Gtk.ScrolledWindow() self.lineView = Gtk.TreeView(Gtk.TreeStore( str, str, str)) # id message, type, content self.lineView.get_selection().set_mode(Gtk.SelectionMode.SINGLE) #self.lineView.connect('button-press-event', self.button_press_on_message) cell = Gtk.CellRendererText() # Col file descriptor column = Gtk.TreeViewColumn(_("Message ID")) column.pack_start(cell, True) column.add_attribute(cell, "text", 0) self.lineView.append_column(column) column = Gtk.TreeViewColumn(_("Type")) column.pack_start(cell, True) column.add_attribute(cell, "text", 1) self.lineView.append_column(column) column = Gtk.TreeViewColumn(_("Content")) column.pack_start(cell, True) column.add_attribute(cell, "text", 2) self.lineView.append_column(column) self.lineView.show() scroll2.add(self.lineView) scroll2.show() scroll2.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) self.panel.attach(scroll2, 0, 6, 1, 10, xoptions=Gtk.AttachOptions.FILL, yoptions=Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, xpadding=5, ypadding=5) # Button select packets for further analysis but = Gtk.Button(label=_("Import")) but.show() but.connect("clicked", self.import_file) self.panel.attach(but, 2, 3, 10, 11, xoptions=0, yoptions=0, xpadding=5, ypadding=5)