Skip to content

Update Test #2

Merged
merged 15 commits into from
Dec 11, 2020
Prev Previous commit
Next Next commit
Update
Just save some new files and new enumerations
mospher committed Nov 29, 2020
commit 17af529425892ceb2de36c46f3831b51ecaacb97
18 changes: 18 additions & 0 deletions src/all_information.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

from colors import bcolors

from js_plugins import HostInfo

import os
import subprocess

if __name__=="__main__":

print(bcolors.CGREY + "====" + bcolors.ENDC + bcolors.WARNING + "[BASIC INFORMATION]" + bcolors.ENDC + bcolors.CGREY + "="*37 + bcolors.ENDC)

info=[]
info.append(HostInfo())


print(bcolors.CGREY + "="*60 + bcolors.ENDC)

27 changes: 20 additions & 7 deletions src/js_plugins.py
Original file line number Diff line number Diff line change
@@ -12,6 +12,8 @@

import netifaces as ni

import subprocess


# A very basic method, but useful
def shellRun(command):
@@ -48,7 +50,22 @@ def execute(self):
shellRun("sudo xterm")
print("Done")

import subprocess

class FileSystem(Enumeration):
def __init__(self):
Enumeration.__init__(self)
self.name="File Systems"
self.author="Pedro Tinoco"
self.description="Use sudo to 'hack' into the root account"

def execute(self):
print('\033c') # clean console
print("[READ/WRITE IN /ETC]---- ")
subprocess.call("ls -alh /var/log", shell=True)





def grabOutput(command):
sp = subprocess.run(command, stdout=subprocess.PIPE)
@@ -61,10 +78,10 @@ def __init__(self):

print('\tHostname: ' + '\n\t-> ' + grabOutput("hostname"), end="")

print('\n\tUser: ' + '\n\t-> ' + grabOutput("whoami"), end="")
print('\tUser: ' + '\n\t-> ' + grabOutput("whoami"), end="")

#print('\n\tUser: ' + '\n\t-> ' + grabOutput("w"), end="")

"""
print("\n\tID Info: ")
idData = grabOutput("id")
parts = idData.split(" ")
@@ -75,9 +92,6 @@ def __init__(self):
groups = parts[2][7:].split(".")
for g in groups:
print(f"\t-> {g}")
"""



print("\n\tIP Adress: ")
ni.ifaddresses('eth0')
@@ -86,6 +100,5 @@ def __init__(self):






43 changes: 25 additions & 18 deletions src/leap.py
Original file line number Diff line number Diff line change
@@ -7,13 +7,13 @@
from js_plugins import DumbSudoEscalation

#--ENUMERATION---------------------------
from js_plugins import HostInfo
from js_plugins import FileSystem

#--LIBRARIES----------------------------
import time
import argparse
import subprocess
import os
import subprocess
import argparse



@@ -27,12 +27,15 @@

#And enumerations
ens=[]
ens.append(FileSystem())



shouldQuit=False

print('\033c') # clean console


"""
#Progresse bar loading
total = 1000
@@ -45,17 +48,9 @@

print('\033c') # clean console
"""


while not shouldQuit:

print(bcolors.CGREY + "====" + bcolors.ENDC + bcolors.WARNING + "[BASIC INFORMATION]" + bcolors.ENDC + bcolors.CGREY + "="*37 + bcolors.ENDC)

info=[]
info.append(HostInfo())

print("\n\t MORE[+]\n")

print(bcolors.CGREY + "====" + bcolors.ENDC + bcolors.WARNING + "[MENU]" + bcolors.ENDC + bcolors.CGREY + "="*50 + bcolors.ENDC)

print(bcolors.CGREEN + "\n[PRIVILEGE ESC]" + bcolors.ENDC)
@@ -66,12 +61,12 @@
print(bcolors.CGREEN + "\n[ENUMERATION]" + bcolors.ENDC)
print("\t|")
for i in range(len(ens)):
print("\t|-" + bcolors.CRED + f"[P{i}] " + bcolors.ENDC + bcolors.BOLD + bcolors.UNDERLINE + f"{ens[i].name}" + bcolors.ENDC)
print("\t|-" + bcolors.CRED + f"[E{i}] " + bcolors.ENDC + bcolors.BOLD + bcolors.UNDERLINE + f"{ens[i].name}" + bcolors.ENDC)

print("\n")
print(bcolors.CGREY + "="*60 + bcolors.ENDC)

print("\nQ to quit")
print("\nBASIC INFORMATION[+] \nRESET[R] \nEXIT[Q]")
print()
userInput=input("Enter a selection: ")
print(bcolors.CGREY + "="*60 + bcolors.ENDC)
@@ -81,17 +76,26 @@
if userInput == "Q":
shouldQuit=True
print('\033c') # clean console

elif (userInput[0] in ["P","E"] and #Privesc or enumeration
len(userInput)>1): #Make sure it's more than 1 letter

elif userInput == "+":
print('\033c')
os.system('python3 all_information.py')

elif userInput == "R":
print('\033c')


#Privesc or enumeration
elif (userInput[0] in ["P","E"] and len(userInput)>1): #Make sure it's more than 1 letter

print('\033c') # clean console
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)
print("Invalid selection:", userInput)
break
else:
index=int(index) #Make it a number
@@ -100,7 +104,10 @@
print(chosen.info())
yesno=input("Enter Y in capitals to execute... ")
if yesno.strip()=="Y":
chosen.execute()
chosen.execute();




else:
print("Unknown command")
1 change: 1 addition & 0 deletions src/plugins.py
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ def __init__(self):
self.author="James Shuttleworth"
self.description="Someone needs to write this bit"
self.version = 1.0

def execute(self):
"""Execute the privelege escalation/enumeration, dropping the user
into a shell or displaying collected info.
27 changes: 27 additions & 0 deletions src/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import os
import subprocess


dic = { 'E1':'find /etc/ -readable -type f 2>/dev/null', 'E2':'whoami'}

choise = input("Select: ")

for key, values in dic.items():
if choise == key:
subprocess.call('find /etc/ -readable -type f 2>/dev/null', shell=True)