Skip to content

0.2.31 #15

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
251 changes: 199 additions & 52 deletions src/leap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#CW 2
#CW 2
import os
import time
import platform
import ctypes
from uuid import getnode as get_mac
Expand All @@ -13,79 +12,227 @@ def AdminTest():
except:
return False

start = int(input("which line of code would you like to try?\n 1: enum-1 by: Tazmin \n 2: enum-2 by: Jacob\n 3: enum-3 by: Webb\n 4: enum-4 by:Jordan\n 5: enum-5 by:Jacob\n 6: enum-6 by:Joe and tazmin\n 7: enum-7 by:Joe\n 8: enum-8 by:Reece\n 9: priv-esc-1 by:Tazmin and Webb\n 10: priv-esc-2 by:\n 11: priv-esc-3 by:\n"))
if start == 1:
print("enum-1")

def enum_1():
print("enum-1: Get current user by: Tazmin")

Username = os.getlogin()
print(Username)
input()
elif start == 2:
print("enum-2")
return Username


def enum_2():
print("enum-2: Get user domain by: Jacob")

domain = os.environ['userdomain']
print(domain)
input()
elif start == 3:
print("enum-3")
return domain


def enum_3():
print("enum-3: Get operating system by: Webb")

opsys_name = platform.system()

if opsys_name == "Darwin":
opsys_name = "Mac OS"
opsys_name = "Mac"

opsys_release = platform.release()
print(f"{opsys_name} {opsys_release}")
input()
elif start == 4:
print("enum-4")
return f"{opsys_name} {opsys_release}"


def enum_4():
print("enum-4: List all users by: Jordan")

print("List of all users")
print()

data = os.popen("net user")
data = data.read()
print(data)
input()
elif start == 5:
print("enum-5")
return data


def enum_5():
print("enum-5: Port scanning by: Jacob")

info = os.popen("netstat -rn")
info = info.read()
print(info)
elif start == 6:
print("enum-6")
return info


def enum_6():
print("enum-6: Get group ID by: Joe and Tazmin")

gid = os.getgid()
print(gid)
input()
elif start == 7:
pint("enum-7")
return gid


def enum_7():
print("enum-7: Is current user an admin by: Joe")

if ctypes.windll.shell32.IsUserAnAdmin():
print('privilege escalation.')
input()
message = 'privilege escalation.'
else:
print('not privilege escalation')
input()
elif start == 8:
print("enum-8")#
macaddress = get_mac()
print(macaddress)
input()
elif start == 9:
print("priv-esc-1 this was a joint effort by Webb and Tazmin")
if is_admin():
message = 'not privilege escalation'
return message


def enum_8():
print("enum-8: Get MAC address by: Reece")

macaddress = get_mac()
return macaddress


def privesc_1():
print("priv-esc-1 by: Tazmin and Webb")
if AdminTest():
print("you are running in admin.")
print("press enter to view all your prvious saved wifi connections")
print("press enter to view all your previous saved wifi connections")
input()
os.system("netsh wlan show profile")
input()
else:
print("you are not running as admin, press enter to run as admin")
input()
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
print("press enter to view all your prvious saved wifi connections")
print("press enter to view all your previous saved wifi connections")
input()
os.system("netsh wlan show profile")
input()
elif start == 11:
print("priv-esc-2")


def privesc_2():
print("priv-esc-2 by: Webb")
os.system("""powershell -Command "Start-Process cmd -Verb RunAs""""")
input()
elif start == 11:


def privesc_3():
print("priv-esc-3")
input()
#placeholder
else:
print("no input")


def menu():
quit = False

if opsys == "Windows":
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"
"4: List all users by: Jordan\n"
"5: Port scanning by: Jacob\n"
"7: Is current user an admin by: Joe\n"
"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"
"12: Quit program\n")

start = int(input())

if start == 6:
start = 13

elif os == "Darwin":
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"
"4: List all users by: Jordan\n"
"5: Port scanning by: Jacob\n"
"6: Get group ID by: Joe and Tazmin\n"
"7: Is current user an admin by: Joe\n"
"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"
"12: Quit program\n")

start = int(input())

#if start == :
# start =

elif os == "Linux":
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"
"4: List all users by: Jordan\n"
"5: Port scanning by: Jacob\n"
"6: Get group ID by: Joe and Tazmin\n"
"7: Is current user an admin by: Joe\n"
"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"
"12: Quit program\n")

start = int(input())

#if start == :
# start =

if start == 1:
print(enum_1())
input()

elif start == 2:
print(enum_2())
input()

elif start == 3:
print(enum_3())
input()

elif start == 4:
print(enum_4())
input()

elif start == 5:
print(enum_5())
input()

elif start == 6:
print(enum_6())
input()

elif start == 7:
print(enum_7())
input()

elif start == 8:
print(enum_8())
input()

elif start == 9:
print(privesc_1())
input()

elif start == 10:
print(privesc_2())
input()

elif start == 11:
print("priv-esc-3")
input()
#placeholder

elif start == 12:
quit = True

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

return quit

while 1 == 1:
opsys = platform.system()

if (opsys == "Windows") or (opsys == "Darwin") or (opsys == "Linux"):
os.system("cls")
stop = menu()

if stop == True:
break
else:
print("Operating system not recognised")
break