diff --git a/src/leap.py b/src/leap.py index b9e77d0..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": @@ -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