Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/miniscript
- // String Split
- // Splitting a string into a list of strings is an insanely useful thing to do.
- // Alas, MiniScript doesn't have a standard intrinsic for that. Perhaps it
- // will one day. Until then, here’s code that does the job.
- split = function(s, delim=" ")
- result = []
- wordStart = 0
- sLen = s.len
- delimLen = delim.len
- i = 0
- while i < sLen
- if s[i:i+delimLen] == delim then
- result = result + [ s[wordStart:i] ]
- wordStart = i + delimLen
- i = wordStart
- else
- i = i + 1
- end if
- end while
- return result + [ s[wordStart:i] ]
- end function
- hashes = split(File.open("/home/panda/Desktop/Miniscript/hashes").read, ",")
- passwords = split(File.open("/home/panda/Desktop/Miniscript/passwords").read, " ")
- uncracked = []
- for hash in hashes
- i=0
- for password in passwords
- if password[password.indexOf(":")+1:] == hash[hash.indexOf(":")+1:] then
- print(hash[:hash.indexOf(":")]+":"+password[:password.indexOf(":")])
- i=1
- break
- end if
- end for
- if i == 0 then
- uncracked.push(hash)
- end if
- end for
- print(" ")
- print("Uncracked hashes")
- for uncrack in uncracked
- print(uncrack)
- end for
Advertisement
Comments
-
- I'm unsure if your script has similar functionality or if yours does something more. I'm very new to scripting and kind of new to Greyhack. Been playing off and on for a while, through several major patches.
- Your post is a bit old so it's entirely possible that your problem was solved via newer in game methods.
- Here is the script that I was able to build to concatenate an entire file of passwords. Similar to the first time you're shown passwords, you need to place your username and passwords in a single line in a text file. I did not code any error catches but if the format is followed it places everything into a map and you can decode the entire file instead of one at a time. Unsure of the code syntax.
- [code]
- pc = get_shell.host_computer
- filetodecode = home_dir + "[directory for the file to decode]"
- content = pc.File(filetodecode).get_content
- content = content.split("\n")
- passwordlist = {}
- for each in content
- sliceto = each.indexOf(":")
- user = slice(each, 0, sliceto)
- encodedpass = slice(each, sliceto+1)
- decipheredall = include_lib("/lib/crypto.so").decipher(encodedpass)
- passwordlist[user] = str(decipheredall)
- end for
- print passwordlist
- [/code]
Add Comment
Please, Sign In to add comment
Advertisement