script.md
Is the decipher same code with updates - Show user and pass - Prompt design Replace main decipher in /bin folder
# my documentation Is the decipher same code with updates - Show user and pass - Prompt design Replace main decipher in /bin folder
script.src
// Developer : deadx
// Version : 1.0
// Description : Just better to use
// Date : 2023-10-19
crypto = include_lib("/lib/crypto.so")
if not crypto then exit("Error: Missing crypto library")
if params.len != 1 or params[0] == "-h" or params[0] == "--help" then exit(command_info("decipher_usage"))
if params[0] == "-v" or params[0] == "--version" then exit( "[+] Version : 1.1" )
GetPassword = function(userPass)
if userPass.len != 2 then exit("[-] decipher: " + file.path + " wrong syntax")
password = crypto.decipher(userPass[1])
return password
end function
origFile = params[0]
file = get_shell.host_computer.File(origFile)
if not file then exit("[-] decipher2: can't find " + origFile)
if file.is_binary then exit("[-] decipher2: can't read " + origFile + ". Binary file")
if not file.has_permission("r") then exit("[-] decipher2: can't read file. Permission denied")
if file.get_content.len == 0 then exit("[-] decipher2: no users found")
lines = file.get_content.split("\n")
password = null
if lines.len == 1 then
userPass = lines[0].split(":")
password = GetPassword(userPass)
else
print("[+] Multiple users found.")
numLine = 1
for line in lines
if line.len > 0 then
print(numLine + ": " + line)
numLine = numLine + 1
end if
end for
option = ""
inputOk = false
while( not inputOk )
option = user_input("Select user: ").to_int
if typeof(option) != "number" or (option < 1 or option > lines.len) then
print("[-] Invalid input. Type a valid number")
else
inputOk = true
end if
end while
userPass = lines[option - 1].split(":")
print("[$] Deciphering...")
password = GetPassword(userPass)
end if
if not password then exit("[-] Can't find password :(")
print("[+] User : " + userPass[0])
print("[+] Password : " + password)