Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
OMARLEAP/src/leap.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
99 lines (80 sloc)
2.73 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from omar_plugins import linCatEscalator | |
from omar_plugins import HostInfo | |
from omar_plugins import NetInfo | |
from omar_plugins import AppInfo | |
from omar_plugins import linCronInfo | |
from omar_plugins import docker | |
if __name__=="__main__": | |
#Make a list of available privescs | |
pes=[] | |
pes.append(linCatEscalator()) | |
pes.append(docker()) | |
#And enumerations | |
ens=[] | |
ens.append(HostInfo()) | |
ens.append(NetInfo()) | |
ens.append(AppInfo()) | |
ens.append(linCronInfo()) | |
shouldQuit=False | |
while not shouldQuit: | |
print("=".join("-"*20)) | |
print(" _______ ") | |
print("( ____ \|\ /|") | |
print("| ( \/| ) ( |") | |
print("| (__ | (___) |") | |
print("| __) | ___ |") | |
print("| ( | ( ) |") | |
print("| (____/\| ) ( |") | |
print("(_______/|/ \|") | |
print() | |
print("=".join("-"*20)) | |
print() | |
print(" LEAP Menu") | |
print() | |
print("=".join("-"*20)) | |
print("\nPrivescs:") | |
print() | |
for i in range(len(pes)): | |
print(f"\tP{i}: {pes[i].name}") | |
print() | |
print("=".join("-"*20)) | |
print("\nEnumerations:") | |
print() | |
for i in range(len(ens)): | |
print(f"\tE{i}: {ens[i].name}") | |
print() | |
print("=".join("-"*20)) | |
print() | |
print("\nQ to quit") | |
print() | |
userInput=input("Enter a selection: ") | |
print("-"*20) | |
#remove whitespace, make uppercase | |
userInput=userInput.strip().upper() | |
if userInput == "Q": | |
shouldQuit=True | |
print("Session Ended!") | |
elif (userInput[0] in ["P","E"] and #Privesc or enumeration | |
len(userInput)>1): #Make sure it's more than 1 letter | |
useList=ens | |
if userInput[0]=="P": | |
useList=pes | |
index=userInput[1:] #Get the number part... | |
for i in index: | |
if not i.isdigit(): | |
print("Invalid selection:",userInput) | |
break | |
else: | |
index=int(index) #Make it a number | |
if index<len(useList): | |
chosen=useList[index] | |
print(chosen.info()) | |
yesno=input("Enter 'Y' in capitals to execute OR 'N'to Quit: ") | |
if yesno.strip()=="Y": | |
chosen.execute() | |
elif yesno.strip()=="N": | |
print("Quitting") | |
else: | |
print("Invalid Selection") | |
else: | |
print("Unknown command") | |