From ff33de20f615b3488f0826f0a76d67d2dba1421b Mon Sep 17 00:00:00 2001 From: CarrotRub <95135114+CarrotRub@users.noreply.github.com> Date: Mon, 8 Apr 2024 15:20:24 +0200 Subject: [PATCH] Enhanced file listing to include the first line as a description for each file. --- BlueDucky.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/BlueDucky.py b/BlueDucky.py index f5b0465..02d3da2 100644 --- a/BlueDucky.py +++ b/BlueDucky.py @@ -639,13 +639,22 @@ def main(): log.info("No target address provided. Exiting.") return + def read_description_line(file_path): + with open(file_path, 'r') as file: + description_payload = file.readline().strip() # Read the first line and remove trailing whitespaces. + if description_payload.startswith("REM ") : # Remove the REM for better readability. + description_payload = description_payload[4:] + return description_payload + script_directory = os.path.dirname(os.path.realpath(__file__)) payload_folder = os.path.join(script_directory, 'payloads/') # Specify the relative path to the payloads folder. payloads = os.listdir(payload_folder) print("\nAvailable payloads:") - for idx, payload_file in enumerate(payloads, 1): # Check and enumerate the files inside the payload folder. - print(f"{idx}: {payload_file}") + for idx, payload_file in enumerate(payloads, 1): + file_path = os.path.join(payload_folder, payload_file) + description_payload = read_description_line(file_path) + print(f"{idx}: {payload_file} - {description_payload}") payload_choice = input("\nEnter the number of the payload you want to load: ") selected_payload = None