kali下RsaCtfTool的安装及使用

kali安装gmpy2总是出现各种错误,写个过程。

1.安装方式

 压缩包  下载直接解压即可

命令行 git clone https://github.com/Ganapati/RsaCtfTool.git

2.安装

cd RsaCtfTool //进入目录下
pip install -r requirements.txt  //安装python第三方库

 可能会报错,没关系,是因为你没安装一些环境

安装配置mpfr和mpc时,时间稍长,不要惊讶

安装mpfr

v= 4.0. 1 
wgethttp: // www.mpfr.org/mpfr-current/mpfr-${v}.tar.bz2 
tar-jxvf mpfr-${v}. tar.bz2 && cd mpfr- ${v} 
./configure 
make&& makecheck && make install

安装mpc

v=1.1.0
wget ftp://ftp.gnu.org/gnu/mpc/mpc-${v}.tar.gz
tar -zxvf mpc-${v}.tar.gz && cd mpc-${v}
./configure
make && make check && make install #如果报错的话,用make && make install

 返回RsaCtftool目录下继续安装第三方库

pip install -r requirements.txt

以为安装好了,然而

 

gedit  /etc/ld.so.conf  //打开文件,添加gmpy2的绝对路径
include /usr/local/lib/python2.7/dist-packages/gmpy2 //加上这句话保存即可

 

执行ldconfig命令

ldconfig

dconfig 命令主要是为了更新 /etc/ld.so.cache 文件,为了加快程序执行时对共享库的定位速度,避免使用收索路径查找共享库的低效率 

安装完成

用法

root@kali:~/Desktop/RsaCtfTool-master# python RsaCtfTool.py 
usage: RsaCtfTool.py [-h] [--publickey PUBLICKEY] [--createpub] [--dumpkey]
                     [--ext] [--uncipherfile UNCIPHERFILE]
                     [--uncipher UNCIPHER] [--verbose] [--private]
                     [--ecmdigits ECMDIGITS] [-n N] [-p P] [-q Q] [-e E]
                     [--key KEY]
                     [--attack {hastads,factordb,pastctfprimes,mersenne_primes,noveltyprimes,smallq,wiener,comfact_cn,primefac,fermat,siqs,Pollard_p_1,all}]

RSA CTF Tool

optional arguments:
  -h, --help            show this help message and exit
  --publickey PUBLICKEY
                        public key file. You can use wildcards for multiple
                        keys.
  --createpub           Take n and e from cli and just print a public key then
                        exit
  --dumpkey             Just dump the RSA variables from a key - n,e,d,p,q
  --ext                 Extended dump of RSA private variables in --dumpkey
                        mode - dp,dq,pinv,qinv).
  --uncipherfile UNCIPHERFILE
                        uncipher a file
  --uncipher UNCIPHER   uncipher a cipher
  --verbose             verbose mode (display n, e, p and q)
  --private             Display private key if recovered
  --ecmdigits ECMDIGITS
                        Optionally an estimate as to how long one of the
                        primes is for ECM method
  -n N                  Specify the modulus. format : int or 0xhex
  -p P                  Specify the first prime number. format : int or 0xhex
  -q Q                  Specify the second prime number. format : int or 0xhex
  -e E                  Specify the public exponent. format : int or 0xhex
  --key KEY             Specify the input key file in --dumpkey mode.
  --attack {hastads,factordb,pastctfprimes,mersenne_primes,noveltyprimes,smallq,wiener,comfact_cn,primefac,fermat,siqs,Pollard_p_1,all}
                        Specify the attack mode.

下一篇blog有ras例题

  • 11
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 13
    评论
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值