RsaCtfTool

Well I've run the tool against it, I'm out of ideas!

clubby789

  • GCIH
    If you need help with something, PM me how far you've got already, what you've tried etc (I won't respond to profile comments, or on box release night). And remember to +respect me if I helped you ; )
«1

Comments

  • I'm gonna guess that it's more than just the tool

  • Someone with this error?
    Error: key file does not have a valid BOM

    Always ready to help... Pls consider giving respect on my profile if i help you.
    Most important, have fun and JUST ROOT IT !!!
    https://www.hackthebox.eu/home/users/profile/186611
    SamTheSapien

  • edited February 15

    @R4J Very nice challenge. I didn't think I had anything to learn from these specific types of challenges, but you proved me wrong with that function, I'd never seen that before. Thanks for reality checking me.

    snuggles

  • Found something interesting about n...

    clubby789

    • GCIH
      If you need help with something, PM me how far you've got already, what you've tried etc (I won't respond to profile comments, or on box release night). And remember to +respect me if I helped you ; )
  • Type your comment> @yota5 said:

    Maybe we need to allocate more ram memory for our vm kali

    You don't have to

    R4J

  • Same here, no idea of what to do with the key file

    Jugulairel

  • the number in the key file is a prime number?

    Hack The Box

  • NVM get it, !

    Jugulairel

  • Finally solved it, not sure if I solved it using an intented way as I do not understand the relevance of the challenge name. Also something is wrong with my openssl as I was getting "bad magic number" on the last step, so used an online tool to perform aes decryption

    joeblogg801

  • Type your comment> @joeblogg801 said:

    Finally solved it, not sure if I solved it using an intented way as I do not understand the relevance of the challenge name. Also something is wrong with my openssl as I was getting "bad magic number" on the last step, so used an online tool to perform aes decryption

    rsactftool will not at all help in solving the challenge

    R4J

  • Type your comment> @R4J said:

    Type your comment> @joeblogg801 said:

    Finally solved it, not sure if I solved it using an intented way as I do not understand the relevance of the challenge name. Also something is wrong with my openssl as I was getting "bad magic number" on the last step, so used an online tool to perform aes decryption

    rsactftool will not at all help in solving the challenge

    Thank you for this.

    I'm absolutely not even started yet, but you've just saved me from a very disappointing rabbit hole.

  • edited February 22

    Well, I found that the key is 192 bytes long if you assume that the key is hex.... Meaning that it gives me a hint for the one type of encryption the symmetrical one. I'm guessing that there should be an asymmetrical type of encryption probably. One over the other but i cannot find out which is over the other.

  • I really liked this challenge.
    After understanding the "peculiarity" of the challenge I enjoyed studying the difference with how I tipically approach this encryption type.
    I like when challenges teach you something.

    mrlbender

  • Interesting challenge, learned a lot. I struggled a lot with the tools (openssl and such) and though I suspected (correctly) what the solution should be, it was really difficult for me to execute it just right and work around all the tooling issues.

  • Resolved! The challenge is very interesting, the name only helps to discard things hahaha

  • if they're lost with the "key" file here a hint;
    You should know that RSA is used to share symmetric encryption keys, not to encrypt messages.
    if you need it you can send MP

  • edited March 31

    Thanks to @kd3n4, I was able to solve this. It's actually good ol' fundamental and basic mathematics (modular arithmetic to be precise). You just need a really good calculator. No, not Windows calculator.

    limbernie
    Write-ups of retired machines

  • i think my decrypt is correct because i can read the "key file: se****** ", but i can't decrypt with openssl (i get bad magic number) and the online tools... if someone can help me, a small detail that i forget... thank's

    m4nu

    Valiant, nothing is impossible.
    Lock by lock and one after the other is the key. You cannot open door number 9 until you have unlocked number 8.

  • got it, I hadn't used the right online tool, feel free to PM me. thanks @kd3n4

    m4nu

    Valiant, nothing is impossible.
    Lock by lock and one after the other is the key. You cannot open door number 9 until you have unlocked number 8.

  • Nice challenge. As others, I had some trouble with the "bad magic" error message using openssl. But this is due to a very silly thing: all you need to do is to remove the last byte of the encrypted flag (0xa), because that's new line character, thus not "padding" to 32 bytes.

    Cheers,

    Sociaslkas

  • openssl x509 -in pubkey.pem -text -noout
    unable to load certificate
    139961896822080:error:0909006C:PEM routines:get_name:no start line:crypto/pem/pem_lib.c:745:Expecting: TRUSTED CERTIFICATE

    why I can't detect the size of rsa key from that pem?
    can someone help?

    shaswata56
    ** Life is simple, we make it complex just out of curiosity **

  • With this: "openssl rsa -inform PEM -text -noout -pubin -in pubkey.pem"

    RSA Public-Key: (1535 bit)
    Modulus:
    77:d1:e3:2b:fe:41:fb:07:61:2b:cb:95:2e:8b:19:
    6d:9c:30:39:41:dd:19:47:d4:fb:5e:0f:b8:0d:ea:
    75:38:2a:1c:8c:95:1c:e7:39:44:08:ed:c8:01:d3:
    cd:9b:b4:c5:ac:d6:eb:0f:61:f5:12:ae:a9:03:b3:
    ed:44:0e:bc:f3:c3:8d:8c:1b:af:37:62:f2:e5:25:
    17:dc:3b:6b:32:73:e6:0d:25:30:ea:b5:51:d6:e5:
    5d:d2:34:9d:89:f9:62:82:c3:40:39:f9:a6:f6:a8:
    0f:ac:7e:14:45:86:f3:c9:ee:0b:0b:bd:48:fe:6e:
    5b:79:ab:07:b2:19:58:5e:30:e4:2f:cb:e5:97:23:
    e5:62:fe:3c:2d:95:6d:e2:b7:6e:64:04:b6:54:a0:
    44:83:06:0f:87:64:a9:f1:cf:73:20:70:9e:97:ae:
    83:1d:8c:f3:f0:4c:7d:9f:f2:c3:ab:09:32:35:8c:
    9c:cd:51:8c:49:f4:94:34:40:f4:eb:c7
    Exponent: 65537 (0x10001)

  • I'm totally stuck on it, I think I have understood the goal but I can't figure out how to reach it... Can I PM some one ?

  • anyone able to provide any pointers? Keep getting bad magic number

  • for anyone struggling with getting the flag to decrypt - I couldn't find a working online tool so just used pycrypto instead and it should work first time :)

  • edited June 3

    Whoever made this flag aught to be slapped straight across the face. The numbers they chose makes it almost impossible to get the damn thing into a format that you can use utilities with. And doing it by hand doesn't work either because the "key" message cannot be decoded using the normal format. The way you'd normally do it doesn't work so you have to use a different method that does encrypt and decrypt messages but upon attemping it doesn't work.

    No matter what you do. It will no decrypt with openssl "bad magic number". So you have to either a) use an online tool. b) use some python utility to do aes(or similar library). or c) write your own to do it. Whoever decided to use that prime I hate you.

    Ranked #1 in Master of Overthinking 20yrs running uncontested.
    For Help include machine name in message because my mind's everywhere right now.
    Hack The Box
    https://www.hackthebox.eu/home/users/profile/110608

  • Type your comment> @133794m3r said:

    Whoever made this flag aught to be slapped straight across the face. The numbers they chose makes it almost impossible to get the damn thing into a format that you can use utilities with. And doing it by hand doesn't work either because the "key" message cannot be decoded using the normal format. The way you'd normally do it doesn't work so you have to use a different method that does encrypt and decrypt messages but upon attemping it doesn't work.

    No matter what you do. It will no decrypt with openssl "bad magic number". So you have to either a) use an online tool. b) use some python utility to do aes(or similar library). or c) write your own to do it. Whoever decided to use that prime I hate you.

    Lmao wut

    R4J

  • This was definitely one of the most challenging for me in terms of calculations. However, with the assistance of @kd3n4 and @m4nu, I finally got my head around it.

    Here's some hints to get you moving

    • The modulus is specific type of number, noticeable when factored.
    • The function to determine decryption handles that specific type in a certain way. The wiki page will explain it more.
    • As @socialkas states, the "bad magic number" is a result of a newline character.

    Feel free to PM me or catch me on Discord.

    Hack The Box
    Discord: AzAxIaL#8633

  • Nice challenge! Finally a real cryptography challenge on HackTheBox, similar to CryptoHack.

  • edited June 19

    @133794m3r said:
    Whoever made this flag aught to be slapped straight across the face. The numbers they chose makes it almost impossible to get the damn thing into a format that you can use utilities with. And doing it by hand doesn't work either because the "key" message cannot be decoded using the normal format. The way you'd normally do it doesn't work so you have to use a different method that does encrypt and decrypt messages but upon attemping it doesn't work.

    If anyone ought to be slapped across the face it is you and your stupid comment. All the formats used in this challenge are standard and made sense, except perhaps the encrypted flag could also have been encoded in base64 or hex. But that's easy to work around. Nice challenge @R4J

Sign In to comment.