Skip to content

0.2.35 #19

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions src/leap.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ def enum_2():
def enum_3():
print("enum-3: Get operating system by: Webb")

# get OS name
opsys_name = platform.system()

# display Mac OS as "Mac"
if opsys_name == "Darwin":
opsys_name = "Mac"

# get OS version
opsys_release = platform.release()

# return OS name and version
return f"{opsys_name} {opsys_release}"


Expand Down Expand Up @@ -87,12 +92,12 @@ def privesc_1():
if AdminTest(): #checks the value of admintest
print("you are running in admin.") #confirms that they are using admin
print("press enter to view all your network configs") #shows the user what will happen
input()
input()
os.system("ipconfig/all") #runs the command into the shell and displays the network configs
input()
else: #this is the fail safe if python isn't launched as admin.
print("you are not running as admin, press enter to run as admin") #informs the user they are not admin
input()
input()
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1) #this runs the application as admin allowing us to use OS.System commands that need admin rights
print("press enter to view all your network configs") #shows the user what will happen
input()
Expand All @@ -101,19 +106,25 @@ def privesc_1():

def privesc_2():
print("priv-esc-2 by: Webb")

# open windows cmd as administrator
os.system("""powershell -Command "Start-Process cmd -Verb RunAs""""")


def privesc_3():
print("priv-esc-3 by: Webb")

# open root terminal
os.system("sudo x-terminal-emulator")


def menu(sys):
quit = False

# display windows menu
if sys == "Windows":
print("1Which line of code would you like to try? (Enter a number):\n"
# print menu
print("Which line of code would you like to try? (Enter a number):\n"
"1: Get current user by: Tazmin\n"
"2: Get user domain by: Jacob\n"
"3: Get operating system by: Webb\n"
Expand All @@ -125,6 +136,7 @@ def menu(sys):
"10: priv-esc-2 by: Webb\n"
"12: Quit program\n")

# handle invalid inputs
try:
start = int(input())
except:
Expand All @@ -133,7 +145,9 @@ def menu(sys):
if (start == 6) or (start == 11):
start = 13

# display mac menu
elif sys == "Darwin":
# print menu
print("Which line of code would you like to try? (Enter a number):\n"
"1: Get current user by: Tazmin\n"
"2: Get user domain by: Jacob\n"
Expand All @@ -145,9 +159,10 @@ def menu(sys):
"8: Get MAC address by: Reece\n"
"9: priv-esc-1 by: Tazmin and Webb\n"
"10: priv-esc-2 by: Webb\n"
"11: priv-esc-3 by:\n"
"11: priv-esc-3 by: Webb\n"
"12: Quit program\n")

# handle invalid inputs
try:
start = int(input())
except:
Expand All @@ -156,16 +171,19 @@ def menu(sys):
#if start == :
# start =

# display linux menu
elif sys == "Linux":
# print menu
print("Which line of code would you like to try? (Enter a number):\n"
"1: Get current user by: Tazmin\n"
"3: Get operating system by: Webb\n"
"5: Port scanning by: Jacob\n"
"6: Get group ID by: Joe and Tazmin\n"
"8: Get MAC address by: Reece\n"
"11: priv-esc-3 by:\n"
"11: priv-esc-3 by: Webb\n"
"12: Quit program\n")

# handle invalid inputs
try:
start = int(input())
except:
Expand All @@ -174,6 +192,7 @@ def menu(sys):
if (start == 2) or (start == 4) or (start == 7) or (start == 9) or (start == 10):
start = 13

# go to function chosen by user
if start == 1:
print(enum_1())
input()
Expand Down Expand Up @@ -219,29 +238,39 @@ def menu(sys):
input()

elif start == 12:
# if user wants to quit
quit = True

else:
print("Invalid Input")
input()

# return whether user wants to quit
return quit


# continue to display menu
while 1 == 1:
# find operating system
opsys = platform.system()

if opsys == "Windows":
# clear screen
os.system("cls")
# open menu
stop = menu(opsys)

# if user wants to quit, break loop
if stop is True:
break

elif (opsys == "Darwin") or (opsys == "Linux"):
# clear screen
os.system("clear")
# open menu
stop = menu(opsys)

# if user wants to quit, break loop
if stop is True:
break

Expand Down