示例#1
0
 def __init__(self, run_args, meta, snare_uuid):
     self.run_args = run_args
     self.meta = meta
     self.dir = run_args.full_page_path
     self.snare_uuid = snare_uuid
     self.html_handler = HtmlHandler(run_args.no_dorks, run_args.tanner)
     self.logger = logging.getLogger(__name__)
示例#2
0
 def __init__(self, run_args, meta, snare_uuid):
     self.run_args = run_args
     self.meta = meta
     self.dir = '/opt/snare/pages/{}'.format(run_args.page_dir)
     self.snare_uuid = snare_uuid
     self.html_handler = HtmlHandler(run_args.no_dorks, run_args.tanner)
     self.logger = logging.getLogger(__name__)
 def setUp(self):
     self.main_page_path = generate_unique_path()
     os.makedirs(self.main_page_path)
     self.dorks = dict(response={'dorks': "test_dorks"})
     self.loop = asyncio.new_event_loop()
     aiohttp.ClientSession.get = AsyncMock(
         return_value=aiohttp.ClientResponse(
             url=yarl.URL("http://www.example.com"), method="GET", writer=None, continue100=1,
             timer=None, request_info=None, traces=None, loop=self.loop,
             session=None
         )
     )
     no_dorks = True
     tanner = "tanner.mushmush.org"
     self.handler = HtmlHandler(no_dorks, tanner)
     self.data = None
 def setUp(self):
     self.main_page_path = generate_unique_path()
     os.makedirs(self.main_page_path)
     self.content = """
                       <html>
                             <body>
                             <p style="color:red;">A paragraph to be tested</p>
                             </body>
                       </html>
                    """
     self.expected_content = '<html>\n <body>\n  <p style="color: red">\n'
     self.expected_content += '   <a href="test_dork1" style="color:red;text-decoration:none;cursor:text;">\n'
     self.expected_content += "    A\n   </a>\n   paragraph to be tested\n  </p>\n </body>\n</html>\n"
     self.no_dorks_content = '<html>\n <body>\n  <p style="color:red;">\n   A paragraph to be tested\n'
     self.no_dorks_content += "  </p>\n </body>\n</html>\n"
     self.loop = asyncio.new_event_loop()
     self.return_content = None
     no_dorks = True
     tanner = "tanner.mushmush.org"
     self.handler = HtmlHandler(no_dorks, tanner)