Ejemplo n.º 1
0
    def __init__(self, proxy_events, listen_port, include_path):
        self.opts = options.Options()
        self.opts.listen_port = listen_port
        self.opts.confdir = include_path
        self.master = master.Master(self.opts)
        proxy_events.set_proxy(self)
        self.master.addons.add(proxy_events)

        self.master.addons.add(termlog.TermLog())
        self.master.addons.add(*addons.default_addons())
        self.master.addons.add(keepserving.KeepServing(),
                               readfile.ReadFileStdin())
Ejemplo n.º 2
0
 def __init__(
     self,
     options: options.Options,
     with_termlog=True,
     with_dumper=True,
 ) -> None:
     super().__init__(options)
     self.errorcheck = ErrorCheck()
     if with_termlog:
         self.addons.add(termlog.TermLog(), termstatus.TermStatus())
     self.addons.add(*addons.default_addons())
     if with_dumper:
         self.addons.add(dumper.Dumper())
     self.addons.add(keepserving.KeepServing(), self.errorcheck)
Ejemplo n.º 3
0
 def __init__(
     self,
     options: options.Options,
     server,
     with_termlog=True,
     with_dumper=True,
 ) -> None:
     master.Master.__init__(self, options, server)
     self.errorcheck = ErrorCheck()
     if with_termlog:
         self.addons.add(termlog.TermLog(), termstatus.TermStatus())
     self.addons.add(*addons.default_addons())
     if with_dumper:
         self.addons.add(dumper.Dumper())
     self.addons.add(readstdin.ReadStdin(), keepserving.KeepServing(),
                     self.errorcheck)
Ejemplo n.º 4
0
 def __init__(
     self,
     options: options.Options,
     with_termlog=True,
     with_dumper=True,
 ) -> None:
     super().__init__(options)
     if with_termlog:
         self.addons.add(termlog.TermLog())
     self.addons.add(*addons.default_addons())
     if with_dumper:
         self.addons.add(dumper.Dumper())
     self.addons.add(
         keepserving.KeepServing(),
         readfile.ReadFileStdin(),
         errorcheck.ErrorCheck(),
     )
Ejemplo n.º 5
0
 def __init__(
     self,
     options: options.Options,
     mode,
     flow_name,
 ) -> None:
     super().__init__(options)
     self.addons.add(termlog.TermLog())
     self.addons.add(termstatus.TermStatus())
     self.addons.add(keepserving.KeepServing())
     self.addons.add(*addons.default_addons())
     if mode == "fuzz":
         self.addons.add(dumper.Dumper())
         self.addons.add(FuzzResponseAnalyzer())
     if mode == "runfuzz":
         self.addons.add(FuzzResponseAnalyzer())
     if mode == "capture":
         self.addons.add(Capture(flow_name))
     if mode == "intercept":
         self.addons.add(Interceptor())
Ejemplo n.º 6
0
async def test_keepserving():
    ks = keepserving.KeepServing()
    with taddons.context(ks) as tctx:
        ks.event_processing_complete()
        asyncio.sleep(0.1)
        assert tctx.master.should_exit.is_set()