工具:
openssl
rsatool.py(可在https://github.com/adeptex/rsatool或者https://github.com/ius/rsatool(免安装)上下载)
1、openssl解析pubkey.pem得到n Modulus=C2636AE5C3D8E43FFB97AB09028F1AAC6C0BF6CD3D70EBCA281BFFE97FBE30DD
openssl rsa -pubin -text -modulus -in warmup -in pubkey.pem
2、n转十进制 ,大数分解:http://factordb.com/ 得到 p q ,e=65537
3、rstool.py所需 模块安装:
gmpy 安装方法 下载对应文件:https://www.lfd.uci.edu/~gohlke/pythonlibs/#gmpy
pip2 install gmpy-1.17-cp27-none-win_amd64.whl
pyasnl
pip2 install pyasn1==0.4.5
4、rstool生成私钥文件:
python rsatool.py -o private.pem -e 65537 -p 275127860351348928173285174381581152299 -q 319576316814478949870590164193048041239
5、使用private.pem解密flag.enc得到flag
openssl rsautl -decrypt -in flag.enc -inkey private.pem
参考文章:https://blog.csdn.net/qq_39596232/article/details/98474091
参考文章:https://www.cnblogs.com/pcat/p/11633170.html