binwalk命令参数中文说明

binwalk是一款强大的二进制分析工具,能够进行文件签名扫描、数据提取、熵分析和二进制比较。它支持自定义签名、递归提取、熵阈值设置等功能。通过参数如--signature、--extract、--entropy等,用户可以定制化binwalk的行为,例如扫描文件、提取特定数据并进行熵分析,以发现隐藏在文件中的信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

binwalk参数英文说明:

Usage: binwalk [OPTIONS] [FILE1] [FILE2] [FILE3] ...

Signature Scan Options:
    -B, --signature              Scan target file(s) for common file signatures
    -R, --raw=<str>              Scan target file(s) for the specified sequence of bytes
    -A, --opcodes                Scan target file(s) for common executable opcode signatures
    -m, --magic=<file>           Specify a custom magic file to use
    -b, --dumb                   Disable smart signature keywords
    -I, --invalid                Show results marked as invalid
    -x, --exclude=<str>          Exclude results that match <str>
    -y, --include=<str>          Only show results that match <str>

Extraction Options:
    -e, --extract                Automatically extract known file types
    -D, --dd=<type:ext:cmd>      Extract <type> signatures, give the files an extension of <ext>, and execute <cmd>
    -M, --matryoshka             Recursively scan extracted files
    -d, --depth=<int>            Limit matryoshka recursion depth (default: 8 levels deep)
    -C, --directory=<str>        Extract files/folders to a custom directory (default: current working directory)
    -j, --size=<int>             Limit the size of each extracted file
    -n, --count=<int>            Limit the number of extracted files
    -r, --rm                     Delete carved files after extraction
    -z, --carve                  Carve data from files, but don't execute extraction utilities

Entropy Analysis Options:
    -E, --entropy                Calculate file entropy
    -F, --fast                   Use faster, but less detailed, entropy analysis
    -J, --save                   Save plot as a PNG
    -Q, --nlegend                Omit the legend from the entropy plot graph
    -N, --nplot                  Do not generate an entropy plot graph
    -H, --high=<float>           Set the rising edge entropy trigger threshold (default: 0.95)
    -L, --low=<float>            Set the falling edge entropy trigger threshold (default: 0.85)

Binary Diffing Options:
    -W, --hexdump                Perform a hexdump / diff of a file or files
    -G, --green                  Only show lines containing bytes that are the same among all files
    -i, --red                    Only show lines containing bytes that are different among all files
    -U, --blue                   Only show lines containing bytes that are different among some files
    -w, --terse                  Diff all files, but only display a hex dump of the first file

Raw Compression Options:
    -X, --deflate                Scan for raw deflate compression streams
    -Z, --lzma                   Scan for raw LZMA compression streams
    -P, --partial                Perform a superficial, but faster, scan
    -S, --stop                   Stop after the first result

General Options:
    -l, --length=<int>           Number of bytes to scan
    -o, --offset=<int>           Start scan at this file offset
    -O, --base=<int>             Add a base address to all printed offsets
    -K, --block=<int>            Set file block size
    -g, --swap=<int>             Reverse every n bytes before scanning
    -f, --log=<file>             Log results to file
    -c, --csv                    Log results to file in CSV format
    -t, --term                   Format output to fit the terminal window
    -q, --quiet                  Suppress output to stdout
    -v, --verbose                Enable verbose output
    -h, --help                   Show help output
    -a, --finclude=<str>         Only scan files whose names match this regex
    -p, --fexclude=<str>         Do not scan files whose names match this regex

    -s, --status=<int>           Enable the status server on the specified port

binwalk参数中文说明:

用法: binwalk [选项] [文件1] [文件2] [文件3] ...

文件签名扫描选项:

    -B, --signature              使用常见的文件签名扫描目标文件
    -R, --raw=<str>              使用指定字节序列扫描目标文件
    -A, --opcodes                使用普通可执行操作码签名扫描目标文件
    -m, --magic=<file>          使用指定的特殊格式文件
    -b, --dumb                   禁用智能签名关键字
    -I, --invalid                显示标记为无效的结果
    -x, --exclude=<str>          排除与str相匹配的结果
    -y, --include=<str>          只显示与str相匹配的结果

提取选项:
    -e, --extract                自动提取已知的文件类型
    -D, --dd=<type:ext:cmd>      提取类型的签名<type>, 文件扩展名为 <ext>, 执行的命令 <cmd>
    -M, --matryoshka             递归扫描提取文件
    -d, --depth=<int>            限制-M递归的范围 (默认值: 8次)
    -C, --directory=<str>       提取文件或文件夹至指定文件夹 (默认值: 当前工作文件夹)
    -j, --size=<int>            限制每个提取文件的大小
    -n, --count=<int>            限制提取文件的数量
    -r, --rm                     清除在提取过程中提取工具无法处理的零大小文件。
    -z, --carve                  从文件中切割数据,但是不执行提取程序

