예제 #1
0
    def test_help_contents(self):
        shell = ReadShell(MockVuln(), None, None)
        _help = shell.help(None)

        self.assertNotIn('execute', _help)
        self.assertNotIn('upload', _help)
        self.assertIn('read', _help)
예제 #2
0
 def test_help_contents(self):
     shell = ReadShell(MockVuln(), None, None)
     _help = shell.help(None)
     
     self.assertNotIn('execute', _help)
     self.assertNotIn('upload', _help)
     self.assertIn('read', _help)
예제 #3
0
 def test_help_contents_specific(self):
     shell = ReadShell(MockVuln(), None, None)
     _help = shell.help('read')
     
     self.assertIn('read', _help)
     self.assertIn('/etc/passwd', _help)
     
     
예제 #4
0
    def test_help_format(self):
        shell = ReadShell(MockVuln(), None, None)
        _help = shell.help(None)

        self.assertFalse(_help.startswith(' '))

        self.assertIn('    help', _help)
        # Note that I add an extra space
        self.assertNotIn('     help', _help)
예제 #5
0
 def test_help_format(self):
     shell = ReadShell(MockVuln(), None, None)
     _help = shell.help(None)
     
     self.assertFalse(_help.startswith(' '))
     
     self.assertIn('    help', _help)
     # Note that I add an extra space
     self.assertNotIn('     help', _help)
예제 #6
0
파일: sqlmap.py 프로젝트: chenbremer/w3af-1
    def specific_user_input(self, command, params, return_err=True):
        # Call the parent in order to get read/download without duplicating
        # any code.
        #
        # Not using super() due to some issues I've found in real life
        #   https://github.com/andresriancho/w3af/issues/3610
        #
        # Documented here:
        #   http://goo.gl/jhRznU
        #   http://thomas-cokelaer.info/blog/2011/09/382/
        resp = ReadShell.specific_user_input(self,
                                             command,
                                             params,
                                             return_err=False)

        if resp is not None:
            return resp

        # SQLMap specific code starts
        params = tuple(params)
        functor = None

        if command in self.ALIAS:
            functor = getattr(self.sqlmap, command)

        if command == 'sqlmap':
            functor = self.sqlmap.direct

        if functor is not None:
            # TODO: I run this in a different thread in order to be able to
            #       (in the future) handle stdin and all other UI inputs.
            sqlmap_thread = RunFunctor(functor, params)
            sqlmap_thread.start()
            sqlmap_thread.join()

            # Returning this empty string makes the console avoid printing
            # a message that says that the command was not found
            return ''

        return
예제 #7
0
파일: sqlmap.py 프로젝트: EnDe/w3af
 def specific_user_input(self, command, params, return_err=True):
     # Call the parent in order to get read/download without duplicating
     # any code.
     #
     # Not using super() due to some issues I've found in real life
     #   https://github.com/andresriancho/w3af/issues/3610
     #
     # Documented here:
     #   http://goo.gl/jhRznU
     #   http://thomas-cokelaer.info/blog/2011/09/382/
     resp = ReadShell.specific_user_input(self, command, params,
                                          return_err=False)
     
     if resp is not None:
         return resp
     
     # SQLMap specific code starts
     params = tuple(params)
     functor = None
     
     if command in self.ALIAS:
         functor = getattr(self.sqlmap, command)
     
     if command == 'sqlmap':
         functor = self.sqlmap.direct
     
     if functor is not None:
         # TODO: I run this in a different thread in order to be able to
         #       (in the future) handle stdin and all other UI inputs.
         sqlmap_thread = RunFunctor(functor, params)
         sqlmap_thread.start()
         sqlmap_thread.join()
         
         # Returning this empty string makes the console avoid printing
         # a message that says that the command was not found
         return ''
     
     return
예제 #8
0
    def test_help_contents_specific(self):
        shell = ReadShell(MockVuln(), None, None)
        _help = shell.help('read')

        self.assertIn('read', _help)
        self.assertIn('/etc/passwd', _help)