剑庭安
首页
黑客安全首页全部安全栏目 黑客技术黑客技术、渗透测试、漏洞利用工具与教程 安全软件安全工具、扫描器、检测与审计软件 病毒分析恶意软件分析、样本、逆向与沙箱 CTF思路CTF 题目、writeup、解题思路与工具 防护思路防御技术、加固、检测响应与蓝队 红蓝攻防红队攻击模拟、蓝队对抗、攻防演练 漏洞知识库漏洞、CVE、PoC、EXP 与安全研究
逆向|反编译
PHP源码PHP 网站源码、程序、系统 APP源码安卓/iOS APP 源码 ASP源码ASP 网站源码与程序 NET源码.NET 网站源码与系统 小程序源码微信/支付宝小程序源码 Dedecms风格模板Dedecms 织梦风格模板 Empirecms风格模板EmpireCMS 帝国风格模板 Discuz商业模板/插件Discuz 商业模板与插件 WordPress主题/插件WordPress 主题与插件 其它源码、模板其它各类源码与模板 游戏源码游戏源码与引擎项目 加密货币源码加密货币、区块链、钱包、USDT/比特币相关源码与工具 手游源码手机游戏源码、服务端、客户端与引擎项目 传奇源码热血传奇、传奇世界、复古传奇等客户端/服务端/引擎源码 页游源码网页游戏、H5 游戏、浏览器游戏源码 端游源码电脑单机游戏、PC 网游客户端/服务端源码
最新万能免驱动支持所有型号打印机下载程序 日历天气老黄历 · 每天同步真实日期与天气
站长工具站长工具 自助开通会员浏览该分类 其他资源qtziy SEO工具SEO工具 站群源码站群源码 泛程序泛程序 蜘蛛模板蜘蛛模板 蜘蛛池蜘蛛池 外链工具外链工具
搜索 自助开通会员🔓 破甲 API
登录 注册
首页 分类列表 防护思路 String-Analyzer - String ext…
防护思路
作者:admin 发布:2026-10-06

String-Analyzer - String extraction for CTI and malware analysis: UR

项目说明String Analyzer![PyPI]()![Python]()![CI]()![Publish]()![License: GPL v3](LICENSE)String extraction for CTI and malware-analysis workflows: surface…
资源可下载 免费下载 0 条讨论
会员资源
开通会员后即可下载全部资源。
登录后开通会员
会员方案
374浏览量
0讨论
2下载链接
可下载资源状态
内容可验证
更新 2026-10-06
人工审核发布
评论区答疑

项目说明

String Analyzer

![PyPI]()
![Python]()
![CI]()
![Publish]()
![License: GPL v3](LICENSE)

String extraction for CTI and malware-analysis workflows: surface URLs, IPs, paths, registry keys, APIs, commands, encoded data, and analyst-ready prompts from binaries and memory artifacts.

CTI Use

Use String Analyzer when a sample or dump needs fast indicator discovery before reverse engineering or sandboxing. The output is designed to feed IOC review, infrastructure pi, YARA/Sigma ideas, and ATT&CK-mapped analyst notes.

Defender Outputs

| Output | Use |
|---|---|
| Categorized strings | IOC and behavior discovery |
| URLs / IPs / emails | Pivot and enrichment leads |
| Registry / paths / DLLs | Host behavior context |
| API names | Capability triage |
| Decoded candidates | Obfuscation review |
| AI-ready prompt | Structured analyst follow-up |

