From 2ba4129f44b1f30fc90bb9926ea4b531fe07ba28 Mon Sep 17 00:00:00 2001 From: "Emily Rye (ryee2)" Date: Tue, 30 Nov 2021 23:15:19 +0000 Subject: [PATCH 1/2] Update leap.py added file output option --- src/leap.py | 64 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 13 deletions(-) diff --git a/src/leap.py b/src/leap.py index b9e77d0..3e8d07c 100644 --- a/src/leap.py +++ b/src/leap.py @@ -115,8 +115,30 @@ def privesc_3(): print("priv-esc-3 by:") +def file_output(output): + # get file name from user + print("Enter file name:") + filename = input() + + # get file path from user + print("\nEnter file path:") + print("(If left blank the file will be stored in the current directory)") + filepath = input() + + # if no path given, use current directory + if filepath == "": + filepath = os.getcwd() + + # write enum result to file + file = open(f"{filepath}\{filename}", "a") + file.write(f"{output}\n") + + # close file + file.close + + def menu(sys): - quit = False + finish = False # display windows menu if sys == "Windows": @@ -165,37 +187,45 @@ def menu(sys): if (start == 2) or (start == 4) or (start == 7) or (start == 9): start = 13 - # go to function chosen by user + # go to function chosen by user, print returned value if start == 1: - print(enum_1()) + result = enum_1() + print(result) input() elif start == 2: - print(enum_2()) + result = enum_2() + print(result) input() elif start == 3: - print(enum_3()) + result = enum_3() + print(result) input() elif start == 4: - print(enum_4()) + result = enum_4() + print(result) input() elif start == 5: - print(enum_5()) + result = enum_5() + print(result) input() elif start == 6: - print(enum_6()) + result = enum_6() + print(result) input() elif start == 7: - print(enum_7()) + result = enum_7() + print(result) input() elif start == 8: - print(enum_8()) + result = enum_8() + print(result) input() elif start == 9: @@ -203,7 +233,7 @@ def menu(sys): input() elif start == 10: - print(privesc_2()) + print(privesc_2(sys)) input() elif start == 11: @@ -212,14 +242,22 @@ def menu(sys): elif start == 12: # if user wants to quit - quit = True + finish = True else: print("Invalid Input") input() + # if enumeration selected, offer to print result to a file + if start in range(1, 8, 1): + print("Would you like to print to a file? Y/N") + + # if user says yes, print to file + if input().upper() == "Y": + file_output(result) + # return whether user wants to quit - return quit + return finish # continue to display menu From 40b2a15a7f4daf72275c41ea80239f04fad30556 Mon Sep 17 00:00:00 2001 From: "Emily Rye (ryee2)" Date: Tue, 30 Nov 2021 23:17:16 +0000 Subject: [PATCH 2/2] Update leap.py --- src/leap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/leap.py b/src/leap.py index 3e8d07c..e7f63b5 100644 --- a/src/leap.py +++ b/src/leap.py @@ -100,7 +100,7 @@ def privesc_1(): os.system("ipconfig/all") #runs the command -def privesc_2(): +def privesc_2(ops): print("priv-esc-2 by: Webb") if ops == "Windows":