Advertisement
Guest User

Untitled

a guest
Apr 13th, 2019
718
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. #!/usr/local/bin/miniscript
  2.  
  3. // String Split
  4. // Splitting a string into a list of strings is an insanely useful thing to do.
  5. // Alas, MiniScript doesn't have a standard intrinsic for that. Perhaps it
  6. // will one day. Until then, here’s code that does the job.
  7. split = function(s, delim=" ")
  8. result = []
  9. wordStart = 0
  10. sLen = s.len
  11. delimLen = delim.len
  12. i = 0
  13. while i < sLen
  14. if s[i:i+delimLen] == delim then
  15. result = result + [ s[wordStart:i] ]
  16. wordStart = i + delimLen
  17. i = wordStart
  18. else
  19. i = i + 1
  20. end if
  21. end while
  22. return result + [ s[wordStart:i] ]
  23. end function
  24.  
  25. hashes = split(File.open("/home/panda/Desktop/Miniscript/hashes").read, ",")
  26. passwords = split(File.open("/home/panda/Desktop/Miniscript/passwords").read, " ")
  27. uncracked = []
  28. for hash in hashes
  29. i=0
  30. for password in passwords
  31. if password[password.indexOf(":")+1:] == hash[hash.indexOf(":")+1:] then
  32. print(hash[:hash.indexOf(":")]+":"+password[:password.indexOf(":")])
  33. i=1
  34. break
  35. end if
  36. end for
  37. if i == 0 then
  38. uncracked.push(hash)
  39. end if
  40. end for
  41. print(" ")
  42. print("Uncracked hashes")
  43. for uncrack in uncracked
  44. print(uncrack)
  45. end for
Advertisement
Comments
  • kriegor191
    155 days
    # text 1.16 KB | 0 0
    1. 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.
    2. Your post is a bit old so it's entirely possible that your problem was solved via newer in game methods.
    3. 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.
    4. [code]
    5. pc = get_shell.host_computer
    6. filetodecode = home_dir + "[directory for the file to decode]"
    7. content = pc.File(filetodecode).get_content
    8. content = content.split("\n")
    9. passwordlist = {}
    10. for each in content
    11. sliceto = each.indexOf(":")
    12. user = slice(each, 0, sliceto)
    13. encodedpass = slice(each, sliceto+1)
    14. decipheredall = include_lib("/lib/crypto.so").decipher(encodedpass)
    15. passwordlist[user] = str(decipheredall)
    16. end for
    17. print passwordlist
    18. [/code]
Add Comment
Please, Sign In to add comment
Advertisement