Head-Breaker 爆头者
针对文件恶意扫描解析而生
源自
ButterAndButterfly
Butter, 寓意宅男; Butterfly, 寓意美好的事物。
美好的世界由我们创造!
技术原理
可读性破坏
- 当我们解析某类文件(比如
.mp4/.jpg)时,往往需要根据该类文件约定俗成的规范进行读取。
而不论哪种规范,头部往往是关键。在大多数情况下,更改头部(必要的时候加上尾部)的寥寥几个几十个字节即可使得文件完全无法解析。- 当然文本除外,缺失几个字节对文本后续阅读基本上没有影响
- 针对某些压缩算法(尤其是不带密码的),因为有一定的冗余的修复信息,一般密钥需要更长一点,且最好对尾部进行一定的破坏
可还原性
本项目根据密钥字符串的字节长度,读取文件相应长度的头/尾部,采用逐字节做加法取模的方法进行加密破坏。
相应的,自然可以采用逐字节做减法取模的方法进行解密还原。
转换速度
相比较于各种压缩/加密算法,由于我们只针对密钥长度的文件部分进行破坏/还原,无论文件有多大,速度低于秒级,快的飞起。
如何安装
pip install --upgrade h-breaker
或者克隆本项目后
pip setup.py install
或者前往Release页面下载exe文件
如何使用
usage: h-breaker [-h] [-breaks | -recover] [-all | -only_tail] path key
version 1.0.0 : 文件头破坏者,用于简单加密文件头/尾部
positional arguments:
path 待处理的文件路径
key 密钥
optional arguments:
-h, --help show this help message and exit
-breaks, -b 破坏文件
-recover, -r 恢复文件
-all, -a 同时破坏文件头+文件尾
-only_tail, -ot 仅破坏尾巴
举例
- 破坏文件
test.mp4,口令字符串为3.1415926
h-breaker ./test.mp4 3.1415926
- 还原文件
test.mp4(假设已经被破坏,相应的口令字符串为3.1415926)
h-breaker ./test.mp4 3.1415926 -r
- 破坏文件
test.zip,口令字符串为(需要足够长)12345678901234567890123456789012345678901234567890
h-breaker ./test.zip 12345678901234567890123456789012345678901234567890 -a
- 还原文件
test.zip(假设已经被破坏,相应的口令字符串为12345678901234567890123456789012345678901234567890)
h-breaker ./test.zip 12345678901234567890123456789012345678901234567890 -a -r
重要的话
- 为了提高处理速度,我们直接对原文件进行读写操作,而不是再copy一个副本,在进行操作之前请确认文件已经备份!!!
- 如果不小心误操作了,不用慌,记住密钥,使用相反操作即可还原。
LICENSE
MIT
Metadata
Release files for h-breaker 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| h-breaker-1.0.0.tar.gz | 4.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| h_breaker-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / h-breaker-1.0.0.tar.gz
| Download URL | h-breaker-1.0.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4496760b5b0fc6e9bb8d83e13aa12a598b6c9bb36952a409750d2eb701334fea
|
|
BLAKE2b-256 checksum How to use checksums |
cd130947f8e86791665c77a9f8a3e016fe19a38d898c7d6125228b1db09edefe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Release files / h_breaker-1.0.0-py3-none-any.whl
| Download URL | h_breaker-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0fe57cc7a2aaabd16bcb3b65a3cc2efb0ae3535f49b5520bdb4af3d9e7f65a9f
|
|
BLAKE2b-256 checksum How to use checksums |
066593b79168bb64245466aab38120887ea5995142d8580923f37ab2ebcac504
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Security for h-breaker 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.