diff --git a/AirlockTools.py b/AirlockTools.py index 8dd8441..9b84ef7 100644 --- a/AirlockTools.py +++ b/AirlockTools.py @@ -41,23 +41,23 @@ def menu(): augmented = utils.hashfunctions.augmentAggregatedHashes(url,aggregated) print(augmented) - augmented.to_html("augmentedlist.html", index=False) + augmented.to_html("z_augmented_list.html", index=False) badpublisherlist = [] categorized = utils.hashfunctions.categorizeHashes(augmented, 5, badpublisherlist) - categorized[0].to_html("needsreview.html", index=False) - categorized[1].to_html("approved.html", index=False) - categorized[2].to_html("remaining.html", index=False) + categorized[0].to_html("z_needs_review.html", index=False) + categorized[1].to_html("z_approved_hashes.html", index=False) + categorized[2].to_html("z_remaining.html", index=False) if choice == '4': - html_file = "augmentedlist.html" + html_file = "z_augmented_list.html" augmented_df = pd.read_html(html_file) print(augmented_df) combined_df = pd.concat(augmented_df, ignore_index=True) path_eligible, path_ineligible = utils.pathfunctions.filepathInitialGroup(combined_df) - path_eligible.to_html("EligblePaths.html", index=False) - path_ineligible.to_html("IneligiblePaths.html",index=False) + path_eligible.to_html("z_eligble_paths.html", index=False) + path_ineligible.to_html("z_ineligible_paths.html",index=False) if choice == '5': @@ -70,23 +70,23 @@ def menu(): augmented = utils.hashfunctions.augmentAggregatedHashes(url,aggregated) print(augmented) - augmented.to_html("augmentedlist.html", index=False) - html_file = "augmentedlist.html" + augmented.to_html("z_augmented_list.html", index=False) + html_file = "z_augmented_list.html" augmented_df = pd.read_html(html_file) combined_df = pd.concat(augmented_df, ignore_index=True) path_eligible, path_ineligible = utils.pathfunctions.filepathInitialGroup(combined_df) - path_eligible.to_html("EligblePaths.html", index=False) - path_ineligible.to_html("IneligiblePaths.html",index=False) + path_eligible.to_html("z_eligble_paths.html", index=False) + path_ineligible.to_html("z_ineligible_paths.html",index=False) badpublisherlist = ["Brave Software, Inc.", "Zoom Video Communications, Inc."] categorized = utils.hashfunctions.categorizeHashes(augmented, 5, badpublisherlist) - categorized[0].to_html("needsreview.html", index=False) - categorized[1].to_html("approved.html", index=False) - categorized[2].to_html("remaining.html", index=False) + categorized[0].to_html("z_needs_review.html", index=False) + categorized[1].to_html("z_approved_hashes.html", index=False) + categorized[2].to_html("z_remaining.html", index=False) allowpaths = utils.allowfunctions.filter_and_drop(categorized[1],path_eligible,4) - allowpaths.to_html("AllowedPaths.html", index=False) + allowpaths.to_html("z_allowed_paths.html", index=False) diff --git a/utils/hashfunctions.py b/utils/hashfunctions.py index 82a1c81..25d4819 100644 --- a/utils/hashfunctions.py +++ b/utils/hashfunctions.py @@ -64,8 +64,8 @@ def augmentAggregatedHashes(url, agg_df: pd.DataFrame) -> pd.DataFrame: df_api = pd.DataFrame(rows) - aug_df = agg_df.merge(df_api, on="sha256", how="left") - + df = agg_df.merge(df_api, on="sha256", how="left") + aug_df = df[['sha256', 'filename_x', 'description', 'productname', 'productversion', 'publisher_y', 'publisher_x', 'netdomain', 'hostname', 'username', 'pprocess', 'gprocess', 'commandline', 'reputation_lastseen', 'reputation_scannercount', 'reputation_scannermatch', 'reputation_status', 'reputation_threatlevel', 'reputation_threatname', 'reputation_timestamp']] return aug_df def categorizeHashes(aug_df: pd.DataFrame, threat_tolerance: int, untrusted_publishers: list):