Esempio n. 1
0
    def buildProtocol(self, addr):
        p = self.protocol()
        p.factory = self

        if config.daphn3.yaml_file:
            steps = read_yaml(config.daphn3.yaml_file)
        elif config.daphn3.pcap_file:
            steps = read_pcap(config.daphn3.pcap_file)
        else:
            print "Error! No PCAP, nor YAML file provided."
            steps = None

        p.factory.steps = steps

        if addr.host not in self.mutations:
            self.mutations[addr.host] = Mutator(p.steps)
        else:
            print "Moving on to next mutation"
            if not self.mutations[addr.host].next():
                self.mutations.pop(addr.host)
        try:
            p.mutator = self.mutations[addr.host]
            p.current_state = p.mutator.state()
        except:
            pass
        return p
Esempio n. 2
0
    def runTool(self):

        logging.debug("daphn3Test.runTool")

        import yaml
        pcap = daphn3.read_pcap(self.local_options['pcap'])
        f = open(self.local_options['output'], 'w')
        f.write(yaml.dump(pcap))
        f.close()
Esempio n. 3
0
 def runTool(self):
     import yaml
     pcap = daphn3.read_pcap(self.local_options['pcap'])
     f = open(self.local_options['output'], 'w')
     f.write(yaml.dump(pcap))
     f.close()