Skip to content

Commit

Permalink
Merge pull request #19 from dayj18/Webb's-branch
Browse files Browse the repository at this point in the history
0.2.35
ryee2 committed Nov 30, 2021
2 parents 0c0fe6b + 7377749 commit 2246ea0
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions src/leap.py
Original file line number Diff line number Diff line change
@@ -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}"


@@ -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()
@@ -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"
@@ -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:
@@ -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"
@@ -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:
@@ -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:
@@ -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()
@@ -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

0 comments on commit 2246ea0

Please sign in to comment.