info("Result is an object of type <i>"+typeof(overflowResult)+"</i>")
if typeof(overflowResult) == "null" then
choices = [""]
choices.push("Requirements not met.")
choices.push("Invalid type.")
choice = get_choice(choices, 1)
if choice == 1 then
return null
else if choice == 2 then
choices_b = ["\n<b>Which type of attack should this be listed as?"]
choices_b.push("A root user password change")
choices_b.push("A regular user password change")
choices_b.push("A firewall")
choices_b.push("Nevermind, leave it as it is.")
choice_b = get_choice(choices_b, choices_b.len-1)
if choice_b == 1 then
changeExploitType(exploit, target, "rootpass")
return null
else if choice_b == 2 then
changeExploitType(exploit, target, "userpass")
return null
else if choice_b == 3 then
changeExploitType(exploit, target, "firewall")
return null
else
continue
end if
end if
else if typeof(overflowResult) == "shell" or typeof(overflowResult) == "computer" or typeof(overflowResult) == "file" or typeof(overflowResult) == "number" then
if not exploit.type.lower == typeof(overflowResult) then
if port.get_lan_ip == portFwd.internal.get_lan_ip and port.port_number == portFwd.internal.port_number then toPrint = toPrint+" --->"+C.lb+" external port "+C.o+"<b>"+portFwd.external.port_number
end for
Print(toPrint)
end for
end if
end for
end if
end function
messWithProcs = function(computer)
while 1
choices = ["\n\n<b>The following processes have been detected on the machine:</b>\nChoose the one you would like to kill."]
procs = computer.show_procs.split("\n")
PIDs = []
for b in range(0, procs.len-1)
procCols = procs[b].split(" ")
for c in range(0, procCols.len-2)
procCols[c] = padSpaces(procCols[c], 10)
end for
if b == 0 then
choices[0] = choices[0]+"\n "+procCols.join("")
else
choices.push(procCols.join(""))
PIDs.push(procCols[1])
end if
end for
choices.push("<i>Leave these procs do their proc'ing (exit)</i>")
choice = get_choice(choices, choices.len-1)
if choice == choices.len-1 then return null
Print("<b>Attempting to kill process ID: "+PIDs[choice-1])
r = computer.close_program(PIDs[choice-1].to_int)
if r == 1 then
Print("<b>SUCCESS!</b> You really showed that process you can murder it.")
else if r == 0 then
error("Could not find the process.")
else
error(r)
end if
end while
end function
messWithUsers = function(computer)
choices = ["\n<b>What would you like to do?</b>"]
choices.push("Add a user.")
choices.push("Delete a user.")
choices.push("Forget it.")
choice = get_choice(choices, choices.len-1)
result = null
if choice == 1 then
un = user_input("New user name? > ")
pw = user_input("Password? > ")
result = computer.create_user(un,pw)
else if choice == 2 then
un = user_input("User to delete? >")
delHome = get_yesno(false,"Delete home directory?")
if dirPtr.has_permission("w") then Print("<color=#"+getColorString(dirPtr)+">Directory at <b>"+dirPtr.path+"</b> has write permission.")
if files.len > 0 then
for file in files
if not findUnlockedRWString(file.has_permission("r"), file.has_permission("w")) == "no" then
Print("<color=#"+getColorString(file)+">File at <b>"+file.path+"</b> has "+findUnlockedRWString(file.has_permission("r"), file.has_permission("w"))+" permissions.")
end if
end if
end if
if directories.len > 0 then
for directory in directories
findUnlocked(directory)
end for
end if
end function
findUnlockedDirs = function(f, output)
for fo in f.get_folders
if fo.has_permission("w") then
output.push(fo)
end if
findUnlockedDirs(fo,output)
end for
return output
end function
browseFiles = function(dirPtr, hostInfo = "")
while not dirPtr.parent == null
dirPtr = dirPtr.parent
end while
rootPtr = dirPtr
while 1
directories = dirPtr.get_folders
files = dirPtr.get_files
choices = ["\n\n<b>Contents of "+dirPtr.path+":</b>\n <color=#"+getColorString(dirPtr)+">"+dirPtr.permissions+padSpaces("", 19)+"<.>" ]
isRoot = (dirPtr.path == "/")
if not isRoot then choices.push("<color=#"+getColorString(dirPtr.parent)+">"+dirPtr.parent.permissions+" <..>"+C.e)
Commands["sudo"] = {"Name": "sudo","Description": "It allows users to run programs with administrator security privileges.","Args": "[(opt) -s] [command]"}
Commands["sudo"]["Run"] = function(Args,pipe)
inputPass = user_input("Password: ", true)
if Args[0] == "-u" then
shell = get_shell(Args[2], inputPass)
if not shell then return error("incorrect username or password")
getShell(shell)
else if Args[0] == "-s" then
shell = get_shell("root", inputPass)
if not shell then return error("incorrect password")
getShell(shell)
end if
if Args[0] == "-s" or Args[1] == "-u" then
else
computer = shell.host_computer
args = Args[1:].join(" ")
if not Args[0].indexOf("/") then
globalPath = [globals.path, "/bin", "/usr/bin"]
for path in globalPath
program = computer.File(path+"/"+Args[1])
if program != null then return error(shell.launch(program.path, args))
end for
else
program = computer.File(Args[1])
if not program then return error(Args[1]+" not found.")
shell.launch(program.path, args)
end if
end if
end function
Commands["grep"] = {"Name": "grep","Description": "Looks for text in a string.","Args": "[search] [string]"}
Commands["grep"]["Run"] = function(Args,pipe)
if pipe then Args.push(pipe)
search = Args[0]
input = Args[1]
if input.split("\n").len != 0 then
lines = input.split("\n")
f = []
for line in lines
if line.split(search).len >= 2 then f.push(line)
end for
if f.len == 1 then f = f[0]
Print(f)
return f
else
Print(input)
return input
end if
end function
Commands["crack"] = {"Name": "crack","Description": "Cracks a hash.","Args": "[hash]"}
Commands["crack"]["Run"] = function(Args,pipe)
crypto = loadLibrary("crypto.so",true)
if not crypto then return error("Can't find crypto library")
out = ""
login = Args[0]
if pipe then login = pipe
hashes=login
if typeof(login)!="list" then
hashes=[login]
end if
for hash in hashes
if login.split(":").len == 2 then login = login.split(":")[1]
got = crypto.decipher(login)
if got != null then
out=out+t.t+login+" -> "+got+"\n"
else
out=out+t.t+login+" -> "+t.e+"Invalid Hash\n"
end if
end for
return Print(out)
end function
Commands["rshells"] = {"Name": "rshells","Description": "Terminal interface to interact with the installed rshell server and manage incoming connections.","Args": ""}
Commands["rshells"]["Run"] = function(args,pipe)
metaxploit = loadMetaXPloit()
if not metaxploit then exit("Error: Can't find metaxploit library")
Print("Listening for upcoming connections...")
shells = []
while shells.len == 0
shells = metaxploit.rshell_server
if(typeof(shells) == "string") then exit(shells)
if(shells.len == 0) then wait(2)
end while
option = 0
while typeof(option) != "number" or (option < 1 or option > shells.len)
Print(shells.len + " shell(s) connected!\n<b>Select a shell to start a terminal:</b>")
Commands["sniff"] = {"Name": "sniff","Description": "The terminal listens to the network packets of any connection that passes through this device.","Args": "[(opt) saveEncSource]"}
Commands["sniff"]["Run"] = function(params,pipe)
metaxploit = loadMetaXPloit()
if not metaxploit then return error("Error: Can't find metaxploit library")
Print("Starting listen...\nWaiting to incoming data.")