40 lines
1.0 KiB
JavaScript
40 lines
1.0 KiB
JavaScript
homePW = #envar homePW
|
|
|
|
myShell = get_shell("root", homePW)
|
|
myComputer = myShell.host_computer
|
|
|
|
crypto = include_lib("/lib/crypto.so")
|
|
if not crypto then exit("<center><color=red>There is no crypto.so in you /lib\n</color></center>")
|
|
|
|
passFile = user_input("Path to encrypted file: \n")
|
|
fullString = myComputer.File(passFile).get_content
|
|
lines = fullString.split(char(10))
|
|
|
|
|
|
/* TODO
|
|
Fix logic to properly display name:pass combo
|
|
I think I'm deciphering too late
|
|
I think I should decipher first, then split
|
|
*/
|
|
|
|
userNames = []
|
|
hashes = []
|
|
passes = []
|
|
|
|
for line in lines
|
|
line = line.trim
|
|
if line == "" then continue
|
|
parts = line.split(":")
|
|
//if parts.len < 2 then continue
|
|
userNames.push(parts[0])
|
|
hashes.push(parts[1])
|
|
end for
|
|
|
|
for entry in hashes
|
|
passes.push(crypto.decipher(entry))
|
|
end for
|
|
|
|
for line in userNames
|
|
if not passes[indexOf(line)] then passes.indexOf(line) = "|no password found|"
|
|
print(userNames[indexOf(line)] + " has the password " + passes[indexOf(line)])
|
|
end for |