python3之Crypto
今天在写一个压测工具的时候。试运行的时候发现了一个报错
因为我这边压测的接口都是加密请求,需要使用到AES-ECB加密 理所当然的在这个时候我理所当然的执行了
执行如下
然后执行依然是相同的报错。我很奇怪就百度查了资料,然后又执行了
结果报错依旧。我吐了 接着查询。又听了某些人说修改site-packages
文件夹下面的crypto
文件夹名字为Crypto
。
然后还是报错。我没办法了。继续google里面查找资料
终于找到一篇文章Stop using pycrypto. Use pycryptodome instead
就如文章中所说
Pycrypto is vulnerable to a heap-based buffer overflow in the ALGnew function in blocktemplace.c. It allows remote attackers to execute arbitrary code in the python application. It was assigned the <a href="https://security-tracker.debian.org/tracker/CVE-2013-7459" target="blank">CVE-2013-7459</a> number.
Pycrypto didn’t release any fix to that vulnerability and no commit was made to the project since Jun 20, 2014.
意思就是:
Pycrypto 容易受到 blocktemplace.c 中 ALGnew 函数中基于堆的缓冲区溢出的影响。它允许远程攻击者在 python 应用程序中执行任意代码。它被分配了<a href="https://security-tracker.debian.org/tracker/CVE-2013-7459" target="blank">CVE-2013-7459</a>编号。
自 2014 年 6 月 20 日以来,Pycrypto 没有发布对该漏洞的任何修复程序,也没有对该项目进行任何提交。
所以最终得到的解决方案就是 请卸载的所有版本crypto和pycrypto,并且安装pycryptodome: