Skip to main content

Analyzer for files and urls

Project description

xanalyzer

English

简单分析文件和url,python3下运行。
python3.11.8测试可用。

TODO

  1. 文件
    • md5/sha256
    • 文件类型
    • 文件大小
    • 字符串扫描
    • PE文件
      • PE大小
      • 编译时间
      • pdb路径
      • 版本信息
      • 证书验证
      • 节区名称
      • DLL名称
      • EXE导入表检查
      • 查壳
      • 资源段扫描
    • ELF文件
      • ELF大小
      • 查壳
    • JPG文件
      • 结尾是否异常
    • 建议使用的工具
  2. url(website)
    • 域名解析ip
    • 获取robots.txt文件
    • 站内链接扫描(--deep)
    • 站内子域名扫描(--deep)

安装

使用pipx安装:

# pipx: https://pypa.github.io/pipx/  
pip install pipx
pipx ensurepath
pipx install xanalyzer
# 还可以用来升级,但是不能检查新版本
pipx upgrade xanalyzer

如果系统是 Debian/Ubuntu,需要安装依赖:

sudo apt-get install libmagic1

使用帮助

usage: xanalyzer [-h] (-f FILE [FILE ...] | -u URL | --version) [-s] [--deep]
                 [--minstrlen MINSTRLEN]

Process some files and urls. 'xa' can be used instead of 'xanalyzer'

optional arguments:
  -h, --help            show this help message and exit
  -f FILE [FILE ...], --file FILE [FILE ...]
                        analyze one or more files, can be a folder path
  -u URL, --url URL     analyze the url
  --version             print version info
  -s, --save            save log and data
  --deep                analyze deeply
  --minstrlen MINSTRLEN
                        minimum length of the string to be extracted, default
                        4, not less than 2

使用示例

xanalyzer -f hello.exe
xanalyzer -u "https://www.baidu.com/s?wd=hello"
xa -f hello.exe

开发

git clone https://github.com/qux-bbb/xanalyzer
cd xanalyzer
python -m venv venv
# windws使用虚拟环境: .\venv\Scripts\activate
# linux使用虚拟环境: source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements.my.txt
python setup.py develop

这样就可以用pycharm或vscode开发,之后调用main.py调试

打包发布

该步骤仅本人使用

打包前确保VERSION和CHANGELOG.md已更新,README、README-en已添加新功能说明,dist文件夹已清空

安装依赖、通过测试项、打包:

# windws使用虚拟环境: .\venv\Scripts\activate
# linux使用虚拟环境: source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements.my.txt
pytest
python -m build

重新打开一个命令行,转到dist文件夹下本地安装,检查基本功能,举例:

pipx uninstall xanalyzer
pipx install ./xanalyzer-0.2.3.tar.gz
xanalyzer --version
xanalyzer -f ./xanalyzer-0.2.3.tar.gz

在github创建Release

  1. 标题为xanalyzer <version>,如: xanalyzer v0.2.0
  2. 内容基于CHANGELOG.md做一些修改
  3. 将dist文件夹下所有文件传到Release页面
    然后发布即可

将文件传到pypi(需要token)

python -m twine upload --repository pypi dist/*
# username: "__token__"
# password: "pypi-"开头的token字符串

其它

这个项目的有些功能可能会用到:
https://github.com/mitre/multiscanner

参考链接:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xanalyzer-1.2.1.tar.gz (114.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xanalyzer-1.2.1-py3-none-any.whl (122.0 kB view details)

Uploaded Python 3

File details

Details for the file xanalyzer-1.2.1.tar.gz.

File metadata

  • Download URL: xanalyzer-1.2.1.tar.gz
  • Upload date:
  • Size: 114.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.4 requests-toolbelt/1.0.0 urllib3/2.6.3 tqdm/4.67.1 importlib-metadata/8.7.1 keyring/25.7.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.11.8

File hashes

Hashes for xanalyzer-1.2.1.tar.gz
Algorithm Hash digest
SHA256 347b101bc6f5343632d7151137add0bd9b3295a1e2caf5ee724cd64041971cf4
MD5 79ee81396f176ab9aafedc185c257a04
BLAKE2b-256 1f202568398b7cc5c93f4c710014f95cde790da443e7594a3e7c95c9b08a7eba

See more details on using hashes here.

File details

Details for the file xanalyzer-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: xanalyzer-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 122.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.4 requests-toolbelt/1.0.0 urllib3/2.6.3 tqdm/4.67.1 importlib-metadata/8.7.1 keyring/25.7.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.11.8

File hashes

Hashes for xanalyzer-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3411a204ea3ba5e98eff64bfa0d7a1ffd19cc931eb8272c6a69f9c9e66b0f5a1
MD5 986030e21462ef30a64e2d6d802ad27e
BLAKE2b-256 3ad2091f51d567082bc56b0a878845a19912d70cc3b2e0e6c6abdb47f799b61f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page