Recon >>

Task 1 – nmap >>

Task 2 – dirsearch >>

OK, let’s look on it >>

So we know name of user >> root >>

And we know id_rsa public key >>

Other tasks all in one >>

I create small python script all in one >>

https://github.com/TheSysRat/BreakRSA-THM

It is really easy, in first we identify modulus by cryptography.hazmat.primitives lib >

After that we can use identify length of modulus >

After that we can calcul p,q parameters and e we know (it is 65537) >>

We use public def factorize(modulus) there are two parameters p and q in dict and difference between is clear >>

And finally generate new private key >>

After that we can get flag >>

And DONE we break poorly implemented RSA !!

Happy Hacking !!

Leave a Reply

Your email address will not be published. Required fields are marked *