# cve_patch **Repository Path**: zhangjianjun_code/cve_patch ## Basic Information - **Project Name**: cve_patch - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2021-07-08 - **Last Updated**: 2021-07-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cve-tracking ## 一、流程图 ![流程](https://images.gitee.com/uploads/images/2021/0701/114945_50b243d5_8079354.png "屏幕截图.png") ## 二、代码下载: ```shell git clone https://gitee.com/gongzt/cve.git ``` ## 三、权限修改: ```shell chmod 755 -R xxx/cve(下载代码所在路径) ``` > root@localhost:/opt/project/cve_tracking > ▶ **git clone https://gitee.com/gongzt/cve.git** > Cloning into 'cve'... > remote: Enumerating objects: 840, done. > remote: Counting objects: 100% (840/840), done. > remote: Compressing objects: 100% (801/801), done. > remote: Total 840 (delta 578), reused 64 (delta 34), pack-reused 0 > Receiving objects: 100% (840/840), 176.65 KiB | 977.00 KiB/s, done. > Resolving deltas: 100% (578/578), done. > > root@localhost:/opt/project/cve_tracking > ▶ **chmod 755 -R cve** ## 四、执行代码 首先需要安装依赖的python插件(仅第一次使用时需要): ```shell pip3 install -r xxx/requirements.txt ``` ### 1、只查找和下载补丁,不执行打补丁操作 特点:执行快,占用空间少 - 执行方法: ```shell python3 xxx/cve/src/cve/cve.py -cve CVE编号 -name 软件包名 -branch 软件包分支(支持多个) ``` - 执行后结果: 下载文件和日志记录在:/tmp/cve_tracking/match_cve下,文件以 ”软件包名-cve号“ 命名 > root@localhost:/tmp/cve_tracking/match_cve > ▶ ll > total 0 > drwx------. 3 root root 80 Jun 30 16:49 freerdp-CVE-2020-11523 进入路径后: repair-verdict.txt为查找日志,包含cve信息和补丁链接信息,下载成功的补丁文件在以”软件包版本号“命名的文件夹中。 > root@localhost:cve_tracking/match_cve/freerdp-CVE-2020-11523 > ▶ ll > total 64K > drwx------. 2 root root 60 Jun 30 16:49 0.0.0 > -rw-------. 1 root root 486 Jun 30 16:49 repair-verdict.txt > > root@localhost:cve_tracking/match_cve/freerdp-CVE-2020-11523 > ▶ cd 0.0.0 > > root@localhost:match_cve/freerdp-CVE-2020-11523/0.0.0 > ▶ ll > total 64K > -rw-------. 1 root root 1.7K Jun 30 16:49 CVE-2020-11523_1.patch ### 2、查找和下载补丁并执行打补丁操作 特点:自动执行rpmbuild实验补丁是否可用,执行慢,占用空间大(主要为安装依赖包) - 执行方法: ```shell python3 xxx/cve/src/cve/cve.py -cve CVE编号 -name 软件包名 -branch 软件包分支(支持多个) -cmd ``` - 执行后结果: 下载文件和查找日志和上面一致 源码编译结果也在 repair-verdict.txt 文件中 源码包下载路径和补丁拷贝路径为: /tmp/cve_tracking/download_source > root@localhost:/tmp/cve_tracking/download_source > ▶ ll > total 0 > drwx------. 3 root root 260 Jun 30 17:07 freerdp 具体的编译日志为进入对应软件包文件夹后rpmbuild.log: > root@localhost:cve_tracking/download_source/freerdp master ✗ 153d2h ⚑ ◒ > ▶ ll > total 7.2M > -rw-------. 1 root root 1.7K Jun 30 17:07 CVE-2020-11523_1.patch > -rw-------. 1 root root 1.1K Jun 30 17:07 Fix-freerdp-shadow-cli-exit-codes-for-help-and-version.patch > -rw-------. 1 root root 4.9K Jun 30 17:07 Fix-xfreerdp-exit-codesfor-help-and-similar-option-1.patch > -rw-------. 1 root root 4.3K Jun 30 17:07 Fix-xfreerdp-exit-codesfor-help-and-similar-option-2.patch > -rw-------. 1 root root 692 Jun 30 17:07 Fix-xfreerdp-exit-codesfor-help-and-similar-option-3.patch > -rw-------. 1 root root 6.6M Jun 30 17:07 FreeRDP-2.2.0.tar.gz > -rw-------. 1 root root 5.6K Jun 30 17:07 freerdp.spec > -rw-------. 1 root root 5.5K Jun 30 17:07 freerdp.spec.bak > -rw-------. 1 root root 78 Jun 30 17:07 freerdp.yaml > -rw-------. 1 root root 1.3K Jun 30 17:07 rpmbuild.log