Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    6
    Rep Power
    0

    Need help with regex


    I have been trying to solve this for hours and can't do it, so can anybody from here help me?
    Thanks.

    Originally Posted by Puzzle number 5
    I hashed a piece of text (called plaintext) and from that I got the hash:
    Message Digest (MD5): 85eced5b223a2b8a1e89c70986aa687b

    Hint: The plaintext matches the regular expression [(a|x|y)n-t\|]{8}

    To crack the md5, use the regular expression to crack it in 10 seconds instead of 10 days..

    Question: what's the plaintext I used?
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    Can you translate the regex into English? Describe the strings it matches.


    [edit] I can't be sure because they may have been intentionally tricky, but
    Code:
    [(a|x|y)n-t\|]{8}
    looks like it was written by someone who doesn't know regular expressions very well. If they did then they'd know that neither parentheses nor | alternations work inside character sets. They essentially wrote
    Code:
    [an-txy()|]{8}
    But both ways of interpreting the expression still lead you to the correct answer so it's not a problem.
    Last edited by requinix; June 12th, 2013 at 12:58 PM.
  4. #3
  5. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    help you how? Help you understand the task? Help you with the regex? Help you choose a tool to solve the puzzle? Help you implement a solution in your favorite programming language x?

    Contrary to popular belief, we're not psychic. This means we cannot read your thoughts or anything like that. You have to actually tell us what you wanna do and what your problem is. Then we can try to help you.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    6
    Rep Power
    0
    I basically need the puzzle solved.
    I came up with multiple solutions, and when I hashed them to MD5, it didn't match the given hash. So that means I didn't solve the regular expressions part right.

    When you solve the regular expressions part, you should paste that into here (http://www(DOT) miraclesalad(DOT)com/webtools/md5.php) and get a match with the MD5 hash given.

    Thanks.
  8. #5
  9. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    If you have something running that isn't giving the right answer, how about you post that so we can find out where the problem is?

    And just out of curiousity, what solutions did you get?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    6
    Rep Power
    0
    What I understood from this:

    [(a|x|y)n-t\|]{8}

    Is that the text is:

    a, x or y + a letter from the range of n to t, repeated 8 times.

    Eg. xoxoxoxoxoxoxoxo

    Maybe I'm just failing to understand how this works. I have no clue.

    edit: I pasted every possible solution out of here into the hash generator, and still can't get the 85eced5b223a2b8a1e89c70986aa687b hash
  12. #7
  13. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    Pretending for a minute that () and | work as they usually do (which isn't true but seems to be what the author expected),

    Code:
    [(a|x|y)n-t\|]{8}
    [...] is a character set. It means you can choose any one of the items represented inside. This one has a|x|y ("a or x or y") and n-t ("any letter between n and t") and a literal pipe | character.
    The {8} repeats that same character set - not the actual character you found but the set itself - eight times.
    Code:
    [(a|x|y)n-t\|][(a|x|y)n-t\|][(a|x|y)n-t\|][(a|x|y)n-t\|][(a|x|y)n-t\|][(a|x|y)n-t\|][(a|x|y)n-t\|][(a|x|y)n-t\|]
    Thus strings like
    Code:
    nononono
    ||||||||
    axy|ostp
    all match while
    Code:
    aaaaaaa  (only seven characters)
    AXYAXYAX (character set only allows lowercase)
    axyn-t\| (character set does not allow hyphens or backslashes)
    do not match.


    So your alphabet is anopqrstxy|. Some eight-character-long combination of those will MD5-hash into 85eced5b223a2b8a1e89c70986aa687b.

    Small spoiler: the solution starts with "op" (highlight/reply to see it).
  14. #8
  15. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Originally Posted by mick678
    What I understood from this:

    [(a|x|y)n-t\|]{8}

    Is that the text is:

    a, x or y + a letter from the range of n to t, repeated 8 times.

    Eg. xoxoxoxoxoxoxoxo
    Nope, that's a misunderstanding caused by the crappy regex syntax (as mentioned by requinix).

    A regex character class ([...]) is a plain list of single characters -- hence the name. Anything you put between the square brackets will be interpreted as literal characters, so stuff like "|", parentheses etc. don't work like they normally would in a regex.

    When you sanitize the regex and write it like it's probably meant, you get this:
    Code:
    [an-txy|]{8}
    So you have 8 characters from this set:
    Code:
    a, n, o, p, q, r, s, t, x, y, |
    This yields "aaaaaaaa", "aaaaaaan", "aaaaaaao", ..., "||||||||"

    To "crack" the hash, you can either write your own program to enumerate all possibilities and compare their MD5 hashes with the desired result, or you can use a tool like Hashcat (which will be much faster).
    Last edited by Jacques1; June 12th, 2013 at 06:09 PM.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    6
    Rep Power
    0
    Thanks for the help, but I can't figure it out. Could be post the solution?
  18. #10
  19. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Download the already mentioned Hashcat (it's free, and there's even a GUI) and run it. You'll learn from that, and you'll be satisfied afterwards.

    If somebody tells you the solution, you won't learn anything. You won't even remember what the puzzle is about.

    We can help you if you got a concrete question, but spoiling an interesting puzzle is just stupid.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    6
    Rep Power
    0
    I downloaded hashcat, but I can't run it for some reason.
    Could you just stop torturing me and give me the solution? It's a puzzle for In game cash in San Andreas Multiplayer, and I am not into programming, nor do I know anything about it or regular expressions.
  22. #12
  23. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    A videogame using a very programming-oriented question? Surprising.

    How about an easier regex? The solution matches
    Code:
    [ao][pqr][ao][pqr]\|[xy]{3}
    and uses 6 distinct letters (ie, one is used twice).

    Comments on this post

    • mick678 agrees
    Last edited by requinix; June 13th, 2013 at 05:51 PM.
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    6
    Rep Power
    0
    Thanks for the help, finnaly figured it out. Cheers.
    It was opaq|xyx
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    5
    Rep Power
    0

    I think same you


    I think same you. However, this does not need perplexing. just [axyn-t\|]{8}
    I was test at php.toolregex.com



    Originally Posted by mick678
    What I understood from this:

    [(a|x|y)n-t\|]{8}

    Is that the text is:

    a, x or y + a letter from the range of n to t, repeated 8 times.

    Eg. xoxoxoxoxoxoxoxo

    Maybe I'm just failing to understand how this works. I have no clue.

    edit: I pasted every possible solution out of here into the hash generator, and still can't get the 85eced5b223a2b8a1e89c70986aa687b hash
  28. #15
  29. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    4
    Rep Power
    0
    I am facing the same quiz, but with different regex, I was trying to understand the way of obtaining the plain text, step by step from what y'all posted here, but without any luck.

    Regex - [defn-t|]{8}
    MD5 Hash - 864995662b9f61615f01347a70db894b

    Now, I have no idea how to "generate/find" the correct letters combination from the regex. Can I get some help aswell please?
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo