示例#1
0
    def __init__(self, args):
	if match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", args.db):
            # the db is on device so we need to grab a local copy
            scp = ScpClient(ip=args.db)
            db_path = scp.select_and_fetch_db()
        else:
            db_path = args.db
        self.analyzer = Analyzer(db_path, signature_list, args.group,
			args.sub_group, args.list)
示例#2
0
    def __init__(self, args):
	if match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", args.db):
            # the db is on device so we need to grab a local copy
            scp = ScpClient(ip=args.db)
	    if args.delete:
                scp.delete_remote_dbs()
		exit(0)
            else:
                db_path = scp.select_and_fetch_db()
                self.analyzer = Analyzer(db_path, signature_list, args.group,
			args.sub_group, args.list)
        else:
            db_path = args.db
            self.analyzer = Analyzer(db_path, signature_list, args.group,
			args.sub_group, args.list)
示例#3
0
class Introspy:
    """ Sets up and initiates analysis """

    def __init__(self, args):
	if match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", args.db):
            # the db is on device so we need to grab a local copy
            scp = ScpClient(ip=args.db)
	    if args.delete:
                scp.delete_remote_dbs()
		exit(0)
            else:
                db_path = scp.select_and_fetch_db()
                self.analyzer = Analyzer(db_path, signature_list, args.group,
			args.sub_group, args.list)
        else:
            db_path = args.db
            self.analyzer = Analyzer(db_path, signature_list, args.group,
			args.sub_group, args.list)

    def print_results(self, outdir=None):
        if outdir:
            report = HTMLReport(self.analyzer)
            report.write_to_directory(outdir)
        else:
            for (signature, matching_calls) in self.analyzer.get_findings():
                if matching_calls:
                    print "# %s" % signature if isinstance(signature, str) else signature.description
                    for traced_call in matching_calls:
                        print "  %s" % traced_call
示例#4
0
    def __init__(self, dic_path='..'):

        self.Analysis = Analyzer()
        self.dic_path = dic_path
        self.DataVis = DataVis()
        course_initialization = Course_Initialization()
        course_initialization.set_course_data_path(self.dic_path)
示例#5
0
    def predict_by_decision_tree(self, x_data, y_data, test_size=0.10):

        analysis = Analyzer()

        x_train, x_test, y_train, y_test = analysis.Predictive_Analysis.split_training_and_testing(
            x_data, y_data, test_size=test_size)
        analysis.Predictive_Analysis.decision_tree(x_train, x_test, y_train,
                                                   y_test)
示例#6
0
    def predict_by_svm(self, x_data, y_data, test_size=0.10, kernel='linear'):

        analysis = Analyzer()

        x_train, x_test, y_train, y_test = analysis.Predictive_Analysis.split_training_and_testing(
            x_data, y_data, test_size=test_size)
        analysis.Predictive_Analysis.svm(x_train,
                                         x_test,
                                         y_train,
                                         y_test,
                                         kernel=kernel)
示例#7
0
    def predict_by_random_forest(self,
                                 x_data,
                                 y_data,
                                 test_size=0.10,
                                 tree_amount=10,
                                 max_depth=2,
                                 random_state=0):

        analysis = Analyzer()

        x_train, x_test, y_train, y_test = analysis.Predictive_Analysis.split_training_and_testing(
            x_data, y_data, test_size=test_size)
        analysis.Predictive_Analysis.random_forest(x_train,
                                                   x_test,
                                                   y_train,
                                                   y_test,
                                                   tree_amount=tree_amount,
                                                   max_depth=max_depth,
                                                   random_state=random_state)
示例#8
0
class Introspy:
    """ Sets up and initiates analysis """

    def __init__(self, args):
	if match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", args.db):
            # the db is on device so we need to grab a local copy
            scp = ScpClient(ip=args.db)
            db_path = scp.select_and_fetch_db()
        else:
            db_path = args.db
        self.analyzer = Analyzer(db_path, signature_list, args.group,
			args.sub_group, args.list)

    def print_results(self, outdir=None):
        if outdir:
            report = HTMLReport(self.analyzer)
            report.write_to_directory(outdir)
        else:
            for (signature, matching_calls) in self.analyzer.get_findings():
                if matching_calls:
                    print "# %s" % signature if isinstance(signature, str) else signature.description
                    for traced_call in matching_calls:
                        print "  %s" % traced_call
示例#9
0
 def __init__(self):
     self.analyzer = Analyzer()
示例#10
0
    def getAnalyzer(self):

        analyzer = Analyzer()

        return analyzer