String Analyzer extracts and analyzes printable strings from binary files. It is designed for malware analysts, reverse engineers, and forensics in who need to quickly surface URLs, IPs, registry keys, API names, and other indicators from executables, memory dumps, or disk images—and optionally generate an AI-ready analysis prompt.

  • Zero runtime dependencies (Python standard library only).

  • Single entry point: one CLI with batch and interacti.

  • Library-friendly API: use analyze_file() or lower-le in your own scripts.
  • 📖 Practical guide (Medium) — step-by-step usage, workflows, and examples.

    ---

    Table of contents

  • Features

  • Installation

  • Quick start

  • Usage

  • - Command-line options
    - Output modes
    - Interactive mode
  • Pattern categories

  • Programmatic API

  • Examples

  • Configuration and limits

  • Security and safety

  • De

  • License
  • ---

    Features

    | Feature | Description |
    |--------|-------------|
    | String extraction | ASCII and UTF-16LE (Windows PE); configurable min length and max_bytes; chunked read for large files. |
    | Entropy | Shannon entropy (chunked when max_bytes set); high entropy suggests packed/encrypted content. |
    | Pattern detection | Strict IPv4 (0–255), IPv6 (full and abbre), URLs (http/https/ftp/file/ws/wss), obfuscated URLs (hxxp, etc.), emails, MAC addresses, registry keys, system paths, DLLs, 300+ Windows APIs, CMD/PowerShell, obfuscation patterns. |
    | Embedded extraction | URLs, IPs, emails, MACs found *inside* long strings (not only whole-line matches). |
    | Decoding | Base64 (standard and URL-safe) and hex; decoded candidates in report. |
    | Suspicious keywords | Extended set: malware, miner, steal, persist, e, etc., plus .NET namespaces. |
    | Sensitive mode | --sensitive: lower obfuscation thresholds and more keywords for stricter triage. |
    | Output formats | Unfiltered dump, categorized report, or AI-ready markdown prompt. |
    | CLI & API | Full CLI (--encoding, --sensitive, --no-embedded); programmatic analyze_file(); no global state. |

    ---

    Installation

    Requirements: Python 3.8 or newer.

    PyPI

    From source

    After installation you get the string-analyzer command. From the project root you can also run:

    De (optional): pip install -e ".[dev]" adds pytest and ruff for tests and linting.

    ---

    Quick start

    ---

    Usage

    Command-line options

    | Option | Description |
    |--------|-------------|
    | file | Path to the binary file. Omit to run interactive mode. |
    | -o, --output PATH | Output file (default: <basename>_strings.txt). |
    | --min-length N | Minimum string length to extract (default: 4). |
    | --max-bytes N | Stop reading after N bytes (safety for very large files). |
    | --unfiltered | Output all extracted strings, one per line (no categories). |
    | --filtered | Output categorized report (default when not using --unfiltered or --ai-prompt). |
    | --ai-prompt | Generate markdown prompt for an AI assistant. |
    | --analyze-with {gemini,codex} | Send categorized prompt to gemini-cli or codex-cli and print the AI analysis. Saves the prompt to -o; use --ai-output to save the AI response. |
    | --ai-output PATH | Save the AI response to this file (when using --analyze-with). |
    | --encoding {ascii,utf16,both} | Extract ASCII only, UTF-16LE only, or both (default: both). |
    | --sensitive | Lower obfuscation thresholds; more suspicious keywords. |
    | --no-embedded | Do not extract URLs/IPs/emails from inside long strings. |
    | -i, --interactive | Force interactive mode (prompt for file and options). |
    | -q, --quiet | Suppress non-error messages. |
    | -v, -- | logging. |
    | -- | Show . |
    | --help | Show help. |

    Output modes

    1. Unfiltered (--unfiltered): sorted list of all extracted strings. Use for grepping or feeding into other tools.
    2. Filtered (default): categorized report with entropy, plus sections such as URLS, IPS, WINDOWS_API_COMMANDS, DLLS, OBFUSCATED, etc.
    3. AI prompt (--ai-prompt): same categories in a markdown prompt asking an AI to analyze behavior and functionality (e.g. for malware triage).

    External AI analysis (--analyze-with)

    The --analyze-with option sends the categorized string report directly to an AI CLI so you get an analysis in one command instead of copying a prompt by hand.

  • What it does: After extracting and categorizing strings (URLs, IPs, APIs, DLLs, obfuscation, etc.), the tool builds the same markdown prompt used by --ai-prompt, writes it to the path given by -o (so you can keep or reuse it), then pipes that prompt into the chosen CLI. The AI’s reply is printed to the terminal; you can save it with --ai-output PATH.

  • : gemini — uses gemini-cli (looks for gemini or gemini-cli on your PATH). codex — uses Codex CLI (codex exec - with the prompt on stdin).

  • Requirements: You must have one of these installed and on your PATH: Gemini CLI (e.g. npm i -g /generati) or Codex CLI. The tool does not call cloud APIs itself; it only invokes the local CLI, which handles authentication and the model.

  • Example:

  • string-analyzer suspect.exe --analyze-with gemini -o prompt.txt --ai-output analysis.md
    This saves the prompt to prompt.txt, sends it to Gemini, and writes the AI’s analysis to analysis.md.

    Interactive mode

    Run string-analyzer with no file argument (or use string-analyzer -i). The tool will:

    1. Ask for the file path.
    2. Ask whether to output all strings (unfiltered) or a filtered report.
    3. If filtered: ask whether to generate an AI prompt or a normal report.
    4. Ask for the output file path (with a default suggestion).

    Interactive mode limits input to 50 MB by default to avoid accidental resource use.

    ---

    Pattern categories

    Strings are classified into the following categories (empty categories are omitted from output):

    | Category | Description |
    |----------|-------------|
    | WINDOWS_API_COMMANDS | Known Windows API function names (300+). |
    | DLLS | Strings matching typical DLL names (e.g. *.dll). |
    | URLS | HTTP/HTTPS and similar URLs. |
    | IPS | IPv4 addresses. |
    | IPV6 | IPv6 addresses. |
    | EMAILS | Email-like strings. |
    | WINDOWS_REGISTRY_KEYS | Registry path patterns. |
    | POWERSHELL_COMMANDS | PowerShell cmdlets/commands. |
    | CMD_COMMANDS | CMD shell commands. |
    | FILES | File path / filename patterns. |
    | SYSTEM_PATHS | System directory paths. |
    | OBFUSCATED | Patterns suggesting obfuscation (e.g. h[.]xxp, dotted IPs). |
    | DECODED_BASE64 | Strings that successfully decode from Base64 to printable text. |
    | DECODED_HEX | Strings that successfully decode from hex to printable text. |
    | SUSPICIOUS_KEYWORDS | Substrings associated with malware (e.g. key terms). |
    | SUSPICIOUS_DOTNET | .NET-related suspicious namespaces/keywords. |
    | MAC_ADDRESSES | MAC addresses (e.g. 00:1A:2B:3C:4D:5E). |

    The tool also computes file entropy. Combined with a low count of “useful” patterns (APIs, DLLs, CMD/PowerShell), high entropy can indicate a packed or obfuscated binary; this is noted in the report and in the AI prompt.

    ---

    Programmatic API

    Use the package in your own Python code:

    One-shot analysis

    Step-by-step

    Function reference

    | Function | Description |
    |----------|-------------|
    | analyze_file(path, min_length=4, max_bytes=None) | Full analysis; returns dict with file, entropy, strings, patterns, obfuscated. |
    | extract_strings(path, min_length=4, max_bytes=None) | Extract unique printable strings; returns set[str]. |
    | compute_file_entropy(path) | Shannon entropy of file bytes. |
    | shannon_entropy(s) | Shannon entropy of a string. |
    | detect_patterns(strings) | Categorize strings; returns new dict[str, set[str]]. |
    | is_likely_obfuscated(patterns, file_entropy) | Heuristic: few “useful” patterns and entropy &gt; threshold. |
    | generate_normal_output(patterns, entropy, obfuscated) | Formatted filtered report text. |
    | generate_ai_prompt(patterns, entropy, obfuscated) | Markdown prompt text for AI analysis. |
    | is_mostly_printable(s, threshold=0.9) | Whether the string is mostly printable ASCII. |
    | try_base64_decode(s) | Decode Base64 if valid and printable; else None. |
    | try_hex_decode(s) | Decode hex if valid and printable; else None. |

    ---

    Examples

    Malware triage — get an AI prompt for a sample:

    Large file — limit read size and get a filtered report:

    Script — use API and only print URLs and IPs:

    Longer strings only:

    Maximum sensitivity (UTF-16 + embedded URLs + lower obfuscation bar):

    Send to Gemini or Codex for AI analysis (requires gemini-cli or codex on PATH):

    ---

    Configuration and limits

  • Minimum string length: --min-length (default 4). Longer reduce noise and speed up analysis.

  • Maximum bytes read: --max-bytes. Omit for no limit; set for very large files to avoid high memory use.

  • Obfuscation heuristic: Implemented using MIN_USEFUL_COUNT (default 10) and ENTROPY_THRESHOLD (default 5.0) in string_analyzer.patterns. A file is flagged as likely obfuscated when the number of “useful” patterns (Windows API, DLLs, CMD, PowerShell) is below the count threshold and file entropy is above the entropy threshold.
  • ---

    Security and safety

  • Input files: String Analyzer only reads the file and extracts printable strings; it does not execute or interpret code. Still, avoid running it on untrusted binaries in a sensiti without proper isolation.

  • Large files: Use --max-bytes (or the max_bytes parameter in the API) to cap how much is read; interactive mode uses a 50 MB default.

  • Output: Reports may contain URLs, IPs, and other indicators. Handle output according to your security and privacy policies.
  • ---

    De

    CI runs on push/PR: Ruff lint and pytest on Python 3.8, 3.10, and 3.12.

    Documentation: Practical guide (Medium) · docs/DOCUMENTATION.md (patterns, heuristics, workflows)

    ---

    Related repositories & articles

    | Resource | Link |
    |----------|------|
    | String-Analyzer (this repo) | GitHub · Medium: String Analyzer Guide |
    | Static-malware-Analysis-Orchestrator | GitHub — one-command pipeline (triage, strings, PE imports, unpack) · Medium: Full workflow |
    | PE-Import-Analyzer | GitHub · Medium: PE Import Analyzer Guide |
    | Unpacker | GitHub · Medium: Unpacker Guide |
    | Basic-File-Information-Gathering-Script | GitHub · Medium: File Metadata & Static Analysis |
    | Author | Medium @1200km |

    ---

    License

    Distributed under the GNU General Public License v3.0. See LICENSE for details.

    Contributions are welcome; please open an issue or submit a pull request.

    1200km Ecosystem

    This project is part of the 1200km security research ecosystem. Use Ad for CTI-to-detection workflows, ATT&CK/ATLAS mapping, actor relevance, IOC enrichment, and analyst-ready reporting.

  • Ad project hub

  • Ad documentation

  • Live ATT&CK/ATLAS workspace

  • 1200km security research ecosystem
  • 项目信息

    开发语言:Python

    Star 数:7

    技术要点

    该项目属于防护思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕String extraction for CTI and malware analysis: URLs, IPs, registry keys, APIs, encoded data, and analyst-ready prompts.展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。

    从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。

    使用与学习建议

    1. 下载源码压缩包,解压到本地环境。

    2. 根据项目类型准备对应的运行环境与依赖。

    3. 按照 README 中的步骤完成配置与部署。

    4. 在隔离的测试环境中运行验证,避免影响生产系统。

    免责声明

    本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。

    资源标题String-Analyzer - String extraction for CTI and malware analysis: UR
    所属分类防护思路
    发布作者admin
    发布时间2026-10-06 00:13:40
    下载权限 免费下载
    附件数量2 个下载链接
    浏览次数374
    讨论数量0
    主题状态正常讨论中

    本资源免费,登录后即可在本页「下载链接」区域获取全部附件。

    请在评论区留言说明具体链接,或联系作者补档。楼主更新后本页会同步最新的下载地址。

    请先阅读正文中的授权说明;未注明的默认仅限站内学习交流,禁止直接搬运到其他站点二次售卖。
    还没有讨论,快来抢沙发~
    登录 后才能参与讨论
    下载链接
    会员才能下载
    登录后开通会员
    同分类推荐
    暂无同类资源
    免费登录即可下载
    查看会员
    放大预览

    © 2026 剑庭安 - 网站开发定制 SEO 优化蜘蛛池代做 在线看手相算命. 保留所有权利。

    Powered by 酷像SEOv3.0

    网站地图 Sitemap.xml
    首页 全部分类 黑客安全 逆向|反编译 精品源码 站长工具自助开通会员其他资源SEO工具站群源码泛程序蜘蛛模板蜘蛛池外链工具创意乐园 搜索 会员服务 登录 注册