熵分析选项:
    -E, --entropy                计算文件熵
    -F, --fast                   使用快速但是不详细的熵分析
    -J, --save                   自动将由-E生成的的熵图保存为PNG文件而不是直接显示。
    -Q, --nlegend                将熵图的说明省略
    -N, --nplot                  不生成熵图
    -H, --high=<float>           设置上升边缘熵触发阈值 (默认值: 0.95)
    -L, --low=<float>           设置下降边缘熵触发阈值 (默认值: 0.85)

二进制比较选项:
    -W, --hexdump                执行输入文件的十六进制转储(s)和颜色编码区分:绿色—这些字节在所有文件中都是相同的。红色-这些字节在所有文件中都是不同的。蓝色—这些字节在某些文件中是不同的。
    -G, --green                  只显示在所有文件中都相同的字节所在的行
    -i, --red                    只显示在所有文件中都不相同的字节所在的行
    -U, --blue                  只显示在某些文件中都不相同的字节所在的行
    -w, --terse                  比较所有文件,但是只显示第一个文件的16进制转储

原始压缩选项:
    -X, --deflate                用蛮力识别可能的原始压缩数据流
    -Z, --lzma                   扫描原始LZMA压缩流
    -P, --partial                只使用常用的压缩选项搜索压缩流,速度快。
    -S, --stop                   在获得第一个结果后停止

通用选项:
    -l, --length=<int>           需扫描的字节数
    -o, --offset=<int>          跳过文件偏移量开始扫描
    -O, --base=<int>             为所有的打印结果偏移量增加一个基址
    -K, --block=<int>            设置文件块大小
    -g, --swap=<int>             在扫描前每n字节反转一次
    -f, --log=<file>             把结果记录到文件
    -c, --csv                    把结果记录到CSV文件中
    -t, --term                   格式化输出,已使用终端窗口
    -q, --quiet                  禁用输出到标准输出
    -v, --verbose                启用详细输出,包括目标文件MD5和扫描时间戳。
    -h, --help                   显示帮助信息
    -a, --finclude=<str>         只扫描文件名匹配正则表达式的文件
    -p, --fexclude=<str>         不扫描文件名匹配正则表达式的文件
    -s, --status=<int>           在指定端口启动状态服务器

### Binwalk 命令概述 `binwalk` 是一种用于分析固件镜像或其他二进制文件的强大工具,能够检测并提取其中嵌入的文件系统、压缩包等内容。以下是关于 `binwalk` 的常见用法及其参数说明。 --- #### **基本语法** ```bash binwalk [选项] 文件名 ``` --- #### **常用参数** 1. `-e`: 提取模式。此参数会自动解压和提取所有被识别的内容到当前目录下的子文件夹中[^1]。 ```bash binwalk -e vmlinux ``` 2. `-B`: 跳过确认提示。当执行某些操作时,默认不会询问用户是否继续,而是直接跳过交互过程。 3. `-y signature`: 只扫描指定类型的签名。例如只查找特定格式的数据(如 JPEG 或 ZIP)。 ```bash binwalk -y zip firmware.bin ``` 4. `--run-as=user`: 以指定用户身份运行命令。这在需要特殊权限的情况下非常有用。 ```bash binwalk --run-as=root ../vmlinux ``` 5. `-r`: 将提取的结果保存回原始输入文件的位置而不是默认的工作目录。 6. `-d directory`: 指定提取目标路径而非默认创建的新文件夹。 ```bash binwalk -e -d /tmp/output/ firmware.img ``` 7. `-M|--matryoshka`: 启动递归扫描功能,在已找到的目标上再次调用 binwalk 进行进一步解析。 8. `-C directory`: 设置临时工作区位置来存储中间处理数据。 9. `--signature|--non-signature`: 控制启用或禁用基于签名的扫描方式。 10. `-t`: 输出更简洁的人类可读形式报告而省略部分细节信息。 --- #### **示例演示** ##### 示例一:简单扫描 仅查看文件中的结构而不做任何修改或提取动作。 ```bash binwalk vmlinux ``` ##### 示例二:带提取功能 将发现的所有组件都导出来单独存放到新建立的子目录里。 ```bash binwalk -e vmlinux ``` ##### 示例三:高级设置 结合多个标志位完成复杂任务比如定义输出地址以及切换至 root 权限下运作。 ```bash binwalk -e -d ./output_dir --run-as=root ../firmware.bin ``` --- #### **注意事项** 虽然可以通过附加参数如 `--run-as=root` 实现更高权限的操作,但在实际应用过程中务必小心谨慎对待涉及敏感资源访问的需求以免引发安全风险或者违反法律法规等问题发生。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值