fwhunt scan
1.0.0
UEFI 펌웨어를 분석하고 F 와트 규칙으로 UEFI 모듈을 확인하는 도구.
리진 (V0.6.2)
pip 로 설치합니다 ( python3.6 이상에서 테스트) :
$ python -m pip install fwhunt-scan
수동으로 설치 :
$ git clone https://github.com/binarly-io/fwhunt-scan.git && cd fwhunt-scan
$ python setup.py install
별도의 모듈 분석/스캔 :
$ python3 fwhunt_scan_analyzer.py analyze-module {image_path} -o out.json
$ python3 fwhunt_scan_analyzer.py scan-module --rule {rule_path} {image_path}
전체 펌웨어 이미지 스캔 :
$ python3 fwhunt_scan_analyzer.py scan-firmware -r rules/BRLY-2021-001.yml -r rules/BRLY-2021-004.yml -r rules/RsbStuffingCheck.yml test/fw.bin
종속성 설치를 피하려면 Docker 이미지를 사용할 수 있습니다.
다음과 같이 로컬로 Docker 이미지를 만들 수 있습니다.
docker build -t fwhunt_scan .
또는 GHCR에서 최신 이미지를 가져 오십시오.
사용의 예 :
docker run --rm -it -v {module_path}:/tmp/image:ro
fwhunt_scan analyze-module /tmp/image # to analyze EFI module
docker run --rm -it -v {module_path}:/tmp/image:ro -v {rule_path}:/tmp/rule.yml:ro
fwhunt_scan scan-module /tmp/image -r /tmp/rule.yml # to scan EFI module with specified FwHunt rule
docker run --rm -it -v {module_path}:/tmp/image:ro -v {rule_path}:/tmp/rule.yml:ro
fwhunt_scan scan-firmware /tmp/image -r /tmp/rule.yml # to scan firmware image with specified FwHunt rule
docker run --rm -it -v {module_path}:/tmp/image:ro -v {rules_directory}:/tmp/rules:ro
fwhunt_scan scan-firmware /tmp/image --rules_dir /tmp/rules # to scan firmware image with specified rules directory
이 모든 단계는 fwhunt_scan_docker.py 스크립트에서 자동화됩니다.
python3 fwhunt_scan_docker.py analyze-module {module_path} # to analyze EFI module
python3 fwhunt_scan_docker.py scan-module -r {rule_path} {module_path} # to scan EFI module with specified FwHunt rule
python3 fwhunt_scan_docker.py scan-firmware -r {rule_path} {firmware_path} # to scan firmware image with specified FwHunt rule
python3 fwhunt_scan_docker.py scan-firmware --rules_dir {rules_directory} {firmware_path} # to scan firmware image with specified rules directory
기본 사용 예제 :
from fwhunt_scan import UefiAnalyzer
...
uefi_analyzer = UefiAnalyzer ( image_path = module_path )
print ( uefi_analyzer . get_summary ())
uefi_analyzer . close () from fwhunt_scan import UefiAnalyzer
...
with UefiAnalyzer ( image_path = module_path ) as uefi_analyzer :
print ( uefi_analyzer . get_summary ())Linux 플랫폼에서는 파일 대신 분석을 위해 Blob을 전달할 수 있습니다.
from fwhunt_scan import UefiAnalyzer
...
with UefiAnalyzer ( blob = data ) as uefi_analyzer :
print ( uefi_analyzer . get_summary ()) from fwhunt_scan import UefiAnalyzer , UefiRule , UefiScanner
...
uefi_analyzer = UefiAnalyzer ( module_path )
# rule1 and rule2 - contents of the rules on YAML format
uefi_rules = [ UefiRule ( rule1 ), UefiRule ( rule2 )]
scanner = UefiScanner ( uefi_analyzer , uefi_rules )
result = scanner . result