Example #1
0
    def __init__(self, opts):
        """
        :opts:
                {
                    pcap:                     (boolean) Whether to save packets in pcap format,
                    udp:                      (boolean) Whether to use UDP proxy (default: TCP),
                    program:                  (list) Program and arguments,
                    jobs:                     (int) Number of jobs to run concurrently,
                    timeout:                  (int) Seconds to give process before killing it,
                    output_directory:         (string) Directory to place found bugs,
                    input_arguments:          (string) Arguments for the input module,
                    input_module:             (string) Module to use for input generation,
                    fuzzing_module:           (string) Module to use for fuzzing the network data,
                    prerocessing_module:      (string) Module to use for preprocessing data,
                    instrumentation_module:   (string) Module to use for instrumentation
                }
        """
        for opt, value in opts.items():
            setattr(self, opt, value)

        Fuzzer.__init__(self, opts)
        self._tlock = threading.Lock()

        self._set_operating_mode()
        self._validate_arguments()

        if self.udp:
            self.proxy = UdpProxy(self.log)
        else:
            self.proxy = TcpProxy(self.log)

        self.proxy.address = self.address
        self.proxy.listen_port = self.listen_port
        self.proxy.forward_port = self.forward_port
        self.proxy.data_handler = self.data_handler
Example #2
0
    def __init__(self, opts):
        """
        :opts:
                {
                    watch_process:            (Boolean) Whether to poll /proc/<pid>/status for process state,
                    virtual_framebuffer:      (Boolean) Whether to use virtual framebuffer as DISPLAY
                    output_directory:         (string) Directory to use for instrumentation,
                    program:                  (list) Program and its arguments,
                    timeout:                  (int) Seconds to give process before killing it,
                    input_feed:               (string) File or directory to use as input source
                }
        """
        for opt, value in opts.items():
            setattr(self, opt, value)

        # Set default InputModule
        opts["input_module"] = "file"
        Fuzzer.__init__(self, opts)

        self._tlock = threading.Lock()
        self._validate_arguments()

        if self.virtual_framebuffer:
            self._enable_virtual_framebuffer()