Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    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
Ejemplo n.º 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
Ejemplo n.º 4
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
Ejemplo n.º 5
0
Archivo: run.py Proyecto: 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