吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 450|回复: 2
收起左侧

[资源求助] 寻找多数字签名,其中有1个签名过期但其他签名正常的文件

[复制链接]
misszzy 发表于 2025-6-9 18:38
200吾爱币
本帖最后由 misszzy 于 2025-6-10 09:27 编辑

寻找多数字签名,其中有1个数字签名过期但其他签名正常的文件。
例如某个exe、sys或dll文件,有sha1和sha256双签名,但是sha1签名已过期,而sha256数字签名正常。

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

僅此而已。 发表于 2025-6-10 16:38
下一个signtool 工具

[Bash shell] 纯文本查看 复制代码
1
signtool.exe verify /v "path\to\your\file.exe"


这样能检查对应文件的证书信息,比对一下就有了
YWFhYmJi 发表于 2025-6-10 21:02
python 上有一个 signify 库,可以实现高级的签名检查,需要 python3.8 及以上
[Python] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# signify documents: http://signify.readthedocs.io/en/latest/
 
import os, sys
from signify.authenticode import *
 
target_dir = sys.argv[1]
file_processed = 0
file_failed = 0
for root, dirs, files in os.walk(target_dir):
    for file in files:
        filename = os.path.join(root, file)
        try:
            total_count = 0
            vaild_count = 0
            with open(filename, 'rb') as f:
                signed_pe = SignedPEFile(f)
                for sig in signed_pe.signed_datas:
                    isvaild = sig.explain_verify()
                    if isvaild[0] == AuthenticodeVerificationResult.OK:
                        vaild_count += 1
                    total_count += 1
            if total_count > 1 and vaild_count < total_count:
                print(filename)
            file_processed += 1
        except Exception as e:
            print('处理文件 %s 时失败,错误信息: %s' % (filename, e), file=sys.stderr)
            file_failed += 1
 
print('成功处理 %d 个文件,处理失败 %d 个文件' % (file_processed, file_failed), file=sys.stderr)

用法:安装 python3.8 并用 pip 安装 signify,在命令提示符中运行
[Plain Text] 纯文本查看 复制代码
python sigtest.py 要检查的文件夹位置
执行后会将有一个以上的签名并且有效的个数小于总签名个数的文件名输出到标准输出,处理失败时会将文件名和错误信息输出到标准错误
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-8-12 08:54

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表