def logo(): """ Output our amazing logo :return: None """ print( bold( lightyellow( """ ________ __ \\_____ \\ __ _______ _______| | __ / / \\ \\| | \\__ \\_ __ \\ |/ / / \\_/. \\ | // __ \\| | \\/ < \\_____\\ \\_/____/(____ /__| |__|_ \\ \\__> \\/ \\/ v{} """ ), ).format(__version__) + bold( lightblue( """ An Obfuscation-Neglect Android Malware Scoring System """ ), ), )
def show_detail_report(self, rule_obj): """ Show the detail report. :param rule_obj: the instance of the RuleObject. :return: None """ # Count the confidence print("") print(f"Confidence: {rule_obj.check_item.count(True) * 20}%") print("") if rule_obj.check_item[0]: print(red(CHECK_LIST), end="") print(green(bold("1.Permission Request")), end="") print("") for permission in rule_obj.x1_permission: print(f"\t\t {permission}") if rule_obj.check_item[1]: print(red(CHECK_LIST), end="") print(green(bold("2.Native API Usage")), end="") print("") for api in self.quark_analysis.level_2_result: print(f"\t\t ({api.class_name}, {api.name})") if rule_obj.check_item[2]: print(red(CHECK_LIST), end="") print(green(bold("3.Native API Combination")), end="") print("") print( f"\t\t ({rule_obj.x2n3n4_comb[0]['class']}, {rule_obj.x2n3n4_comb[0]['method']})", ) print( f"\t\t ({rule_obj.x2n3n4_comb[1]['class']}, {rule_obj.x2n3n4_comb[1]['method']})", ) if rule_obj.check_item[3]: print(red(CHECK_LIST), end="") print(green(bold("4.Native API Sequence")), end="") print("") print(f"\t\t Sequence show up in:") for seq_method in self.quark_analysis.level_4_result: print(f"\t\t {seq_method.full_name}") if rule_obj.check_item[4]: print(red(CHECK_LIST), end="") print(green(bold("5.Native API Use Same Parameter")), end="") print("") for seq_operation in self.quark_analysis.level_5_result: print(f"\t\t {seq_operation.full_name}")
def logo(): print( bold( lightyellow(""" ________ __ \_____ \ __ _______ _______| | __ / / \ \| | \__ \\_ __ \ |/ / / \_/. \ | // __ \| | \/ < \_____\ \_/____/(____ /__| |__|_ \\ \__> \/ \/ v{} """)).format("20.01") + bold( lightblue(""" An Obfuscation-Neglect Android Malware Scoring System """)))
def show_detail_report(self, rule_obj): """ Show the detail report. :param rule_obj: the instance of the RuleObject. :return: None """ # Count the confidence print("") print(f"Confidence: {rule_obj.check_item.count(True) * 20}%") print("") if rule_obj.check_item[0]: print(red(CHECK_LIST), end="") print(green(bold("1.Permission Request")), end="") print("") for permission in rule_obj.x1_permission: print("\t\t" + permission) if rule_obj.check_item[1]: print(red(CHECK_LIST), end="") print(green(bold("2.Native API Usage")), end="") print("") print("\t\t" + rule_obj.x2n3n4_comb[0]["method"]) if rule_obj.check_item[2]: print(red(CHECK_LIST), end="") print(green(bold("3.Native API Combination")), end="") print("") print("\t\t" + rule_obj.x2n3n4_comb[0]["method"]) print("\t\t" + rule_obj.x2n3n4_comb[1]["method"]) if rule_obj.check_item[3]: print(red(CHECK_LIST), end="") print(green(bold("4.Native API Sequence")), end="") print("") print("\t\t" + "Sequence show up in:") for seq_methon in self.same_sequence_show_up: print("\t\t" + repr(seq_methon)) if rule_obj.check_item[4]: print(red(CHECK_LIST), end="") print(green(bold("5.Native API Use Same Parameter")), end="") print("") for seq_operation in self.same_operation: print("\t\t" + repr(seq_operation))
def print_info(message): print(bold(cyan("[*]")) + f" {message}")
def print_success(message): print(bold(green("[+]")) + f" DONE: {message}")
def print_error(message): print(bold(red("[!]")) + f" ERROR: {message}")
def print_warning(message): print(bold(yellow("[!]")) + f" WARNING: {message}")
def print_warning(message): print(bold(yellow("[!]")) + " WARNING: {0}".format(message))
def print_info(message): print(bold(cyan("[*]")) + " {0}".format(message))
def print_success(message): print(bold(green("[+]")) + " DONE: {0}".format(message))
def print_error(message): print(bold(red("[!]")) + " ERROR: {0}".format(message))