44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
get_bank = function(target_ip, local_ip, mem, key)
|
|
|
|
metaxploit = include_lib("/lib/metaxploit.so")
|
|
if not metaxploit then
|
|
metaxploit = include_lib(current_path + "/metaxploit.so")
|
|
end if
|
|
if not metaxploit then exit("Error: Can't find metaxploit library in the /lib path or the current folder")
|
|
|
|
net_session = metaxploit.net_use( target_ip )
|
|
if not net_session then exit("Error: can't connect to net session")
|
|
|
|
libKernel = net_session.dump_lib
|
|
libName = "kernel_router.so"
|
|
print("Searching " + libName +" ...")
|
|
if not libKernel then exit("Error: " + libName + " not found.")
|
|
|
|
result = libKernel.overflow(mem, key, local_ip)
|
|
|
|
|
|
if(typeof(result) == "shell") then
|
|
result = typeObject.host_computer
|
|
end if
|
|
|
|
if(typeof(result) != "computer") then exit("Error: expected computer, obtained " + typeof(result))
|
|
|
|
output = ""
|
|
homeFolder = result.File("/home")
|
|
if not homeFolder then
|
|
return 1
|
|
else
|
|
print("------BANK------")
|
|
|
|
for userFolder in userFolders
|
|
bankFile = result.File("/home/" + userFolder.name + "/Config/Bank.txt")
|
|
if not bankFile then continue
|
|
if not bankFile.has_permission("r") then exit("Error: can't read file contents. Permission deniend")
|
|
userPass = bankFile.get_content.split(":")
|
|
output = output + userPass[0] + " : " + userPass[1] + "\n"
|
|
print(userPass[0] + "\n" + userPass[1] + "\n")
|
|
end for
|
|
end if
|
|
|
|
return output
|
|
end function |