コード例 #1
0
ファイル: run.py プロジェクト: NORMA-Inc/AtEar
    def pentest(self):
        '''
            @brief Allowing access to pentest function.
            * POST  - Perform the pentest.
            * GET   - Return the result of pentest.
        '''
        # 먼저 진행 중이던 작업을 취소.
        if self.wids_handle:
            self.wids_handle.terminate()
            self.wids_handle.join()
            self.wids_handle = None

        if self.scanner:
            self.scanner.stop()
            self.scanner = None

        if self.fake_ap:
            self.fake_ap.stop()
            self.fake_ap = None

        if request.method == 'POST':
            if self.pentesting:
                self.pentesting.stop()
            options = request.get_json()
            self.pentesting = auto_pentest(self.self.scan_iface, options)
            self.pentesting.run()
            return '', 200

        elif request.method == 'GET':
            try:
                return_values = self.pentesting.get_values()
                return json.dumps(return_values, ensure_ascii=False, encoding='EUC-KR')
            except:
                return json.dumps([{}])
        return '', 200
コード例 #2
0
ファイル: run.py プロジェクト: tymiles003/AtEar
    def pentest(self):
        '''
            @brief Allowing access to pentest function.
            * POST  - Perform the pentest.
            * GET   - Return the result of pentest.
        '''
        # 먼저 진행 중이던 작업을 취소.
        if self.wids_handle:
            self.wids_handle.terminate()
            self.wids_handle.join()
            self.wids_handle = None

        if self.scanner:
            self.scanner.stop()
            self.scanner = None

        if self.fake_ap:
            self.fake_ap.stop()
            self.fake_ap = None

        if request.method == 'POST':
            if self.pentesting:
                self.pentesting.stop()
            options = request.get_json()
            self.pentesting = auto_pentest(self.pent_iface, options)
            self.pentesting.run()
            return '', 200

        elif request.method == 'GET':
            try:
                return_values = self.pentesting.get_values()
                return json.dumps(return_values, ensure_ascii=False, encoding='EUC-KR')
            except:
                return json.dumps([{}])
        return '', 200
コード例 #3
0
    def pentest(self):
        if request.method == 'POST':
            options = request.get_json()
            self.pentesting = auto_pentest(self.pent_iface, options)
            self.pentesting.run()

            return '', 200

        elif request.method == 'GET':
            try:
                return_values = ast.literal_eval(self.pentesting.get_values())
                return json.dumps(return_values)
            except:
                return json.dumps([{}])
        return '', 200
コード例 #4
0
ファイル: run.py プロジェクト: rydemods/Atear-Beta
    def pentest(self):
        if request.method == 'POST':
            options = request.get_json()
            self.pentesting = auto_pentest(self.pent_iface, options)
            self.pentesting.run()

            return '', 200

        elif request.method == 'GET':
            try:
                return_values = ast.literal_eval(self.pentesting.get_values())
                return json.dumps(return_values)
            except:
                return json.dumps([{}])
        return '', 200
コード例 #5
0
ファイル: run.py プロジェクト: onexuan/AtEar
    def pentest(self):
        '''
            @brief Allowing access to pentest function.
            * POST  - Perform the pentest.
            * GET   - Return the result of pentest.
        '''
        if request.method == 'POST':
            options = request.get_json()
            self.pentesting = auto_pentest(self.pent_iface, options)
            self.pentesting.run()
            return '', 200

        elif request.method == 'GET':
            try:
                return_values = ast.literal_eval(self.pentesting.get_values())
                return json.dumps(return_values, ensure_ascii=False, encoding='EUC-KR')
            except:
                return json.dumps([{}])
        return '', 200