Making security analysis simpler by applying AI to binary artefacts of firmware
Project description
fw2ai
This is a tool for analysing binaries from extracted firmware images. It has the capabilities to convert relevant artefacts from binary files that can used with AI to simplify firmware analysis.
Getting started
Configuration
Configuration file defines following parameters that can be customized.
default config file name (resides in current directory):
./config.ini
Section | Parameter | Default | Description |
---|---|---|---|
general | config_path | ./config.ini |
Path to configuration file |
general | firmwares_dir | ./firmwares |
Directory containing firmwares |
general | output_dir | ./output |
Directory where output will be generated |
log | log_path | ./log.txt |
Path to log file |
log | log_level | INFO |
Log level |
Default configuration
[general]
config_path=./config.ini
firmwares_dir=./firmwares
output_dir=./output
[log]
log_level=INFO
log_path=./log.txt
Logging
Logging levels supported are:
- CRITICAL
- ERROR
- WARNING
- INFO
- DEBUG
Usage
fw2ai --help
fw2ai [-f | --fw-dir] /path/to/dir/with/all/firmware
fw2ai [-o | --output-dir ] /path/to/output/dir
fw2ai [-c | --config ] /path/to/config/file
Developer Notes
CLI architecture
There are three parameter types:
-
Arguments: Mandatory
pip install requests
-
Options: Optional eg.
pip install requests --proxy http://10.11.22.33
-
Flags: Optional (for enabling or disabling features)
ls -al ls --help
PyPi Lifecycle
Authenticaion
File name: ~/.pypirc
[pypi]
username = __token__
password = <PUT THE TOKEN HERE>
Generate source and binary distribution
python setup.py sdist bdist_wheel
Test locally
Install locally
pip install -e .
Uploading to PyPi
Upload to PyPi:
python -m twine upload dist/* --verbose
Git push
git push -u origin main
Git Configuration
There are 3 levels of git config; project, global and system. Ref
- project: Project configs are only available for the current project and stored in .git/config in the project's directory.
- global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.
- system: System configs are available for all the users/projects and stored in /etc/gitconfig. Create a project specific config, you have to execute this under the project's directory:
$ git config user.name "Mahesh Patil"
$ git config user.email "cpuinfo10@gmail.com"
Create a global config:
$ git config --global user.name "Mahesh Patil"
$ git config --global user.email "cpuinfo10@gmail.com"
Create a system config:
$ git config --system user.name "Mahesh Patil"
$ git config --system user.email "cpuinfo10@gmail.com
Design Notes
Handling CLI arguments, options and flags
Three popular options Ref for handling CLI arguments, options and flags are:
- sys.argv
- argparse
- click
Check Video:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fw2ai-0.1.1.tar.gz
.
File metadata
- Download URL: fw2ai-0.1.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d45448f72d94ce5caac191be931eb6de07ba2b3b6e9cb335a623655ab6663592 |
|
MD5 | b43ec540078468ed39d905ac2af597d7 |
|
BLAKE2b-256 | 0b6c23e0941e52fae56c31d4ddfaaf34f452a053f39f34f44b045353a40094a4 |
File details
Details for the file fw2ai-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: fw2ai-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 370b1133f3285a49f721dadfe5a31bd624b1ec83bfa82847f6a6357db5c3e77f |
|
MD5 | d84a77b9717a539f2282d1c8a48a20f6 |
|
BLAKE2b-256 | ed7f8b96da9be46d5562c87189146321966475c15940fbfc8d2efb133e06fbfb |